diff options
33 files changed, 80 insertions, 74 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5dd4031d843..e9c6cff5940 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2012-07-25 Jason Merrill <jason@redhat.com> + + * pt.c (print_candidates_1): Use inform instead of error. + 2012-07-24 Paolo Carlini <paolo.carlini@oracle.com> * pt.c (convert_template_argument, tsubst): Simplify fourth argument diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 532189d25e3..07b294f36ee 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -1718,19 +1718,21 @@ print_candidates_1 (tree fns, bool more, const char **str) } else { + tree cand = OVL_CURRENT (fn); if (!*str) { /* Pick the prefix string. */ if (!more && !OVL_NEXT (fns)) { - error ("candidate is: %+#D", OVL_CURRENT (fn)); + inform (DECL_SOURCE_LOCATION (cand), + "candidate is: %#D", cand); continue; } *str = _("candidates are:"); spaces = get_spaces (*str); } - error ("%s %+#D", *str, OVL_CURRENT (fn)); + inform (DECL_SOURCE_LOCATION (cand), "%s %#D", *str, cand); *str = spaces ? spaces : *str; } diff --git a/gcc/testsuite/g++.dg/cpp0x/inline-ns2.C b/gcc/testsuite/g++.dg/cpp0x/inline-ns2.C index 03851725bbd..17a8bf60192 100644 --- a/gcc/testsuite/g++.dg/cpp0x/inline-ns2.C +++ b/gcc/testsuite/g++.dg/cpp0x/inline-ns2.C @@ -2,17 +2,17 @@ namespace Q { inline namespace V1 { - extern int i; // { dg-error "" } - extern int j; // { dg-error "" } - void f(); // { dg-error "" } - void g(); // { dg-error "" } + extern int i; // { dg-message "" } + extern int j; // { dg-message "" } + void f(); // { dg-message "" } + void g(); // { dg-message "" } } inline namespace V2 { - extern int j; // { dg-error "" } - void g(); // { dg-error "" } + extern int j; // { dg-message "" } + void g(); // { dg-message "" } } - extern int i; // { dg-error "" } - void f(); // { dg-error "" } + extern int i; // { dg-message "" } + void f(); // { dg-message "" } void h(); } namespace R { diff --git a/gcc/testsuite/g++.dg/cpp0x/range-for14.C b/gcc/testsuite/g++.dg/cpp0x/range-for14.C index 26ae477d70e..438555e1344 100644 --- a/gcc/testsuite/g++.dg/cpp0x/range-for14.C +++ b/gcc/testsuite/g++.dg/cpp0x/range-for14.C @@ -59,7 +59,7 @@ void test1() struct base_begin { - int *begin(); // { dg-error "" } + int *begin(); // { dg-message "" } }; struct base_end diff --git a/gcc/testsuite/g++.dg/lookup/ambig1.C b/gcc/testsuite/g++.dg/lookup/ambig1.C index 1cf9ab4f0a2..c027428899b 100644 --- a/gcc/testsuite/g++.dg/lookup/ambig1.C +++ b/gcc/testsuite/g++.dg/lookup/ambig1.C @@ -7,7 +7,7 @@ // Bug 16889:Undetected ambiguity. struct B { - int f(); // { dg-error "int B::f" "" } + int f(); // { dg-message "int B::f" "" } }; struct B1 : virtual B {}; diff --git a/gcc/testsuite/g++.dg/lookup/ambig2.C b/gcc/testsuite/g++.dg/lookup/ambig2.C index 4d423d17069..505eda60d55 100644 --- a/gcc/testsuite/g++.dg/lookup/ambig2.C +++ b/gcc/testsuite/g++.dg/lookup/ambig2.C @@ -7,7 +7,7 @@ // Bug 16889:Undetected ambiguity. struct B { - int i; // { dg-error "int B::i" "" } + int i; // { dg-message "int B::i" "" } }; struct B1 : virtual B {}; diff --git a/gcc/testsuite/g++.dg/lookup/ambig3.C b/gcc/testsuite/g++.dg/lookup/ambig3.C index 7a0a8377a91..5a3f5b94929 100644 --- a/gcc/testsuite/g++.dg/lookup/ambig3.C +++ b/gcc/testsuite/g++.dg/lookup/ambig3.C @@ -7,7 +7,7 @@ // Follow on from Bug 16889:Undetected ambiguity. struct B { - int f(); // { dg-error "int B::f" "" } + int f(); // { dg-message "int B::f" "" } }; struct B1 : virtual B {}; diff --git a/gcc/testsuite/g++.dg/lookup/ambig4.C b/gcc/testsuite/g++.dg/lookup/ambig4.C index 3a74f7d1c76..1f3daa1e5e4 100644 --- a/gcc/testsuite/g++.dg/lookup/ambig4.C +++ b/gcc/testsuite/g++.dg/lookup/ambig4.C @@ -4,10 +4,10 @@ namespace N { - int i; // { dg-error "i" } + int i; // { dg-message "i" } } -int i; // { dg-error "i" } +int i; // { dg-message "i" } using namespace N; diff --git a/gcc/testsuite/g++.dg/lookup/ambig5.C b/gcc/testsuite/g++.dg/lookup/ambig5.C index cebec277910..fb48ff3c8ac 100644 --- a/gcc/testsuite/g++.dg/lookup/ambig5.C +++ b/gcc/testsuite/g++.dg/lookup/ambig5.C @@ -4,10 +4,10 @@ namespace N { - namespace M {} // { dg-error "M" } + namespace M {} // { dg-message "M" } } -namespace M {} // { dg-error "M" } +namespace M {} // { dg-message "M" } using namespace N; using namespace M; // { dg-error "namespace-name|ambiguous" } diff --git a/gcc/testsuite/g++.dg/lookup/crash3.C b/gcc/testsuite/g++.dg/lookup/crash3.C index 24a3360ba33..5b58e8ed559 100644 --- a/gcc/testsuite/g++.dg/lookup/crash3.C +++ b/gcc/testsuite/g++.dg/lookup/crash3.C @@ -4,8 +4,8 @@ typedef __SIZE_TYPE__ size_t; -struct A { void *operator new(size_t s){} }; // { dg-error "operator new" } -struct B { void *operator new(size_t s){} }; // { dg-error "operator new" } +struct A { void *operator new(size_t s){} }; // { dg-message "operator new" } +struct B { void *operator new(size_t s){} }; // { dg-message "operator new" } struct C : A,B {}; diff --git a/gcc/testsuite/g++.dg/lookup/strong-using-2.C b/gcc/testsuite/g++.dg/lookup/strong-using-2.C index 38bb54c2f58..d9f99a8d128 100644 --- a/gcc/testsuite/g++.dg/lookup/strong-using-2.C +++ b/gcc/testsuite/g++.dg/lookup/strong-using-2.C @@ -5,12 +5,12 @@ namespace foo { inline namespace foo_impl { - class T; // { dg-error "T" "" } + class T; // { dg-message "T" "" } } } namespace bar { inline namespace bar_impl { - class T; // { dg-error "T" "" } + class T; // { dg-message "T" "" } } using namespace foo; } diff --git a/gcc/testsuite/g++.dg/lookup/using16.C b/gcc/testsuite/g++.dg/lookup/using16.C index a396afb973c..8a36504caf2 100644 --- a/gcc/testsuite/g++.dg/lookup/using16.C +++ b/gcc/testsuite/g++.dg/lookup/using16.C @@ -3,12 +3,12 @@ // { dg-do compile } namespace M { - struct S {}; // { dg-error "struct M::S" "candidate 1" } + struct S {}; // { dg-message "struct M::S" "candidate 1" } } namespace N { int S; - struct S {}; // { dg-error "struct N::S" "candidate 2" } + struct S {}; // { dg-message "struct N::S" "candidate 2" } } using namespace M; diff --git a/gcc/testsuite/g++.dg/lookup/using17.C b/gcc/testsuite/g++.dg/lookup/using17.C index b98b21a0cda..9019dabf5df 100644 --- a/gcc/testsuite/g++.dg/lookup/using17.C +++ b/gcc/testsuite/g++.dg/lookup/using17.C @@ -3,11 +3,11 @@ // { dg-do compile } namespace M { - struct S {}; // { dg-error "struct M::S" "candidate 2" } + struct S {}; // { dg-message "struct M::S" "candidate 2" } } int S; -struct S {}; // { dg-error "candidates are: struct S" "candidate 1" } +struct S {}; // { dg-message "candidates are: struct S" "candidate 1" } using namespace M; diff --git a/gcc/testsuite/g++.dg/lookup/using18.C b/gcc/testsuite/g++.dg/lookup/using18.C index 37557148ea6..d64fbc6e916 100644 --- a/gcc/testsuite/g++.dg/lookup/using18.C +++ b/gcc/testsuite/g++.dg/lookup/using18.C @@ -4,12 +4,12 @@ namespace N1 { void f (); - struct f; // { dg-error "" "candidate" } + struct f; // { dg-message "" "candidate" } } namespace N2 { void f (int); - struct f; // { dg-error "" "candidate" } + struct f; // { dg-message "" "candidate" } } namespace M { diff --git a/gcc/testsuite/g++.dg/lookup/using20.C b/gcc/testsuite/g++.dg/lookup/using20.C index dc1d293a2ee..f1be41fea95 100644 --- a/gcc/testsuite/g++.dg/lookup/using20.C +++ b/gcc/testsuite/g++.dg/lookup/using20.C @@ -2,14 +2,14 @@ namespace A { - int i; // { dg-error "i" } + int i; // { dg-message "i" } } using namespace A; namespace B { namespace B2 { - int i; // { dg-error "i" } + int i; // { dg-message "i" } } using namespace B2; } diff --git a/gcc/testsuite/g++.dg/parse/ambig4.C b/gcc/testsuite/g++.dg/parse/ambig4.C index 868f07cf783..02e39b80f0c 100644 --- a/gcc/testsuite/g++.dg/parse/ambig4.C +++ b/gcc/testsuite/g++.dg/parse/ambig4.C @@ -1,12 +1,12 @@ // PR c++/20293 -namespace hide { // { dg-error "hide" } +namespace hide { // { dg-message "hide" } int k; } namespace { int i; - namespace hide { // { dg-error "hide" } + namespace hide { // { dg-message "hide" } int j; } } diff --git a/gcc/testsuite/g++.dg/parse/ambig6.C b/gcc/testsuite/g++.dg/parse/ambig6.C index 8f37feaea68..0bd2302fe00 100644 --- a/gcc/testsuite/g++.dg/parse/ambig6.C +++ b/gcc/testsuite/g++.dg/parse/ambig6.C @@ -1,7 +1,7 @@ // PR c++/48046 -namespace N1 { typedef int T; } // { dg-error "" } -namespace N2 { typedef float T; } // { dg-error "" } +namespace N1 { typedef int T; } // { dg-message "" } +namespace N2 { typedef float T; } // { dg-message "" } int main() { diff --git a/gcc/testsuite/g++.dg/parse/crash22.C b/gcc/testsuite/g++.dg/parse/crash22.C index eaf4d1a5c08..ba8870376fa 100644 --- a/gcc/testsuite/g++.dg/parse/crash22.C +++ b/gcc/testsuite/g++.dg/parse/crash22.C @@ -4,17 +4,17 @@ // PR 19030: ICE // Origin: Volker Reichelt <reichelt@gcc.gnu.org> -struct A; // { dg-error "A" } +struct A; // { dg-message "A" } namespace N { - struct A; // { dg-error "A" } + struct A; // { dg-message "A" } } using namespace N; -int A::i; // { dg-error "ambiguous|declared here" "" } -int A::i; // { dg-error "ambiguous|redefinition of" "" } +int A::i; // { dg-message "ambiguous|declared here" "" } +int A::i; // { dg-message "ambiguous|redefinition of" "" } namespace N { diff --git a/gcc/testsuite/g++.dg/parse/crash53.C b/gcc/testsuite/g++.dg/parse/crash53.C index de6d412f1d1..c19feafc189 100644 --- a/gcc/testsuite/g++.dg/parse/crash53.C +++ b/gcc/testsuite/g++.dg/parse/crash53.C @@ -1,9 +1,9 @@ // PR c++/35112 -namespace X { struct A; } // { dg-error "struct X::A" } -namespace Y { struct A; } // { dg-error "struct Y::A" } -namespace Z { struct A; } // { dg-error "struct Z::A" } -namespace W { struct A; } // { dg-error "struct W::A" } +namespace X { struct A; } // { dg-message "struct X::A" } +namespace Y { struct A; } // { dg-message "struct Y::A" } +namespace Z { struct A; } // { dg-message "struct Z::A" } +namespace W { struct A; } // { dg-message "struct W::A" } using namespace X; using namespace Y; diff --git a/gcc/testsuite/g++.dg/parse/non-dependent2.C b/gcc/testsuite/g++.dg/parse/non-dependent2.C index fee66d495a4..a2ae81d7f8d 100644 --- a/gcc/testsuite/g++.dg/parse/non-dependent2.C +++ b/gcc/testsuite/g++.dg/parse/non-dependent2.C @@ -8,14 +8,14 @@ template <class T> struct Foo { int j; // we never see this one. - int k; // { dg-error "Foo" "" } + int k; // { dg-message "Foo" "" } }; struct Baz { int j; - int k; // { dg-error "candidates" "" } + int k; // { dg-message "candidates" "" } }; diff --git a/gcc/testsuite/g++.dg/template/crash92.C b/gcc/testsuite/g++.dg/template/crash92.C index c0219c4a3e8..1153ef61934 100644 --- a/gcc/testsuite/g++.dg/template/crash92.C +++ b/gcc/testsuite/g++.dg/template/crash92.C @@ -1,7 +1,7 @@ // PR c++/42055 -template<typename T> void foo(T, T); // { dg-error "candidates|template" } +template<typename T> void foo(T, T); // { dg-message "candidates|template" } -template<typename T> void foo(T, int); // { dg-error "template" } +template<typename T> void foo(T, int); // { dg-message "template" } template void foo(int, int); // { dg-error "ambiguous template specialization" } diff --git a/gcc/testsuite/g++.dg/template/injected1.C b/gcc/testsuite/g++.dg/template/injected1.C index 58b86569387..58ec3cba6a3 100644 --- a/gcc/testsuite/g++.dg/template/injected1.C +++ b/gcc/testsuite/g++.dg/template/injected1.C @@ -1,6 +1,6 @@ // PR c++/13950, DR 176 -template <class T> struct Base { }; // { dg-error "" } candidate +template <class T> struct Base { }; // { dg-message "" } candidate struct D1: Base<void> { diff --git a/gcc/testsuite/g++.dg/template/overload10.C b/gcc/testsuite/g++.dg/template/overload10.C index 088b9d291cb..84078bd8725 100644 --- a/gcc/testsuite/g++.dg/template/overload10.C +++ b/gcc/testsuite/g++.dg/template/overload10.C @@ -1,6 +1,6 @@ // PR c++40342 -template <typename T1, typename T2> int f(T1 *, const T2 *); // { dg-error "" } -template <typename T1, typename T2> int f(const T1 *, T2 *); // { dg-error "" } +template <typename T1, typename T2> int f(T1 *, const T2 *); // { dg-message "" } +template <typename T1, typename T2> int f(const T1 *, T2 *); // { dg-message "" } int (*p)(const int *, const int *) = f; // { dg-error "ambiguous" } diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900519_13.C b/gcc/testsuite/g++.old-deja/g++.bugs/900519_13.C index 9d4edc60a24..6b8260d418b 100644 --- a/gcc/testsuite/g++.old-deja/g++.bugs/900519_13.C +++ b/gcc/testsuite/g++.old-deja/g++.bugs/900519_13.C @@ -12,15 +12,15 @@ // keywords: inheritance, ambiguity resolution, members struct base_0 { - enum { base_member }; // { dg-error "" } candidate (26, 30) + enum { base_member }; // { dg-message "" } candidate (26, 30) }; struct base_1 { - int base_member; // { dg-error "" } candidate (26, 34) + int base_member; // { dg-message "" } candidate (26, 34) }; struct base_2 { - int base_member (); // { dg-error "" } candidate (30, 34) + int base_member (); // { dg-message "" } candidate (30, 34) }; struct derived_0 : public base_0, public base_1 { diff --git a/gcc/testsuite/g++.old-deja/g++.jason/overload20.C b/gcc/testsuite/g++.old-deja/g++.jason/overload20.C index f5db6a20fce..ef8504b2aff 100644 --- a/gcc/testsuite/g++.old-deja/g++.jason/overload20.C +++ b/gcc/testsuite/g++.old-deja/g++.jason/overload20.C @@ -4,8 +4,8 @@ void f (char *); void f (int); struct A { - void f (); // { dg-error "" } candidate - void f (int); // { dg-error "" } candidate + void f (); // { dg-message "" } candidate + void f (int); // { dg-message "" } candidate void g () { void (*p)(char *) = f; // { dg-error "" } no matching function in scope } diff --git a/gcc/testsuite/g++.old-deja/g++.martin/ambig1.C b/gcc/testsuite/g++.old-deja/g++.martin/ambig1.C index 1ccc217a477..f2a7f1e2f4b 100644 --- a/gcc/testsuite/g++.old-deja/g++.martin/ambig1.C +++ b/gcc/testsuite/g++.old-deja/g++.martin/ambig1.C @@ -2,12 +2,12 @@ //Based on a report by Bill Currie <bcurrie@tssc.co.nz> struct foo { protected: - int x; // { dg-error "" } candidate + int x; // { dg-message "" } candidate }; struct bar { public: - int x(); // { dg-error "" } candidate + int x(); // { dg-message "" } candidate }; struct foobar: public foo, public bar { diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pmf3.C b/gcc/testsuite/g++.old-deja/g++.mike/pmf3.C index 8dee9278f62..5ee1e343a2a 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/pmf3.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/pmf3.C @@ -6,9 +6,9 @@ struct Fooey { void h(double dx); }; -void Fooey::f(char*) { } // { dg-error "" } candidate -void Fooey::f(int) { } // { dg-error "" } candidate -void Fooey::f(float) { } // { dg-error "" } candidate +void Fooey::f(char*) { } // { dg-message "" } candidate +void Fooey::f(int) { } // { dg-message "" } candidate +void Fooey::f(float) { } // { dg-message "" } candidate void Fooey::h(double zahl) { } int main() { diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/overload1.C b/gcc/testsuite/g++.old-deja/g++.oliva/overload1.C index 75c8723c70f..69a4fa5dcb7 100644 --- a/gcc/testsuite/g++.old-deja/g++.oliva/overload1.C +++ b/gcc/testsuite/g++.old-deja/g++.oliva/overload1.C @@ -6,8 +6,8 @@ // Based on bug report by JDonner <jdonner@schedsys.com> struct foo { - static int bar(); // { dg-error "foo::bar" } - void bar(int); // { dg-error "foo::bar" } + static int bar(); // { dg-message "foo::bar" } + void bar(int); // { dg-message "foo::bar" } }; /* gcc emits a hard error without -pedantic, and a warning with diff --git a/gcc/testsuite/g++.old-deja/g++.other/ambig1.C b/gcc/testsuite/g++.old-deja/g++.other/ambig1.C index f3fe0a8dd8e..b18c5290d6e 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/ambig1.C +++ b/gcc/testsuite/g++.old-deja/g++.other/ambig1.C @@ -1,15 +1,15 @@ // { dg-do assemble } struct A { - int operator ++(); // { dg-error "" } candidates - void operator ()(); // { dg-error "" } candidates - void operator delete(void*); // { dg-error "" } candidates + int operator ++(); // { dg-message "" } candidates + void operator ()(); // { dg-message "" } candidates + void operator delete(void*); // { dg-message "" } candidates }; struct B { - int operator ++(int); // { dg-error "" } candidates - void operator ()(); // { dg-error "" } candidates - void operator delete(void*); // { dg-error "" } candidates + int operator ++(int); // { dg-message "" } candidates + void operator ()(); // { dg-message "" } candidates + void operator delete(void*); // { dg-message "" } candidates void f(); }; diff --git a/gcc/testsuite/g++.old-deja/g++.other/lineno2.C b/gcc/testsuite/g++.old-deja/g++.other/lineno2.C index 3735d6481ee..d6aca8b9cfd 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/lineno2.C +++ b/gcc/testsuite/g++.old-deja/g++.other/lineno2.C @@ -2,9 +2,9 @@ // Submitted by Nathan Sidwell <nathan@acm.org> // Bug: g++ wasn't listing candidates for a failed conversion. -void f(int, double); // { dg-error "" } candidate -void f(double, int); // { dg-error "" } candidate -void f(int); // { dg-error "" } candidate +void f(int, double); // { dg-message "" } candidate +void f(double, int); // { dg-message "" } candidate +void f(int); // { dg-message "" } candidate int main () diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash58.C b/gcc/testsuite/g++.old-deja/g++.pt/crash58.C index 0ce3d81723d..f0b609a9183 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/crash58.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash58.C @@ -6,9 +6,9 @@ // bug 147. We ICE'd on an unprocessed LOOKUP_EXPR during tsubsting namespace EManip { - template <class T> void do_assign(T* d); // { dg-error "" } candidate + template <class T> void do_assign(T* d); // { dg-message "" } candidate } -template <class T> void do_assign(T* d); // { dg-error "" } candidate +template <class T> void do_assign(T* d); // { dg-message "" } candidate template <class T> struct MatrixC diff --git a/gcc/testsuite/g++.old-deja/g++.pt/koenig1.C b/gcc/testsuite/g++.old-deja/g++.pt/koenig1.C index 03b58587c5c..c58bd6eab19 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/koenig1.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/koenig1.C @@ -12,7 +12,7 @@ struct A { template <int s> static void g(); template <int s> -void f(); // { dg-error "" } candiate +void f(); // { dg-message "" } candiate static void f_plus () { diff --git a/gcc/testsuite/g++.old-deja/g++.pt/overload5.C b/gcc/testsuite/g++.old-deja/g++.pt/overload5.C index 1bb2d448f98..50febb2e7aa 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/overload5.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/overload5.C @@ -1,6 +1,6 @@ // { dg-do assemble } -template <class T> void foo(); // { dg-error "" } candidate +template <class T> void foo(); // { dg-message "" } candidate void (*bar)() = foo<void>; void (*baz)() = foo; // { dg-error "" } can't deduce T |