Make-lang.in (cp/cvt.o, [...]): Depend on intl.h.
authorShujing Zhao <pearly.zhao@oracle.com>
Wed, 10 Feb 2010 07:37:37 +0000 (07:37 +0000)
committerShujing Zhao <pzhao@gcc.gnu.org>
Wed, 10 Feb 2010 07:37:37 +0000 (07:37 +0000)
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

gcc/cp/ChangeLog
gcc/cp/Make-lang.in
gcc/cp/cvt.c
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/search.c

index 8fcb181ac37fa2e9205697bb91a76f3418790018..6bd2eca6d5682f697d16dc79ad52a2b92f9e9858 100644 (file)
@@ -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
index 838585c27fc928e0922281a601f100bf322b9369..f6cb70fbeec4c9caf44872ef52c043a0f12313b9 100644 (file)
@@ -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
 
index cbe85965a59df1cf096f02a430d61608cf233dac..9dd0c596ac77eedb47fe31ea946c8a8929f57d09 100644 (file)
@@ -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);
     }
index cff2c632ad1619775eee0bca25e033b67e19a395..5256883565f34cb74d68e32edd043cf64ae935dc 100644 (file)
@@ -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,
index 1327d549f432364c316a3028734b5ac406894cb0..43cd105474ee98ad5509f01998ae462069a2f476 100644 (file)
@@ -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;
index c07a5e66d8ebdeb2092483a941d90a38886f1ec4..772ae3b1fbe8074ce2cdea083aee301d46fe7241 100644 (file)
@@ -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