Commit 24ea727a by Shujing Zhao Committed by Shujing Zhao

re PR c++/31665 (%s substituted with "built-in"/"library" can't be properly translated)

cp/
2009-12-16  Shujing Zhao  <pearly.zhao@oracle.com>

        PR c++/31665
        * decl.c (duplicate_decls, grokdeclarator): Put the
        diagnostics in full sentences for easy translation and wrapped into
        G_().
        * typeck.c (build_x_unary_op): Likewise.

testsuite/
2009-12-16  Shujing Zhao  <pearly.zhao@oracle.com>

        * g++.old-deja/g++.brendan/misc6.C: Make expected dg-error strings
        explicit.

From-SVN: r155340
parent deb109b2
2009-12-18 Shujing Zhao <pearly.zhao@oracle.com>
PR c++/31665
* decl.c (duplicate_decls, grokdeclarator): Put the diagnostics in
full sentences for easy translation and wrapped into G_().
* typeck.c (build_x_unary_op): Likewise.
2009-12-17 Shujing Zhao <pearly.zhao@oracle.com> 2009-12-17 Shujing Zhao <pearly.zhao@oracle.com>
* call.c (build_over_call, build_java_interface_fn_ref): Update * call.c (build_over_call, build_java_interface_fn_ref): Update
......
...@@ -1180,9 +1180,10 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) ...@@ -1180,9 +1180,10 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
bad choice of name. */ bad choice of name. */
if (! TREE_PUBLIC (newdecl)) if (! TREE_PUBLIC (newdecl))
{ {
warning (OPT_Wshadow, "shadowing %s function %q#D", warning (OPT_Wshadow,
DECL_BUILT_IN (olddecl) ? "built-in" : "library", DECL_BUILT_IN (olddecl)
olddecl); ? G_("shadowing built-in function %q#D")
: G_("shadowing library function %q#D"), olddecl);
/* Discard the old built-in function. */ /* Discard the old built-in function. */
return NULL_TREE; return NULL_TREE;
} }
...@@ -1253,9 +1254,10 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) ...@@ -1253,9 +1254,10 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
olddecl); olddecl);
} }
else else
warning (OPT_Wshadow, "shadowing %s function %q#D", warning (OPT_Wshadow,
DECL_BUILT_IN (olddecl) ? "built-in" : "library", DECL_BUILT_IN (olddecl)
olddecl); ? G_("shadowing built-in function %q#D")
: G_("shadowing library function %q#D"), olddecl);
} }
else else
/* Discard the old built-in function. */ /* Discard the old built-in function. */
...@@ -8616,8 +8618,9 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -8616,8 +8618,9 @@ grokdeclarator (const cp_declarator *declarator,
if (TREE_CODE (type) == FUNCTION_TYPE if (TREE_CODE (type) == FUNCTION_TYPE
&& cp_type_quals (type) != TYPE_UNQUALIFIED) && cp_type_quals (type) != TYPE_UNQUALIFIED)
error ("cannot declare %s to qualified function type %qT", error (declarator->kind == cdk_reference
declarator->kind == cdk_reference ? "reference" : "pointer", ? G_("cannot declare reference to qualified function type %qT")
: G_("cannot declare pointer to qualified function type %qT"),
type); type);
if (declarator->kind == cdk_reference) if (declarator->kind == cdk_reference)
......
...@@ -4361,9 +4361,10 @@ build_x_unary_op (enum tree_code code, tree xarg, tsubst_flags_t complain) ...@@ -4361,9 +4361,10 @@ build_x_unary_op (enum tree_code code, tree xarg, tsubst_flags_t complain)
tree fn = get_first_fn (xarg); tree fn = get_first_fn (xarg);
if (DECL_CONSTRUCTOR_P (fn) || DECL_DESTRUCTOR_P (fn)) if (DECL_CONSTRUCTOR_P (fn) || DECL_DESTRUCTOR_P (fn))
{ {
const char *type = error (DECL_CONSTRUCTOR_P (fn)
(DECL_CONSTRUCTOR_P (fn) ? "constructor" : "destructor"); ? G_("taking address of constructor %qE")
error ("taking address of %s %qE", type, xarg); : G_("taking address of destructor %qE"),
xarg);
return error_mark_node; return error_mark_node;
} }
} }
......
2009-12-18 Shujing Zhao <pearly.zhao@oracle.com>
* g++.old-deja/g++.brendan/misc6.C: Make expected dg-error strings
explicit.
2009-12-17 Jakub Jelinek <jakub@redhat.com> 2009-12-17 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/debug/dwarf2/const-1.c: Don't expect DW_AT_const_value, * gcc.dg/debug/dwarf2/const-1.c: Don't expect DW_AT_const_value,
......
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
inline int i;// { dg-error "" } .* inline int i;// { dg-error "" } .*
struct c { inline int i; };// { dg-error "" } .* struct c { inline int i; };// { dg-error "" } .*
int foo (inline int i);// { dg-error "" } .* int foo (inline int i);// { dg-error "" } .*
inline class c; // { dg-error "" } inline inline class c; // { dg-error "'inline' can only be specified for functions" } inline
inline typedef int t; // { dg-error "" } inline inline typedef int t; // { dg-error "" } inline
class d { inline friend class c; }; // { dg-error "" } inline class d { inline friend class c; }; // { dg-error "'inline' can only be specified for functions" } inline
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment