+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
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)
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
#include "tree.h"
#include "flags.h"
#include "cp-tree.h"
+#include "intl.h"
#include "convert.h"
#include "toplev.h"
#include "decl.h"
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);
}
#include "cpplib.h"
#include "tree.h"
#include "cp-tree.h"
+#include "intl.h"
#include "c-pragma.h"
#include "decl.h"
#include "flags.h"
/* 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, "%<<%>");
/* 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);
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,
/* 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
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,
/* 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. */
/* 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,
/* 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. */
/* 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,
/* 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
/* 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;
#include "tm.h"
#include "tree.h"
#include "cp-tree.h"
+#include "intl.h"
#include "obstack.h"
#include "flags.h"
#include "rtl.h"
/* 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