diff options
author | Shujing Zhao <pearly.zhao@oracle.com> | 2010-02-10 07:37:37 +0000 |
---|---|---|
committer | Shujing Zhao <pzhao@gcc.gnu.org> | 2010-02-10 07:37:37 +0000 |
commit | f25a2b52ab58ffa3d9c5ba773181d0a9515f9e09 (patch) | |
tree | 29acfc35ef9268967bd768e6d51fe3e60b986d58 /gcc | |
parent | 0eb95b0d69b0f1cb862fe9f0021282a273c1ddd7 (diff) | |
download | gcc-f25a2b52ab58ffa3d9c5ba773181d0a9515f9e09.zip gcc-f25a2b52ab58ffa3d9c5ba773181d0a9515f9e09.tar.gz gcc-f25a2b52ab58ffa3d9c5ba773181d0a9515f9e09.tar.bz2 |
Make-lang.in (cp/cvt.o, [...]): Depend on intl.h.
2010-02-10 Shujing Zhao <pearly.zhao@oracle.com>
* Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h.
* cvt.c (warn_ref_binding): Wrap the messages into G_() for easy
translation.
* parser.c (cp_parser_postfix_expression, cp_parser_new_type_id)
(cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype)
(cp_parser_parameter_declaration)
(cp_parser_exception_specification_opt)
(cp_parser_exception_declaration): Likewise.
* pt.c (check_default_tmpl_args): Likewise.
* search.c (lookup_field_r): Likewise.
From-SVN: r156645
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/cp/Make-lang.in | 7 | ||||
-rw-r--r-- | gcc/cp/cvt.c | 17 | ||||
-rw-r--r-- | gcc/cp/parser.c | 19 | ||||
-rw-r--r-- | gcc/cp/pt.c | 18 | ||||
-rw-r--r-- | gcc/cp/search.c | 3 |
6 files changed, 49 insertions, 28 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8fcb181..6bd2eca 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,16 @@ +2010-02-10 Shujing Zhao <pearly.zhao@oracle.com> + + * Make-lang.in (cp/cvt.o, cp/parser.o, cp/search.o): Depend on intl.h. + * cvt.c (warn_ref_binding): Wrap the messages into G_() for easy + translation. + * parser.c (cp_parser_postfix_expression, cp_parser_new_type_id) + (cp_parser_cast_expression, cp_parser_condition, cp_parser_decltype) + (cp_parser_parameter_declaration) + (cp_parser_exception_specification_opt) + (cp_parser_exception_declaration): Likewise. + * pt.c (check_default_tmpl_args): Likewise. + * search.c (lookup_field_r): Likewise. + 2010-02-09 Jason Merrill <jason@redhat.com> PR c++/42399 diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in index 838585c..f6cb70f 100644 --- a/gcc/cp/Make-lang.in +++ b/gcc/cp/Make-lang.in @@ -279,8 +279,9 @@ cp/init.o: cp/init.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(RTL_H) $(EXPR_H) \ cp/method.o: cp/method.c $(CXX_TREE_H) $(TM_H) toplev.h $(RTL_H) $(EXPR_H) \ $(TM_P_H) $(TARGET_H) $(DIAGNOSTIC_H) gt-cp-method.h $(GIMPLE_H) cp/cvt.o: cp/cvt.c $(CXX_TREE_H) $(TM_H) cp/decl.h $(FLAGS_H) toplev.h \ - convert.h $(TARGET_H) -cp/search.o: cp/search.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H) + convert.h $(TARGET_H) intl.h +cp/search.o: cp/search.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H) \ + intl.h cp/tree.o: cp/tree.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h $(RTL_H) \ insn-config.h $(INTEGRATE_H) $(TREE_INLINE_H) $(REAL_H) gt-cp-tree.h \ $(TARGET_H) debug.h $(TREE_FLOW_H) $(CGRAPH_H) @@ -309,7 +310,7 @@ cp/optimize.o: cp/optimize.c $(CXX_TREE_H) $(TM_H) rtl.h $(INTEGRATE_H) \ cp/mangle.o: cp/mangle.c $(CXX_TREE_H) $(TM_H) toplev.h $(REAL_H) \ gt-cp-mangle.h $(TARGET_H) $(TM_P_H) cp/parser.o: cp/parser.c $(CXX_TREE_H) $(TM_H) $(DIAGNOSTIC_H) gt-cp-parser.h \ - output.h $(TARGET_H) $(PLUGIN_H) + output.h $(TARGET_H) $(PLUGIN_H) intl.h cp/cp-gimplify.o: cp/cp-gimplify.c $(CXX_TREE_H) toplev.h $(C_COMMON_H) \ $(TM_H) coretypes.h pointer-set.h tree-iterator.h diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index cbe8596..9dd0c59 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see #include "tree.h" #include "flags.h" #include "cp-tree.h" +#include "intl.h" #include "convert.h" #include "toplev.h" #include "decl.h" @@ -367,17 +368,17 @@ warn_ref_binding (tree reftype, tree intype, tree decl) const char *msg; if (CP_TYPE_VOLATILE_P (ttl) && decl) - msg = "initialization of volatile reference type %q#T from" - " rvalue of type %qT"; + msg = G_("initialization of volatile reference type %q#T from " + "rvalue of type %qT"); else if (CP_TYPE_VOLATILE_P (ttl)) - msg = "conversion to volatile reference type %q#T " - " from rvalue of type %qT"; + msg = G_("conversion to volatile reference type %q#T " + "from rvalue of type %qT"); else if (decl) - msg = "initialization of non-const reference type %q#T from" - " rvalue of type %qT"; + msg = G_("initialization of non-const reference type %q#T from " + "rvalue of type %qT"); else - msg = "conversion to non-const reference type %q#T from" - " rvalue of type %qT"; + msg = G_("conversion to non-const reference type %q#T from " + "rvalue of type %qT"); permerror (input_location, msg, reftype, intype); } diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index cff2c63..5256883 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see #include "cpplib.h" #include "tree.h" #include "cp-tree.h" +#include "intl.h" #include "c-pragma.h" #include "decl.h" #include "flags.h" @@ -4537,7 +4538,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p, /* New types cannot be defined in the cast. */ saved_message = parser->type_definition_forbidden_message; parser->type_definition_forbidden_message - = "types may not be defined in casts"; + = G_("types may not be defined in casts"); /* Look for the opening `<'. */ cp_parser_require (parser, CPP_LESS, "%<<%>"); @@ -4600,7 +4601,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p, /* Types cannot be defined in a `typeid' expression. */ saved_message = parser->type_definition_forbidden_message; parser->type_definition_forbidden_message - = "types may not be defined in a %<typeid%> expression"; + = G_("types may not be defined in a %<typeid%> expression"); /* We can't be sure yet whether we're looking at a type-id or an expression. */ cp_parser_parse_tentatively (parser); @@ -5837,7 +5838,7 @@ cp_parser_new_type_id (cp_parser* parser, tree *nelts) complete.) */ saved_message = parser->type_definition_forbidden_message; parser->type_definition_forbidden_message - = "types may not be defined in a new-type-id"; + = G_("types may not be defined in a new-type-id"); /* Parse the type-specifier-seq. */ cp_parser_type_specifier_seq (parser, /*is_declaration=*/false, /*is_trailing_return=*/false, @@ -6150,7 +6151,7 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p, bool cast_p, /* Types may not be defined in a cast. */ saved_message = parser->type_definition_forbidden_message; parser->type_definition_forbidden_message - = "types may not be defined in casts"; + = G_("types may not be defined in casts"); /* Consume the `('. */ cp_lexer_consume_token (parser->lexer); /* A very tricky bit is that `(struct S) { 3 }' is a @@ -8103,7 +8104,7 @@ cp_parser_condition (cp_parser* parser) condition. */ saved_message = parser->type_definition_forbidden_message; parser->type_definition_forbidden_message - = "types may not be defined in conditions"; + = G_("types may not be defined in conditions"); /* Parse the type-specifier-seq. */ cp_parser_type_specifier_seq (parser, /*is_declaration==*/true, /*is_trailing_return=*/false, @@ -9513,7 +9514,7 @@ cp_parser_decltype (cp_parser *parser) /* And create the new one. */ parser->type_definition_forbidden_message - = "types may not be defined in %<decltype%> expressions"; + = G_("types may not be defined in %<decltype%> expressions"); /* The restrictions on constant-expressions do not apply inside decltype expressions. */ @@ -15022,7 +15023,7 @@ cp_parser_parameter_declaration (cp_parser *parser, /* Type definitions may not appear in parameter types. */ saved_message = parser->type_definition_forbidden_message; parser->type_definition_forbidden_message - = "types may not be defined in parameter types"; + = G_("types may not be defined in parameter types"); /* Parse the declaration-specifiers. */ cp_parser_decl_specifier_seq (parser, @@ -17212,7 +17213,7 @@ cp_parser_exception_specification_opt (cp_parser* parser) /* Types may not be defined in an exception-specification. */ saved_message = parser->type_definition_forbidden_message; parser->type_definition_forbidden_message - = "types may not be defined in an exception-specification"; + = G_("types may not be defined in an exception-specification"); /* Parse the type-id-list. */ type_id_list = cp_parser_type_id_list (parser); /* Restore the saved message. */ @@ -17393,7 +17394,7 @@ cp_parser_exception_declaration (cp_parser* parser) /* Types may not be defined in exception-declarations. */ saved_message = parser->type_definition_forbidden_message; parser->type_definition_forbidden_message - = "types may not be defined in exception-declarations"; + = G_("types may not be defined in exception-declarations"); /* Parse the type-specifier-seq. */ cp_parser_type_specifier_seq (parser, /*is_declaration=*/true, diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 1327d54..43cd105 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -4112,16 +4112,19 @@ check_default_tmpl_args (tree decl, tree parms, int is_primary, /* Figure out what error message to issue. */ if (is_friend_decl == 2) - msg = "default template arguments may not be used in function template friend re-declaration"; + msg = G_("default template arguments may not be used in function template " + "friend re-declaration"); else if (is_friend_decl) - msg = "default template arguments may not be used in function template friend declarations"; + msg = G_("default template arguments may not be used in function template " + "friend declarations"); else if (TREE_CODE (decl) == FUNCTION_DECL && (cxx_dialect == cxx98)) - msg = ("default template arguments may not be used in function templates " - "without -std=c++0x or -std=gnu++0x"); + msg = G_("default template arguments may not be used in function templates " + "without -std=c++0x or -std=gnu++0x"); else if (is_partial) - msg = "default template arguments may not be used in partial specializations"; + msg = G_("default template arguments may not be used in " + "partial specializations"); else - msg = "default argument for template parameter for class enclosing %qD"; + msg = G_("default argument for template parameter for class enclosing %qD"); if (current_class_type && TYPE_BEING_DEFINED (current_class_type)) /* If we're inside a class definition, there's no need to @@ -4172,7 +4175,8 @@ check_default_tmpl_args (tree decl, tree parms, int is_primary, /* At this point, if we're still interested in issuing messages, they must apply to classes surrounding the object declared. */ if (msg) - msg = "default argument for template parameter for class enclosing %qD"; + msg = G_("default argument for template parameter for class " + "enclosing %qD"); } return no_errors; diff --git a/gcc/cp/search.c b/gcc/cp/search.c index c07a5e6..772ae3b 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see #include "tm.h" #include "tree.h" #include "cp-tree.h" +#include "intl.h" #include "obstack.h" #include "flags.h" #include "rtl.h" @@ -1101,7 +1102,7 @@ lookup_field_r (tree binfo, void *data) /* Add the new value. */ lfi->ambiguous = tree_cons (NULL_TREE, nval, lfi->ambiguous); TREE_TYPE (lfi->ambiguous) = error_mark_node; - lfi->errstr = "request for member %qD is ambiguous"; + lfi->errstr = G_("request for member %qD is ambiguous"); } } else |