re PR c++/38761 (%s substituted with regular word can't be properly translated)
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 19 Oct 2011 12:46:42 +0000 (12:46 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 19 Oct 2011 12:46:42 +0000 (12:46 +0000)
2011-10-19  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/38761
PR c++/40872
* decl.c (duplicate_decls, make_typename_type, grokdeclarator): Use
G_() in error message strings to facilitate translation.
* semantics.c (finish_id_expression): Likewise.
* parser.c (cp_parser_nested_name_specifier_opt,
cp_parser_parameter_declaration): Likewise.

From-SVN: r180185

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/parser.c
gcc/cp/semantics.c

index 402f5b56c34f197c1195b5165cd3b50553d2f5b8..375c808dc38c032a1829a6f55ed02568430d3662 100644 (file)
@@ -1,3 +1,13 @@
+2011-10-19  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/38761
+       PR c++/40872
+       * decl.c (duplicate_decls, make_typename_type, grokdeclarator): Use
+       G_() in error message strings to facilitate translation.
+       * semantics.c (finish_id_expression): Likewise.
+       * parser.c (cp_parser_nested_name_specifier_opt,
+       cp_parser_parameter_declaration): Likewise.
+
 2011-10-18  Jason Merrill  <jason@redhat.com>
 
        PR c++/50531
index 4b5b6c8122643252c8f7fc739a60171616e0abf1..a21cf461aabe9cc55ee60a84801ff7394d5d7418 100644 (file)
@@ -1542,8 +1542,8 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
          error_at (DECL_SOURCE_LOCATION (newdecl), errmsg, newdecl);
          if (DECL_NAME (olddecl) != NULL_TREE)
            error ((DECL_INITIAL (olddecl) && namespace_bindings_p ())
-                        ? "%q+#D previously defined here"
-                        : "%q+#D previously declared here", olddecl);
+                  ? G_("%q+#D previously defined here")
+                  : G_("%q+#D previously declared here"), olddecl);
          return error_mark_node;
        }
       else if (TREE_CODE (olddecl) == FUNCTION_DECL
@@ -3236,8 +3236,8 @@ make_typename_type (tree context, tree name, enum tag_types tag_type,
   if (!t)
     {
       if (complain & tf_error)
-       error (want_template ? "no class template named %q#T in %q#T"
-              : "no type named %q#T in %q#T", name, context);
+       error (want_template ? G_("no class template named %q#T in %q#T")
+              : G_("no type named %q#T in %q#T"), name, context);
       return error_mark_node;
     }
   
@@ -9143,13 +9143,13 @@ grokdeclarator (const cp_declarator *declarator,
                   virtual.  A constructor may not be static.  */
                if (staticp == 2)
                  error ((flags == DTOR_FLAG)
-                        ? "destructor cannot be static member function"
-                        : "constructor cannot be static member function");
+                        ? G_("destructor cannot be static member function")
+                        : G_("constructor cannot be static member function"));
                if (memfn_quals)
                  {
                    error ((flags == DTOR_FLAG)
-                          ? "destructors may not be cv-qualified"
-                          : "constructors may not be cv-qualified");
+                          ? G_("destructors may not be cv-qualified")
+                          : G_("constructors may not be cv-qualified"));
                    memfn_quals = TYPE_UNQUALIFIED;
                  }
 
@@ -9502,8 +9502,10 @@ grokdeclarator (const cp_declarator *declarator,
              && (!friendp || funcdef_flag))
            {
              error (funcdef_flag
-                    ? "cannot define member function %<%T::%s%> within %<%T%>"
-                    : "cannot declare member function %<%T::%s%> within %<%T%>",
+                    ? G_("cannot define member function %<%T::%s%> "
+                         "within %<%T%>")
+                    : G_("cannot declare member function %<%T::%s%> "
+                         "within %<%T%>"),
                     ctype, name, current_class_type);
              return error_mark_node;
            }
@@ -10223,8 +10225,8 @@ grokdeclarator (const cp_declarator *declarator,
                     || sfk == sfk_destructor)
              {
                error (funcdef_flag
-                      ? "%qs defined in a non-class scope"
-                      : "%qs declared in a non-class scope", name);
+                      ? G_("%qs defined in a non-class scope")
+                      : G_("%qs declared in a non-class scope"), name);
                sfk = sfk_none;
              }
          }
index a237b870edb2c2f4c15ad3d66d90bbff49860ed7..8d138fb7b5388e9f07d9ab2c0b8b92752fd683c4 100644 (file)
@@ -4752,8 +4752,8 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser,
               && (TREE_CODE (TYPENAME_TYPE_FULLNAME (new_scope))
                   == TEMPLATE_ID_EXPR)))
        permerror (input_location, TYPE_P (new_scope)
-                  ? "%qT is not a template"
-                  : "%qD is not a template",
+                  ? G_("%qT is not a template")
+                  : G_("%qD is not a template"),
                   new_scope);
       /* If it is a class scope, try to complete it; we are about to
         be looking up names inside the class.  */
@@ -16810,17 +16810,20 @@ cp_parser_parameter_declaration (cp_parser *parser,
          
          if (id_declarator && id_declarator->kind == cdk_id)
            error_at (declarator_token_start->location,
-                     template_parm_p 
-                     ? "template parameter pack %qD"
-                     " cannot have a default argument"
-                     : "parameter pack %qD cannot have a default argument",
+                     template_parm_p
+                     ? G_("template parameter pack %qD "
+                          "cannot have a default argument")
+                     : G_("parameter pack %qD cannot have "
+                          "a default argument"),
                      id_declarator->u.id.unqualified_name);
          else
            error_at (declarator_token_start->location,
-                     template_parm_p 
-                     ? "template parameter pack cannot have a default argument"
-                     : "parameter pack cannot have a default argument");
-         
+                     template_parm_p
+                     ? G_("template parameter pack cannot have "
+                          "a default argument")
+                     : G_("parameter pack cannot have a "
+                          "default argument"));
+
          default_argument = NULL_TREE;
        }
     }
index 3e847fa5ce589e3e98ef291f42b046d833645995..32024135a6dd47d2807230d5f99e3ea6b302aa59 100644 (file)
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "c-family/c-objc.h"
 #include "tree-inline.h"
 #include "tree-mudflap.h"
+#include "intl.h"
 #include "toplev.h"
 #include "flags.h"
 #include "output.h"
@@ -2985,8 +2986,8 @@ finish_id_expression (tree id_expression,
          else
            {
              error (TREE_CODE (decl) == VAR_DECL
-                    ? "use of %<auto%> variable from containing function"
-                    : "use of parameter from containing function");
+                    ? G_("use of %<auto%> variable from containing function")
+                    : G_("use of parameter from containing function"));
              error ("  %q+#D declared here", decl);
              return error_mark_node;
            }