From: Paolo Carlini Date: Mon, 30 May 2016 19:18:13 +0000 (+0000) Subject: re PR c++/71238 (Undeclared function message imprecisely points to error column) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b2f6675b74a6d16ab44202ac0e49587da8f7d4cf;p=gcc.git re PR c++/71238 (Undeclared function message imprecisely points to error column) /cp 2016-05-30 Paolo Carlini PR c++/71238 * lex.c (unqualified_name_lookup_error): Take a location too. (unqualified_fn_lookup_error): Take a cp_expr. * cp-tree.h (unqualified_name_lookup_error, unqualified_fn_lookup_error): Adjust declarations. * semantics.c (perform_koenig_lookup): Adjust unqualified_fn_lookup_error call, pass the location of the identifier too as part of a cp_expr. /testsuite 2016-05-30 Paolo Carlini PR c++/71238 * g++.dg/parse/pr71238.C: New. * g++.dg/concepts/friend1.C: Test column numbers too. * g++.dg/cpp0x/initlist31.C: Likewise. * g++.dg/cpp0x/pr51420.C: Likewise. * g++.dg/cpp0x/udlit-declare-neg.C: Likewise. * g++.dg/cpp0x/udlit-member-neg.C: Likewise. * g++.dg/ext/builtin3.C: Likewise. * g++.dg/lookup/friend12.C: Likewise. * g++.dg/lookup/friend7.C: Likewise. * g++.dg/lookup/koenig1.C: Likewise. * g++.dg/lookup/koenig5.C: Likewise. * g++.dg/lookup/used-before-declaration.C: Likewise. * g++.dg/overload/koenig1.C: Likewise. * g++.dg/template/crash65.C: Likewise. * g++.dg/template/friend57.C: Likewise. * g++.dg/warn/Wshadow-5.C: Likewise. * g++.dg/warn/Wunused-8.C: Likewise. * g++.old-deja/g++.bugs/900211_01.C: Likewise. * g++.old-deja/g++.jason/lineno5.C: Likewise. * g++.old-deja/g++.jason/member.C: Likewise. * g++.old-deja/g++.jason/report.C: Likewise. * g++.old-deja/g++.jason/scoping12.C: Likewise. * g++.old-deja/g++.law/visibility20.C: Likewise. * g++.old-deja/g++.ns/koenig5.C: Likewise. * g++.old-deja/g++.other/static5.C: Likewise. * g++.old-deja/g++.pt/overload2.C: Likewise. From-SVN: r236896 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9b35abc66bc..84d7e0ac7ff 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,14 @@ +2016-05-30 Paolo Carlini + + PR c++/71238 + * lex.c (unqualified_name_lookup_error): Take a location too. + (unqualified_fn_lookup_error): Take a cp_expr. + * cp-tree.h (unqualified_name_lookup_error, + unqualified_fn_lookup_error): Adjust declarations. + * semantics.c (perform_koenig_lookup): Adjust + unqualified_fn_lookup_error call, pass the location of + the identifier too as part of a cp_expr. + 2016-05-30 Paolo Carlini PR c++/71099 diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index f562a5255b1..14ba12073ee 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -5974,8 +5974,9 @@ extern tree build_vtbl_address (tree); extern void cxx_dup_lang_specific_decl (tree); extern void yyungetc (int, int); -extern tree unqualified_name_lookup_error (tree); -extern tree unqualified_fn_lookup_error (tree); +extern tree unqualified_name_lookup_error (tree, + location_t = UNKNOWN_LOCATION); +extern tree unqualified_fn_lookup_error (cp_expr); extern tree build_lang_decl (enum tree_code, tree, tree); extern tree build_lang_decl_loc (location_t, enum tree_code, tree, tree); extern void retrofit_lang_decl (tree); diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index e69793e7f35..43827e57179 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -443,27 +443,29 @@ handle_pragma_java_exceptions (cpp_reader* /*dfile*/) IDENTIFIER_NODE) failed. Returns the ERROR_MARK_NODE. */ tree -unqualified_name_lookup_error (tree name) +unqualified_name_lookup_error (tree name, location_t loc) { + if (loc == UNKNOWN_LOCATION) + loc = EXPR_LOC_OR_LOC (name, input_location); + if (IDENTIFIER_OPNAME_P (name)) { if (name != ansi_opname (ERROR_MARK)) - error ("%qD not defined", name); + error_at (loc, "%qD not defined", name); } else { if (!objc_diagnose_private_ivar (name)) { - error ("%qD was not declared in this scope", name); - suggest_alternatives_for (location_of (name), name); + error_at (loc, "%qD was not declared in this scope", name); + suggest_alternatives_for (loc, name); } /* Prevent repeated error messages by creating a VAR_DECL with this NAME in the innermost block scope. */ if (local_bindings_p ()) { tree decl; - decl = build_decl (input_location, - VAR_DECL, name, error_mark_node); + decl = build_decl (loc, VAR_DECL, name, error_mark_node); DECL_CONTEXT (decl) = current_function_decl; push_local_binding (name, decl, 0); /* Mark the variable as used so that we do not get warnings @@ -475,13 +477,18 @@ unqualified_name_lookup_error (tree name) return error_mark_node; } -/* Like unqualified_name_lookup_error, but NAME is an unqualified-id - used as a function. Returns an appropriate expression for - NAME. */ +/* Like unqualified_name_lookup_error, but NAME_EXPR is an unqualified-id + NAME, encapsulated with its location in a CP_EXPR, used as a function. + Returns an appropriate expression for NAME. */ tree -unqualified_fn_lookup_error (tree name) +unqualified_fn_lookup_error (cp_expr name_expr) { + tree name = name_expr.get_value (); + location_t loc = name_expr.get_location (); + if (loc == UNKNOWN_LOCATION) + loc = input_location; + if (processing_template_decl) { /* In a template, it is invalid to write "f()" or "f(3)" if no @@ -494,7 +501,7 @@ unqualified_fn_lookup_error (tree name) Note that we have the exact wording of the following message in the manual (trouble.texi, node "Name lookup"), so they need to be kept in synch. */ - permerror (input_location, "there are no arguments to %qD that depend on a template " + permerror (loc, "there are no arguments to %qD that depend on a template " "parameter, so a declaration of %qD must be available", name, name); @@ -503,7 +510,7 @@ unqualified_fn_lookup_error (tree name) static bool hint; if (!hint) { - inform (input_location, "(if you use %<-fpermissive%>, G++ will accept your " + inform (loc, "(if you use %<-fpermissive%>, G++ will accept your " "code, but allowing the use of an undeclared name is " "deprecated)"); hint = true; @@ -512,7 +519,7 @@ unqualified_fn_lookup_error (tree name) return name; } - return unqualified_name_lookup_error (name); + return unqualified_name_lookup_error (name, loc); } /* Wrapper around build_lang_decl_loc(). Should gradually move to diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 253d31a4f4a..8e682c53795 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2210,6 +2210,7 @@ perform_koenig_lookup (cp_expr fn, vec *args, tree functions = NULL_TREE; tree tmpl_args = NULL_TREE; bool template_id = false; + location_t loc = fn.get_location (); if (TREE_CODE (fn) == TEMPLATE_ID_EXPR) { @@ -2245,7 +2246,7 @@ perform_koenig_lookup (cp_expr fn, vec *args, { /* The unqualified name could not be resolved. */ if (complain) - fn = unqualified_fn_lookup_error (identifier); + fn = unqualified_fn_lookup_error (cp_expr (identifier, loc)); else fn = identifier; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 67cab5797a5..4859224ed56 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,33 @@ +2016-05-30 Paolo Carlini + + PR c++/71238 + * g++.dg/parse/pr71238.C: New. + * g++.dg/concepts/friend1.C: Test column numbers too. + * g++.dg/cpp0x/initlist31.C: Likewise. + * g++.dg/cpp0x/pr51420.C: Likewise. + * g++.dg/cpp0x/udlit-declare-neg.C: Likewise. + * g++.dg/cpp0x/udlit-member-neg.C: Likewise. + * g++.dg/ext/builtin3.C: Likewise. + * g++.dg/lookup/friend12.C: Likewise. + * g++.dg/lookup/friend7.C: Likewise. + * g++.dg/lookup/koenig1.C: Likewise. + * g++.dg/lookup/koenig5.C: Likewise. + * g++.dg/lookup/used-before-declaration.C: Likewise. + * g++.dg/overload/koenig1.C: Likewise. + * g++.dg/template/crash65.C: Likewise. + * g++.dg/template/friend57.C: Likewise. + * g++.dg/warn/Wshadow-5.C: Likewise. + * g++.dg/warn/Wunused-8.C: Likewise. + * g++.old-deja/g++.bugs/900211_01.C: Likewise. + * g++.old-deja/g++.jason/lineno5.C: Likewise. + * g++.old-deja/g++.jason/member.C: Likewise. + * g++.old-deja/g++.jason/report.C: Likewise. + * g++.old-deja/g++.jason/scoping12.C: Likewise. + * g++.old-deja/g++.law/visibility20.C: Likewise. + * g++.old-deja/g++.ns/koenig5.C: Likewise. + * g++.old-deja/g++.other/static5.C: Likewise. + * g++.old-deja/g++.pt/overload2.C: Likewise. + 2016-05-30 Jan Hubicka * gcc.dg/tree-ssa/peel1.c: New testcase. diff --git a/gcc/testsuite/g++.dg/concepts/friend1.C b/gcc/testsuite/g++.dg/concepts/friend1.C index 5c418cbf76c..c78940ce813 100644 --- a/gcc/testsuite/g++.dg/concepts/friend1.C +++ b/gcc/testsuite/g++.dg/concepts/friend1.C @@ -24,7 +24,7 @@ struct X { } x; int main() { // f(0); // OK f(nt); // { dg-error "cannot call" } - f(x); // { dg-error "not declared" } + f(x); // { dg-error "3:'f' was not declared" } S si; si == si; // OK diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist31.C b/gcc/testsuite/g++.dg/cpp0x/initlist31.C index f34a0ca18ab..a8a29f9c853 100644 --- a/gcc/testsuite/g++.dg/cpp0x/initlist31.C +++ b/gcc/testsuite/g++.dg/cpp0x/initlist31.C @@ -8,6 +8,6 @@ struct string { string(std::initializer_list) { } }; void f() { auto y = { - string(Equation()) // { dg-error "not declared" } + string(Equation()) // { dg-error "12:'Equation' was not declared" } }; // { dg-error "unable to deduce" } } diff --git a/gcc/testsuite/g++.dg/cpp0x/pr51420.C b/gcc/testsuite/g++.dg/cpp0x/pr51420.C index 7aa80e53637..fc70d46cc90 100644 --- a/gcc/testsuite/g++.dg/cpp0x/pr51420.C +++ b/gcc/testsuite/g++.dg/cpp0x/pr51420.C @@ -3,6 +3,6 @@ void foo() { - float x = operator"" _F(); // { dg-error "was not declared in this scope" } + float x = operator"" _F(); // { dg-error "13:'operator\"\"_F' was not declared in this scope" } float y = 0_F; // { dg-error "unable to find numeric literal operator" } } diff --git a/gcc/testsuite/g++.dg/cpp0x/udlit-declare-neg.C b/gcc/testsuite/g++.dg/cpp0x/udlit-declare-neg.C index a68e2e020b9..721f87d4e66 100644 --- a/gcc/testsuite/g++.dg/cpp0x/udlit-declare-neg.C +++ b/gcc/testsuite/g++.dg/cpp0x/udlit-declare-neg.C @@ -2,14 +2,14 @@ // Check that undeclared literal operator calls and literals give appropriate errors. -int i = operator"" _Bar('x'); // { dg-error "was not declared in this scope" } +int i = operator"" _Bar('x'); // { dg-error "9:'operator\"\"_Bar' was not declared in this scope" } int j = 'x'_Bar; // { dg-error "unable to find character literal operator|with|argument" } -int ii = operator"" _BarCharStr("Howdy, Pardner!"); // { dg-error "was not declared in this scope" } +int ii = operator"" _BarCharStr("Howdy, Pardner!"); // { dg-error "10:'operator\"\"_BarCharStr' was not declared in this scope" } int jj = "Howdy, Pardner!"_BarCharStr; // { dg-error "unable to find string literal operator|Possible missing length argument" } -unsigned long long iULL = operator"" _BarULL(666ULL); // { dg-error "was not declared in this scope" } +unsigned long long iULL = operator"" _BarULL(666ULL); // { dg-error "27:'operator\"\"_BarULL' was not declared in this scope" } unsigned long long jULL = 666_BarULL; // { dg-error "unable to find numeric literal operator" } -long double iLD = operator"" _BarLD(666.0L); // { dg-error "was not declared in this scope" } +long double iLD = operator"" _BarLD(666.0L); // { dg-error "19:'operator\"\"_BarLD' was not declared in this scope" } long double jLD = 666.0_BarLD; // { dg-error "unable to find numeric literal operator" } diff --git a/gcc/testsuite/g++.dg/cpp0x/udlit-member-neg.C b/gcc/testsuite/g++.dg/cpp0x/udlit-member-neg.C index 2a314525457..b6820661e22 100644 --- a/gcc/testsuite/g++.dg/cpp0x/udlit-member-neg.C +++ b/gcc/testsuite/g++.dg/cpp0x/udlit-member-neg.C @@ -7,7 +7,7 @@ public: int operator"" _Bar(char32_t); // { dg-error "must be a non-member function" } }; -int i = operator"" _Bar(U'x'); // { dg-error "was not declared in this scope" } +int i = operator"" _Bar(U'x'); // { dg-error "9:'operator\"\"_Bar' was not declared in this scope" } int j = U'x'_Bar; // { dg-error "unable to find character literal operator" } int diff --git a/gcc/testsuite/g++.dg/ext/builtin3.C b/gcc/testsuite/g++.dg/ext/builtin3.C index 001d5f784d2..f168db62488 100644 --- a/gcc/testsuite/g++.dg/ext/builtin3.C +++ b/gcc/testsuite/g++.dg/ext/builtin3.C @@ -9,6 +9,6 @@ extern "C" int printf(char*, ...); // { dg-message "std::printf" } } void foo() { - printf("abc"); // { dg-error "not declared" } + printf("abc"); // { dg-error "3:'printf' was not declared" } // { dg-message "suggested alternative" "suggested alternative" { target *-*-* } 12 } } diff --git a/gcc/testsuite/g++.dg/lookup/friend12.C b/gcc/testsuite/g++.dg/lookup/friend12.C index 95cfd5fb4d3..98f508bbe86 100644 --- a/gcc/testsuite/g++.dg/lookup/friend12.C +++ b/gcc/testsuite/g++.dg/lookup/friend12.C @@ -6,5 +6,5 @@ void foo() { friend void bar(); // { dg-error "without prior declaration" } }; - bar(); // { dg-error "not declared" } + bar(); // { dg-error "3:'bar' was not declared" } } diff --git a/gcc/testsuite/g++.dg/lookup/friend7.C b/gcc/testsuite/g++.dg/lookup/friend7.C index ce9b79f8fe4..a1e1f3ee9a8 100644 --- a/gcc/testsuite/g++.dg/lookup/friend7.C +++ b/gcc/testsuite/g++.dg/lookup/friend7.C @@ -11,7 +11,7 @@ int main() struct S { friend void g(); friend void h(S); }; struct T { friend void g(); friend void h(T); }; void i() { - g(); // { dg-error "not declared" } + g(); // { dg-error "3:'g' was not declared" } S s; h(s); T t; diff --git a/gcc/testsuite/g++.dg/lookup/koenig1.C b/gcc/testsuite/g++.dg/lookup/koenig1.C index 7273727194c..081211bab1a 100644 --- a/gcc/testsuite/g++.dg/lookup/koenig1.C +++ b/gcc/testsuite/g++.dg/lookup/koenig1.C @@ -9,5 +9,5 @@ class X; void foo() { X x(1); // { dg-error "incomplete type" "" } - bar(x); // { dg-error "not declared" "" } + bar(x); // { dg-error "3:'bar' was not declared" "" } } diff --git a/gcc/testsuite/g++.dg/lookup/koenig5.C b/gcc/testsuite/g++.dg/lookup/koenig5.C index 15fb6cc90a9..ac35165e618 100644 --- a/gcc/testsuite/g++.dg/lookup/koenig5.C +++ b/gcc/testsuite/g++.dg/lookup/koenig5.C @@ -31,12 +31,12 @@ void g (N::A *a, M::B *b, O::C *c) { One (a); // ok One (a, b); // ok - One (b); // { dg-error "not declared" } + One (b); // { dg-error "3:'One' was not declared" } // { dg-message "suggested alternatives" "suggested alternative for One" { target *-*-* } 34 } Two (c); // ok Two (a, c); // ok - Two (a); // { dg-error "not declared" } + Two (a); // { dg-error "3:'Two' was not declared" } // { dg-message "suggested alternatives" "suggested alternative for Two" { target *-*-* } 39 } Two (a, a); // error masked by earlier error Two (b); // error masked by earlier error @@ -44,6 +44,6 @@ void g (N::A *a, M::B *b, O::C *c) Three (b); // ok Three (a, b); // ok - Three (a); // { dg-error "not declared" } + Three (a); // { dg-error "3:'Three' was not declared" } // { dg-message "suggested alternatives" "suggested alternative for Three" { target *-*-* } 47 } } diff --git a/gcc/testsuite/g++.dg/lookup/used-before-declaration.C b/gcc/testsuite/g++.dg/lookup/used-before-declaration.C index b51d270c74a..f5dd6efe6ff 100644 --- a/gcc/testsuite/g++.dg/lookup/used-before-declaration.C +++ b/gcc/testsuite/g++.dg/lookup/used-before-declaration.C @@ -1,5 +1,5 @@ // Copyroght (C) 2003 Free Software Foundation // Origin: PR/12832, Jonathan Wakely -void f() { g(); } // { dg-error "not declared" "" } +void f() { g(); } // { dg-error "12:'g' was not declared" "" } void g() { } diff --git a/gcc/testsuite/g++.dg/overload/koenig1.C b/gcc/testsuite/g++.dg/overload/koenig1.C index a4612591967..cd82bf25af3 100644 --- a/gcc/testsuite/g++.dg/overload/koenig1.C +++ b/gcc/testsuite/g++.dg/overload/koenig1.C @@ -13,7 +13,7 @@ void g () { B *bp; N::A *ap; - f (bp); // { dg-error "not declared" } + f (bp); // { dg-error "3:'f' was not declared" } // { dg-message "suggested alternative" "suggested alternative" { target *-*-* } 16 } f (ap); } diff --git a/gcc/testsuite/g++.dg/parse/pr71238.C b/gcc/testsuite/g++.dg/parse/pr71238.C new file mode 100644 index 00000000000..894e8284eb1 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/pr71238.C @@ -0,0 +1,6 @@ +// PR c++/71238 + +int main() +{ + int x=myFunc(3234); // { dg-error "11:'myFunc' was not declared" } +} diff --git a/gcc/testsuite/g++.dg/template/crash65.C b/gcc/testsuite/g++.dg/template/crash65.C index 4d49ecf3145..68878c525ac 100644 --- a/gcc/testsuite/g++.dg/template/crash65.C +++ b/gcc/testsuite/g++.dg/template/crash65.C @@ -3,5 +3,5 @@ struct A { template template friend void foo(T) {} // { dg-error "parameter" } - void bar() { foo(0); } // { dg-error "foo" } + void bar() { foo(0); } // { dg-error "16:'foo' was not declared" } }; diff --git a/gcc/testsuite/g++.dg/template/friend57.C b/gcc/testsuite/g++.dg/template/friend57.C index 7077d5e53cb..92c786718af 100644 --- a/gcc/testsuite/g++.dg/template/friend57.C +++ b/gcc/testsuite/g++.dg/template/friend57.C @@ -15,7 +15,7 @@ int main () { f(1); - g(1); // { dg-error "'g' was not declared in this scope" } + g(1); // { dg-error "3:'g' was not declared in this scope" } g(S()); h(1); } diff --git a/gcc/testsuite/g++.dg/warn/Wshadow-5.C b/gcc/testsuite/g++.dg/warn/Wshadow-5.C index 66232913f0e..7a90ec9c997 100644 --- a/gcc/testsuite/g++.dg/warn/Wshadow-5.C +++ b/gcc/testsuite/g++.dg/warn/Wshadow-5.C @@ -7,7 +7,7 @@ int f (int n) { int bar (int n) { return n++; } // { dg-error "a function-definition is not allowed here" } - return bar (n); // { dg-error "was not declared in this scope" } + return bar (n); // { dg-error "12:'bar' was not declared in this scope" } } int g (int i) diff --git a/gcc/testsuite/g++.dg/warn/Wunused-8.C b/gcc/testsuite/g++.dg/warn/Wunused-8.C index a1c8a1fb426..db9583bab3d 100644 --- a/gcc/testsuite/g++.dg/warn/Wunused-8.C +++ b/gcc/testsuite/g++.dg/warn/Wunused-8.C @@ -5,5 +5,5 @@ int main () { // We should not see an "unused" warning about "whatever" on the // next line. - return whatever (); // { dg-error "declared" } + return whatever (); // { dg-error "10:'whatever' was not declared" } } diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900211_01.C b/gcc/testsuite/g++.old-deja/g++.bugs/900211_01.C index 3312d3fcab8..08a5c0ed1bf 100644 --- a/gcc/testsuite/g++.old-deja/g++.bugs/900211_01.C +++ b/gcc/testsuite/g++.old-deja/g++.bugs/900211_01.C @@ -10,7 +10,7 @@ void global_function_0 () { - global_function_1 (); /* { dg-error "" } */ + global_function_1 (); /* { dg-error "3:'global_function_1' was not declared" } */ } int main () { return 0; } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/lineno5.C b/gcc/testsuite/g++.old-deja/g++.jason/lineno5.C index f723a222b8c..aa278070146 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/lineno5.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/lineno5.C @@ -6,5 +6,5 @@ template class A; int main() { A *p; - undef1();// { dg-error "" } + undef1();// { dg-error "3:'undef1' was not declared" } } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/member.C b/gcc/testsuite/g++.old-deja/g++.jason/member.C index 1abbdec1fe3..af800b1f2a6 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/member.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/member.C @@ -5,31 +5,31 @@ struct Y struct X { int A; - int Y::X::* foo () { undef1(1); return &Y::X::A; }// { dg-error "" } foo().* + int Y::X::* foo () { undef1(1); return &Y::X::A; }// { dg-error "28:'undef1' was not declared" } foo().* int bar () { return A; } }; }; int Y::X::* foo () { - undef2(1);// { dg-error "" } foo().* + undef2(1);// { dg-error "3:'undef2' was not declared" } foo().* return &Y::X::A; } int Y::X::* (* foo2 ())() { - undef3(1);// { dg-error "" } foo().* + undef3(1);// { dg-error "3:'undef3' was not declared" } foo().* return foo; } int (Y::X::* bar2 ()) () { - undef4(1);// { dg-error "" } foo\(\).* + undef4(1);// { dg-error "3:'undef4' was not declared" } foo\(\).* return Y::X::bar;// { dg-error "" } foo\(\).* } int Y::X::* (Y::X::* foo3 ())() { - undef5(1);// { dg-error "" } foo().* + undef5(1);// { dg-error "3:'undef5' was not declared" } foo().* return Y::X::foo;// { dg-error "" } foo().* } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/report.C b/gcc/testsuite/g++.old-deja/g++.jason/report.C index d78dcc133f9..7faf30bcb99 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/report.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/report.C @@ -37,7 +37,7 @@ int foo (int a = (**bar) (s)) int foo2 (int (*a)(int) = &foo) { - undef4 (1); // { dg-error "" } implicit declaration + undef4 (1); // { dg-error "4:'undef4' was not declared" } implicit declaration return 1; } @@ -55,7 +55,7 @@ bar2 baz (X::Y y) // { dg-error "" } in this context X::Y f; // { dg-error "" } in this context bar2 wa [5]; wa[0] = baz(f); - undef2 (1); // { dg-error "" } implicit declaration + undef2 (1); // { dg-error "3:'undef2' was not declared" } implicit declaration } // { dg-warning "no return statement" } int ninny () @@ -70,5 +70,5 @@ int ninny () int darg (char X::*p) { - undef3 (1); // { dg-error "" } implicit declaration + undef3 (1); // { dg-error "4:'undef3' was not declared" } implicit declaration } // { dg-warning "no return statement" } diff --git a/gcc/testsuite/g++.old-deja/g++.jason/scoping12.C b/gcc/testsuite/g++.old-deja/g++.jason/scoping12.C index a7834163bcf..35731e78f67 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/scoping12.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/scoping12.C @@ -6,5 +6,5 @@ void f () }; } void h () { - g (); // { dg-error "" } no g in scope + g (); // { dg-error "3:'g' was not declared" } no g in scope } diff --git a/gcc/testsuite/g++.old-deja/g++.law/visibility20.C b/gcc/testsuite/g++.old-deja/g++.law/visibility20.C index 802274d80ae..9edb03c947a 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/visibility20.C +++ b/gcc/testsuite/g++.old-deja/g++.law/visibility20.C @@ -31,6 +31,6 @@ int main() { Base b; Derived d; d.noticeThisFunction(&b); - printf("gpptest run\n");// { dg-error "" } .* + printf("gpptest run\n");// { dg-error "5:'printf' was not declared" } .* } diff --git a/gcc/testsuite/g++.old-deja/g++.ns/koenig5.C b/gcc/testsuite/g++.old-deja/g++.ns/koenig5.C index 7c56d5cbc5e..635f35e0118 100644 --- a/gcc/testsuite/g++.old-deja/g++.ns/koenig5.C +++ b/gcc/testsuite/g++.old-deja/g++.ns/koenig5.C @@ -14,6 +14,6 @@ void g() foo(new X); // ok -- DR 218 says that we find the global // foo variable first, and therefore do not // perform argument-dependent lookup. - bar(new X); // { dg-error "not declared" } + bar(new X); // { dg-error "3:'bar' was not declared" } // { dg-message "suggested alternative" "suggested alternative" { target *-*-* } 17 } } diff --git a/gcc/testsuite/g++.old-deja/g++.other/static5.C b/gcc/testsuite/g++.old-deja/g++.other/static5.C index b4032bed2bb..50e5c4acb0e 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/static5.C +++ b/gcc/testsuite/g++.old-deja/g++.other/static5.C @@ -9,7 +9,7 @@ struct S inline void f() { static S s; - atexit (0); // { dg-error "" } implicit declaration + atexit (0); // { dg-error "3:'atexit' was not declared" } implicit declaration } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/overload2.C b/gcc/testsuite/g++.old-deja/g++.pt/overload2.C index e53df3e35b1..b438543d445 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/overload2.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/overload2.C @@ -12,5 +12,5 @@ int main() { C c; - char* p = Z(c.O); //{ dg-error "" } ambiguous c.O + char* p = Z(c.O); //{ dg-error "13:'Z' was not declared" } ambiguous c.O }