diff options
author | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-20 13:35:00 +0000 |
---|---|---|
committer | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-20 13:35:00 +0000 |
commit | 5bcc316e1b642640cf09a651605077c8f44e2bc7 (patch) | |
tree | 7eba1faebbcca911b3f8e3ac46a9d340e8b72ad9 /gcc/cp | |
parent | e81bf082695d284a66540e02cbfdea3dddafe946 (diff) | |
download | gcc-5bcc316e1b642640cf09a651605077c8f44e2bc7.tar.gz |
2008-08-18 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* diagnostic.c (inform): Add an explicit location_t parameter.
* toplev.h (inform): Update declaration.
* builtins.c: Update all calls to inform.
* c-common.c: Likewise.
* c-decl.c: Likewise.
* c-opts.c: Likewise.
* c-pch.c: Likewise.
* c-pragma.c: Likewise.
* c-typeck.c: Likewise.
* coverage.c: Likewise.
* opts.c: Likewise.
* toplev.c: Likewise.
* tree-cfg.c: Likewise.
* tree-ssa.c: Likewise.
cp/
* parser.c: Update all calls to inform.
* typeck.c: Likewise.
* init.c: Likewise.
* class.c: Likewise.
* call.c: Likewise.
* method.c: Likewise.
* friend.c: Likewise.
* typeck2.c: Likewise.
* pt.c: Likewise.
* name-lookup.c: Likewise.
* lex.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139293 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/cp/call.c | 14 | ||||
-rw-r--r-- | gcc/cp/class.c | 2 | ||||
-rw-r--r-- | gcc/cp/friend.c | 2 | ||||
-rw-r--r-- | gcc/cp/init.c | 2 | ||||
-rw-r--r-- | gcc/cp/lex.c | 2 | ||||
-rw-r--r-- | gcc/cp/method.c | 4 | ||||
-rw-r--r-- | gcc/cp/name-lookup.c | 2 | ||||
-rw-r--r-- | gcc/cp/parser.c | 28 | ||||
-rw-r--r-- | gcc/cp/pt.c | 16 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 2 | ||||
-rw-r--r-- | gcc/cp/typeck2.c | 6 |
12 files changed, 55 insertions, 39 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 4ffb96e85de..3b6e97e62fa 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,17 @@ +2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + * parser.c: Update all calls to inform. + * typeck.c: Likewise. + * init.c: Likewise. + * class.c: Likewise. + * call.c: Likewise. + * method.c: Likewise. + * friend.c: Likewise. + * typeck2.c: Likewise. + * pt.c: Likewise. + * name-lookup.c: Likewise. + * lex.c: Likewise. + 2008-08-19 Jakub Jelinek <jakub@redhat.com> PR debug/37156 diff --git a/gcc/cp/call.c b/gcc/cp/call.c index ccfce6466b7..0348eb15c50 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -2545,24 +2545,24 @@ print_z_candidate (const char *msgstr, struct z_candidate *candidate) if (TREE_CODE (candidate->fn) == IDENTIFIER_NODE) { if (candidate->num_convs == 3) - inform ("%s %D(%T, %T, %T) <built-in>", msgstr, candidate->fn, + inform (input_location, "%s %D(%T, %T, %T) <built-in>", msgstr, candidate->fn, candidate->convs[0]->type, candidate->convs[1]->type, candidate->convs[2]->type); else if (candidate->num_convs == 2) - inform ("%s %D(%T, %T) <built-in>", msgstr, candidate->fn, + inform (input_location, "%s %D(%T, %T) <built-in>", msgstr, candidate->fn, candidate->convs[0]->type, candidate->convs[1]->type); else - inform ("%s %D(%T) <built-in>", msgstr, candidate->fn, + inform (input_location, "%s %D(%T) <built-in>", msgstr, candidate->fn, candidate->convs[0]->type); } else if (TYPE_P (candidate->fn)) - inform ("%s %T <conversion>", msgstr, candidate->fn); + inform (input_location, "%s %T <conversion>", msgstr, candidate->fn); else if (candidate->viable == -1) - inform ("%s %+#D <near match>", msgstr, candidate->fn); + inform (input_location, "%s %+#D <near match>", msgstr, candidate->fn); else - inform ("%s %+#D", msgstr, candidate->fn); + inform (input_location, "%s %+#D", msgstr, candidate->fn); } static void @@ -6651,7 +6651,7 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn) && warning (OPT_Wconversion, " for conversion from %qT to %qT", source, w->second_conv->type)) { - inform (" because conversion sequence for the argument is better"); + inform (input_location, " because conversion sequence for the argument is better"); } } else diff --git a/gcc/cp/class.c b/gcc/cp/class.c index d0033c7347b..9e98f1cc93b 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -6174,7 +6174,7 @@ resolve_address_of_overloaded_function (tree target_type, permerror (input_location, "assuming pointer to member %qD", fn); if (!explained) { - inform ("(a pointer to member can only be formed with %<&%E%>)", fn); + inform (input_location, "(a pointer to member can only be formed with %<&%E%>)", fn); explained = 1; } } diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c index 4d9a14ce88e..03748fe64d2 100644 --- a/gcc/cp/friend.c +++ b/gcc/cp/friend.c @@ -574,7 +574,7 @@ do_friend (tree ctype, tree declarator, tree decl, "%q#D declares a non-template function", decl); if (! explained && warned) { - inform ("(if this is not what you intended, make sure " + inform (input_location, "(if this is not what you intended, make sure " "the function template has already been declared " "and add <> after the function name here) "); explained = 1; diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 609747f6216..34c22fe039c 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -3039,7 +3039,7 @@ build_delete (tree type, tree addr, special_function_kind auto_delete, "delete operator:")) { cxx_incomplete_type_diagnostic (addr, type, DK_WARNING); - inform ("neither the destructor nor the class-specific " + inform (input_location, "neither the destructor nor the class-specific " "operator delete will be called, even if they are " "declared when the class is defined."); } diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 4b7f6148d1c..d5ddce88aef 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -490,7 +490,7 @@ unqualified_fn_lookup_error (tree name) static bool hint; if (!hint) { - inform ("(if you use %<-fpermissive%>, G++ will accept your " + inform (input_location, "(if you use %<-fpermissive%>, G++ will accept your " "code, but allowing the use of an undeclared name is " "deprecated)"); hint = true; diff --git a/gcc/cp/method.c b/gcc/cp/method.c index b215d2a3936..5b4c273dda9 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -813,8 +813,8 @@ synthesize_method (tree fndecl) pop_deferring_access_checks (); if (error_count != errorcount || warning_count != warningcount) - inform ("%Hsynthesized method %qD first required here ", - &input_location, fndecl); + inform (input_location, "synthesized method %qD first required here ", + fndecl); } /* Use EXTRACTOR to locate the relevant function called for each base & diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 180860e7335..e1c57b4a347 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -1226,7 +1226,7 @@ check_for_out_of_scope_variable (tree decl) static bool hint; if (!hint) { - inform ("(if you use %<-fpermissive%> G++ will accept your code)"); + inform (input_location, "(if you use %<-fpermissive%> G++ will accept your code)"); hint = true; } } diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 21904cac2df..9f992b9a480 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -2229,8 +2229,9 @@ cp_parser_check_for_definition_in_return_type (cp_declarator *declarator, && declarator->kind == cdk_function) { error ("%Hnew types may not be defined in a return type", &type_location); - inform ("%H(perhaps a semicolon is missing after the definition of %qT)", - &type_location, type); + inform (type_location, + "(perhaps a semicolon is missing after the definition of %qT)", + type); } } @@ -2358,8 +2359,9 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser, if (TREE_CODE (field) == TYPE_DECL && DECL_NAME (field) == id) { - inform ("%H(perhaps %<typename %T::%E%> was intended)", - &location, BINFO_TYPE (b), id); + inform (location, + "(perhaps %<typename %T::%E%> was intended)", + BINFO_TYPE (b), id); break; } if (field) @@ -5576,8 +5578,8 @@ cp_parser_new_expression (cp_parser* parser) { error ("%Harray bound forbidden after parenthesized type-id", &token->location); - inform ("%Htry removing the parentheses around the type-id", - &token->location); + inform (token->location, + "try removing the parentheses around the type-id"); cp_parser_direct_new_declarator (parser); } nelts = NULL_TREE; @@ -9984,13 +9986,13 @@ cp_parser_template_id (cp_parser *parser, "%<<::%> cannot begin a template-argument list")) { static bool hint = false; - inform ("%H%<<:%> is an alternate spelling for %<[%>. Insert whitespace " - "between %<<%> and %<::%>", - &next_token->location); + inform (next_token->location, + "%<<:%> is an alternate spelling for %<[%>." + " Insert whitespace between %<<%> and %<::%>"); if (!hint && !flag_permissive) { - inform ("%H(if you use %<-fpermissive%> G++ will accept your code)", - &next_token->location); + inform (next_token->location, "(if you use %<-fpermissive%>" + " G++ will accept your code)"); hint = true; } } @@ -10180,7 +10182,7 @@ cp_parser_template_name (cp_parser* parser, /* Explain what went wrong. */ error ("%Hnon-template %qD used as template", &token->location, identifier); - inform ("use %<%T::template %D%> to indicate that it is a template", + inform (input_location, "use %<%T::template %D%> to indicate that it is a template", parser->scope, identifier); /* If parsing tentatively, find the location of the "<" token. */ if (cp_parser_simulate_error (parser)) @@ -13168,7 +13170,7 @@ cp_parser_direct_declarator (cp_parser* parser, { error ("%Hinvalid use of constructor as a template", &declarator_id_start_token->location); - inform ("use %<%T::%D%> instead of %<%T::%D%> to " + inform (input_location, "use %<%T::%D%> instead of %<%T::%D%> to " "name the constructor in a qualified name", class_type, DECL_NAME (TYPE_TI_TEMPLATE (class_type)), diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 51a8abf4a8b..4df53e83767 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -2741,9 +2741,9 @@ check_for_bare_parameter_packs (tree t) name = DECL_NAME (pack); if (name) - inform (" %qD", name); + inform (input_location, " %qD", name); else - inform (" <anonymous>"); + inform (input_location, " <anonymous>"); parameter_packs = TREE_CHAIN (parameter_packs); } @@ -4020,7 +4020,7 @@ push_template_decl_real (tree decl, bool is_friend) template arguments to %qD do not match original template %qD", decl, DECL_TEMPLATE_RESULT (tmpl)); if (!uses_template_parms (TI_ARGS (tinfo))) - inform ("use template<> for an explicit specialization"); + inform (input_location, "use template<> for an explicit specialization"); /* Avoid crash in import_export_decl. */ DECL_INTERFACE_KNOWN (decl) = 1; return error_mark_node; @@ -4141,7 +4141,7 @@ redeclare_class_template (tree type, tree parms) { error ("redeclared with %d template parameter(s)", TREE_VEC_LENGTH (parms)); - inform ("previous declaration %q+D used %d template parameter(s)", + inform (input_location, "previous declaration %q+D used %d template parameter(s)", tmpl, TREE_VEC_LENGTH (tmpl_parms)); return false; } @@ -4187,7 +4187,7 @@ redeclare_class_template (tree type, tree parms) A template-parameter may not be given default arguments by two different declarations in the same scope. */ error ("redefinition of default argument for %q#D", parm); - inform ("%Joriginal definition appeared here", tmpl_parm); + inform (input_location, "%Joriginal definition appeared here", tmpl_parm); return false; } @@ -4570,7 +4570,7 @@ convert_nontype_argument (tree type, tree expr) { error ("%qE is not a valid template argument for type %qT " "because it is a pointer", expr, type); - inform ("try using %qE instead", TREE_OPERAND (expr, 0)); + inform (input_location, "try using %qE instead", TREE_OPERAND (expr, 0)); return NULL_TREE; } @@ -4608,7 +4608,7 @@ convert_nontype_argument (tree type, tree expr) error ("%qE is not a valid template argument for type %qT " "because it is of type %qT", expr, type, TREE_TYPE (expr)); - inform ("standard conversions are not allowed in this context"); + inform (input_location, "standard conversions are not allowed in this context"); return NULL_TREE; } } @@ -9722,7 +9722,7 @@ tsubst_qualified_id (tree qualified_id, tree args, { error ("dependent-name %qE is parsed as a non-type, but " "instantiation yields a type", qualified_id); - inform ("say %<typename %E%> if a type is meant", qualified_id); + inform (input_location, "say %<typename %E%> if a type is meant", qualified_id); } return error_mark_node; } diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index fbf9884c0bb..f955efe2948 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -4009,7 +4009,7 @@ build_x_unary_op (enum tree_code code, tree xarg, tsubst_flags_t complain) error ("invalid use of %qE to form a pointer-to-member-function", xarg); if (TREE_CODE (xarg) != OFFSET_REF) - inform (" a qualified-id is required"); + inform (input_location, " a qualified-id is required"); return error_mark_node; } else diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index c9053862a68..9a39076a0e2 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -313,18 +313,18 @@ abstract_virtuals_error (tree decl, tree type) unsigned ix; tree fn; - inform ("%J because the following virtual functions are pure " + inform (input_location, "%J because the following virtual functions are pure " "within %qT:", TYPE_MAIN_DECL (type), type); for (ix = 0; VEC_iterate (tree, pure, ix, fn); ix++) - inform ("\t%+#D", fn); + inform (input_location, "\t%+#D", fn); /* Now truncate the vector. This leaves it non-null, so we know there are pure virtuals, but empty so we don't list them out again. */ VEC_truncate (tree, pure, 0); } else - inform ("%J since type %qT has pure virtual functions", + inform (input_location, "%J since type %qT has pure virtual functions", TYPE_MAIN_DECL (type), type); return 1; |