+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
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
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;
}
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;
}
&& (!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;
}
|| 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;
}
}
&& (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. */
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;
}
}
#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"
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;
}