mirror of git://gcc.gnu.org/git/gcc.git
* pt.c (print_candidates_1): Use inform instead of error.
From-SVN: r189849
This commit is contained in:
parent
229ecb8935
commit
25a92d2f91
|
|
@ -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>
|
2012-07-24 Paolo Carlini <paolo.carlini@oracle.com>
|
||||||
|
|
||||||
* pt.c (convert_template_argument, tsubst): Simplify fourth argument
|
* pt.c (convert_template_argument, tsubst): Simplify fourth argument
|
||||||
|
|
|
||||||
|
|
@ -1718,19 +1718,21 @@ print_candidates_1 (tree fns, bool more, const char **str)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
tree cand = OVL_CURRENT (fn);
|
||||||
if (!*str)
|
if (!*str)
|
||||||
{
|
{
|
||||||
/* Pick the prefix string. */
|
/* Pick the prefix string. */
|
||||||
if (!more && !OVL_NEXT (fns))
|
if (!more && !OVL_NEXT (fns))
|
||||||
{
|
{
|
||||||
error ("candidate is: %+#D", OVL_CURRENT (fn));
|
inform (DECL_SOURCE_LOCATION (cand),
|
||||||
|
"candidate is: %#D", cand);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
*str = _("candidates are:");
|
*str = _("candidates are:");
|
||||||
spaces = get_spaces (*str);
|
spaces = get_spaces (*str);
|
||||||
}
|
}
|
||||||
error ("%s %+#D", *str, OVL_CURRENT (fn));
|
inform (DECL_SOURCE_LOCATION (cand), "%s %#D", *str, cand);
|
||||||
*str = spaces ? spaces : *str;
|
*str = spaces ? spaces : *str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,17 +2,17 @@
|
||||||
|
|
||||||
namespace Q {
|
namespace Q {
|
||||||
inline namespace V1 {
|
inline namespace V1 {
|
||||||
extern int i; // { dg-error "" }
|
extern int i; // { dg-message "" }
|
||||||
extern int j; // { dg-error "" }
|
extern int j; // { dg-message "" }
|
||||||
void f(); // { dg-error "" }
|
void f(); // { dg-message "" }
|
||||||
void g(); // { dg-error "" }
|
void g(); // { dg-message "" }
|
||||||
}
|
}
|
||||||
inline namespace V2 {
|
inline namespace V2 {
|
||||||
extern int j; // { dg-error "" }
|
extern int j; // { dg-message "" }
|
||||||
void g(); // { dg-error "" }
|
void g(); // { dg-message "" }
|
||||||
}
|
}
|
||||||
extern int i; // { dg-error "" }
|
extern int i; // { dg-message "" }
|
||||||
void f(); // { dg-error "" }
|
void f(); // { dg-message "" }
|
||||||
void h();
|
void h();
|
||||||
}
|
}
|
||||||
namespace R {
|
namespace R {
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ void test1()
|
||||||
|
|
||||||
struct base_begin
|
struct base_begin
|
||||||
{
|
{
|
||||||
int *begin(); // { dg-error "" }
|
int *begin(); // { dg-message "" }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct base_end
|
struct base_end
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
// Bug 16889:Undetected ambiguity.
|
// Bug 16889:Undetected ambiguity.
|
||||||
|
|
||||||
struct B {
|
struct B {
|
||||||
int f(); // { dg-error "int B::f" "" }
|
int f(); // { dg-message "int B::f" "" }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct B1 : virtual B {};
|
struct B1 : virtual B {};
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
// Bug 16889:Undetected ambiguity.
|
// Bug 16889:Undetected ambiguity.
|
||||||
|
|
||||||
struct B {
|
struct B {
|
||||||
int i; // { dg-error "int B::i" "" }
|
int i; // { dg-message "int B::i" "" }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct B1 : virtual B {};
|
struct B1 : virtual B {};
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
// Follow on from Bug 16889:Undetected ambiguity.
|
// Follow on from Bug 16889:Undetected ambiguity.
|
||||||
|
|
||||||
struct B {
|
struct B {
|
||||||
int f(); // { dg-error "int B::f" "" }
|
int f(); // { dg-message "int B::f" "" }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct B1 : virtual B {};
|
struct B1 : virtual B {};
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@
|
||||||
|
|
||||||
namespace N
|
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;
|
using namespace N;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@
|
||||||
|
|
||||||
namespace N
|
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 N;
|
||||||
using namespace M; // { dg-error "namespace-name|ambiguous" }
|
using namespace M; // { dg-error "namespace-name|ambiguous" }
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
typedef __SIZE_TYPE__ size_t;
|
typedef __SIZE_TYPE__ size_t;
|
||||||
|
|
||||||
struct A { 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-error "operator new" }
|
struct B { void *operator new(size_t s){} }; // { dg-message "operator new" }
|
||||||
|
|
||||||
struct C : A,B {};
|
struct C : A,B {};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,12 @@
|
||||||
|
|
||||||
namespace foo {
|
namespace foo {
|
||||||
inline namespace foo_impl {
|
inline namespace foo_impl {
|
||||||
class T; // { dg-error "T" "" }
|
class T; // { dg-message "T" "" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
namespace bar {
|
namespace bar {
|
||||||
inline namespace bar_impl {
|
inline namespace bar_impl {
|
||||||
class T; // { dg-error "T" "" }
|
class T; // { dg-message "T" "" }
|
||||||
}
|
}
|
||||||
using namespace foo;
|
using namespace foo;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,12 @@
|
||||||
// { dg-do compile }
|
// { dg-do compile }
|
||||||
|
|
||||||
namespace M {
|
namespace M {
|
||||||
struct S {}; // { dg-error "struct M::S" "candidate 1" }
|
struct S {}; // { dg-message "struct M::S" "candidate 1" }
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace N {
|
namespace N {
|
||||||
int S;
|
int S;
|
||||||
struct S {}; // { dg-error "struct N::S" "candidate 2" }
|
struct S {}; // { dg-message "struct N::S" "candidate 2" }
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace M;
|
using namespace M;
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,11 @@
|
||||||
// { dg-do compile }
|
// { dg-do compile }
|
||||||
|
|
||||||
namespace M {
|
namespace M {
|
||||||
struct S {}; // { dg-error "struct M::S" "candidate 2" }
|
struct S {}; // { dg-message "struct M::S" "candidate 2" }
|
||||||
}
|
}
|
||||||
|
|
||||||
int S;
|
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;
|
using namespace M;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,12 @@
|
||||||
|
|
||||||
namespace N1 {
|
namespace N1 {
|
||||||
void f ();
|
void f ();
|
||||||
struct f; // { dg-error "" "candidate" }
|
struct f; // { dg-message "" "candidate" }
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace N2 {
|
namespace N2 {
|
||||||
void f (int);
|
void f (int);
|
||||||
struct f; // { dg-error "" "candidate" }
|
struct f; // { dg-message "" "candidate" }
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace M {
|
namespace M {
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,14 @@
|
||||||
|
|
||||||
namespace A
|
namespace A
|
||||||
{
|
{
|
||||||
int i; // { dg-error "i" }
|
int i; // { dg-message "i" }
|
||||||
}
|
}
|
||||||
using namespace A;
|
using namespace A;
|
||||||
namespace B
|
namespace B
|
||||||
{
|
{
|
||||||
namespace B2
|
namespace B2
|
||||||
{
|
{
|
||||||
int i; // { dg-error "i" }
|
int i; // { dg-message "i" }
|
||||||
}
|
}
|
||||||
using namespace B2;
|
using namespace B2;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
// PR c++/20293
|
// PR c++/20293
|
||||||
|
|
||||||
namespace hide { // { dg-error "hide" }
|
namespace hide { // { dg-message "hide" }
|
||||||
int k;
|
int k;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
int i;
|
int i;
|
||||||
namespace hide { // { dg-error "hide" }
|
namespace hide { // { dg-message "hide" }
|
||||||
int j;
|
int j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// PR c++/48046
|
// PR c++/48046
|
||||||
|
|
||||||
namespace N1 { typedef int T; } // { dg-error "" }
|
namespace N1 { typedef int T; } // { dg-message "" }
|
||||||
namespace N2 { typedef float T; } // { dg-error "" }
|
namespace N2 { typedef float T; } // { dg-message "" }
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,17 +4,17 @@
|
||||||
// PR 19030: ICE
|
// PR 19030: ICE
|
||||||
// Origin: Volker Reichelt <reichelt@gcc.gnu.org>
|
// Origin: Volker Reichelt <reichelt@gcc.gnu.org>
|
||||||
|
|
||||||
struct A; // { dg-error "A" }
|
struct A; // { dg-message "A" }
|
||||||
|
|
||||||
namespace N
|
namespace N
|
||||||
{
|
{
|
||||||
struct A; // { dg-error "A" }
|
struct A; // { dg-message "A" }
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace N;
|
using namespace N;
|
||||||
|
|
||||||
int A::i; // { dg-error "ambiguous|declared here" "" }
|
int A::i; // { dg-message "ambiguous|declared here" "" }
|
||||||
int A::i; // { dg-error "ambiguous|redefinition of" "" }
|
int A::i; // { dg-message "ambiguous|redefinition of" "" }
|
||||||
|
|
||||||
namespace N
|
namespace N
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
// PR c++/35112
|
// PR c++/35112
|
||||||
|
|
||||||
namespace X { struct A; } // { dg-error "struct X::A" }
|
namespace X { struct A; } // { dg-message "struct X::A" }
|
||||||
namespace Y { struct A; } // { dg-error "struct Y::A" }
|
namespace Y { struct A; } // { dg-message "struct Y::A" }
|
||||||
namespace Z { struct A; } // { dg-error "struct Z::A" }
|
namespace Z { struct A; } // { dg-message "struct Z::A" }
|
||||||
namespace W { struct A; } // { dg-error "struct W::A" }
|
namespace W { struct A; } // { dg-message "struct W::A" }
|
||||||
|
|
||||||
using namespace X;
|
using namespace X;
|
||||||
using namespace Y;
|
using namespace Y;
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,14 @@
|
||||||
template <class T>
|
template <class T>
|
||||||
struct Foo {
|
struct Foo {
|
||||||
int j; // we never see this one.
|
int j; // we never see this one.
|
||||||
int k; // { dg-error "Foo" "" }
|
int k; // { dg-message "Foo" "" }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Baz
|
struct Baz
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
int k; // { dg-error "candidates" "" }
|
int k; // { dg-message "candidates" "" }
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// PR c++/42055
|
// 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" }
|
template void foo(int, int); // { dg-error "ambiguous template specialization" }
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// PR c++/13950, DR 176
|
// 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>
|
struct D1: Base<void>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// PR c++40342
|
// PR c++40342
|
||||||
|
|
||||||
template <typename T1, typename T2> int f(T1 *, const 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-error "" }
|
template <typename T1, typename T2> int f(const T1 *, T2 *); // { dg-message "" }
|
||||||
|
|
||||||
int (*p)(const int *, const int *) = f; // { dg-error "ambiguous" }
|
int (*p)(const int *, const int *) = f; // { dg-error "ambiguous" }
|
||||||
|
|
|
||||||
|
|
@ -12,15 +12,15 @@
|
||||||
// keywords: inheritance, ambiguity resolution, members
|
// keywords: inheritance, ambiguity resolution, members
|
||||||
|
|
||||||
struct base_0 {
|
struct base_0 {
|
||||||
enum { base_member }; // { dg-error "" } candidate (26, 30)
|
enum { base_member }; // { dg-message "" } candidate (26, 30)
|
||||||
};
|
};
|
||||||
|
|
||||||
struct base_1 {
|
struct base_1 {
|
||||||
int base_member; // { dg-error "" } candidate (26, 34)
|
int base_member; // { dg-message "" } candidate (26, 34)
|
||||||
};
|
};
|
||||||
|
|
||||||
struct base_2 {
|
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 {
|
struct derived_0 : public base_0, public base_1 {
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
void f (char *);
|
void f (char *);
|
||||||
void f (int);
|
void f (int);
|
||||||
struct A {
|
struct A {
|
||||||
void f (); // { dg-error "" } candidate
|
void f (); // { dg-message "" } candidate
|
||||||
void f (int); // { dg-error "" } candidate
|
void f (int); // { dg-message "" } candidate
|
||||||
void g () {
|
void g () {
|
||||||
void (*p)(char *) = f; // { dg-error "" } no matching function in scope
|
void (*p)(char *) = f; // { dg-error "" } no matching function in scope
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,12 @@
|
||||||
//Based on a report by Bill Currie <bcurrie@tssc.co.nz>
|
//Based on a report by Bill Currie <bcurrie@tssc.co.nz>
|
||||||
struct foo {
|
struct foo {
|
||||||
protected:
|
protected:
|
||||||
int x; // { dg-error "" } candidate
|
int x; // { dg-message "" } candidate
|
||||||
};
|
};
|
||||||
|
|
||||||
struct bar {
|
struct bar {
|
||||||
public:
|
public:
|
||||||
int x(); // { dg-error "" } candidate
|
int x(); // { dg-message "" } candidate
|
||||||
};
|
};
|
||||||
|
|
||||||
struct foobar: public foo, public bar {
|
struct foobar: public foo, public bar {
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ struct Fooey {
|
||||||
void h(double dx);
|
void h(double dx);
|
||||||
};
|
};
|
||||||
|
|
||||||
void Fooey::f(char*) { } // { dg-error "" } candidate
|
void Fooey::f(char*) { } // { dg-message "" } candidate
|
||||||
void Fooey::f(int) { } // { dg-error "" } candidate
|
void Fooey::f(int) { } // { dg-message "" } candidate
|
||||||
void Fooey::f(float) { } // { dg-error "" } candidate
|
void Fooey::f(float) { } // { dg-message "" } candidate
|
||||||
void Fooey::h(double zahl) { }
|
void Fooey::h(double zahl) { }
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
// Based on bug report by JDonner <jdonner@schedsys.com>
|
// Based on bug report by JDonner <jdonner@schedsys.com>
|
||||||
|
|
||||||
struct foo {
|
struct foo {
|
||||||
static int bar(); // { dg-error "foo::bar" }
|
static int bar(); // { dg-message "foo::bar" }
|
||||||
void bar(int); // { dg-error "foo::bar" }
|
void bar(int); // { dg-message "foo::bar" }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* gcc emits a hard error without -pedantic, and a warning with
|
/* gcc emits a hard error without -pedantic, and a warning with
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
// { dg-do assemble }
|
// { dg-do assemble }
|
||||||
|
|
||||||
struct A {
|
struct A {
|
||||||
int operator ++(); // { dg-error "" } candidates
|
int operator ++(); // { dg-message "" } candidates
|
||||||
void operator ()(); // { dg-error "" } candidates
|
void operator ()(); // { dg-message "" } candidates
|
||||||
void operator delete(void*); // { dg-error "" } candidates
|
void operator delete(void*); // { dg-message "" } candidates
|
||||||
};
|
};
|
||||||
|
|
||||||
struct B {
|
struct B {
|
||||||
int operator ++(int); // { dg-error "" } candidates
|
int operator ++(int); // { dg-message "" } candidates
|
||||||
void operator ()(); // { dg-error "" } candidates
|
void operator ()(); // { dg-message "" } candidates
|
||||||
void operator delete(void*); // { dg-error "" } candidates
|
void operator delete(void*); // { dg-message "" } candidates
|
||||||
void f();
|
void f();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
// Submitted by Nathan Sidwell <nathan@acm.org>
|
// Submitted by Nathan Sidwell <nathan@acm.org>
|
||||||
// Bug: g++ wasn't listing candidates for a failed conversion.
|
// Bug: g++ wasn't listing candidates for a failed conversion.
|
||||||
|
|
||||||
void f(int, double); // { dg-error "" } candidate
|
void f(int, double); // { dg-message "" } candidate
|
||||||
void f(double, int); // { dg-error "" } candidate
|
void f(double, int); // { dg-message "" } candidate
|
||||||
void f(int); // { dg-error "" } candidate
|
void f(int); // { dg-message "" } candidate
|
||||||
|
|
||||||
int
|
int
|
||||||
main ()
|
main ()
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@
|
||||||
// bug 147. We ICE'd on an unprocessed LOOKUP_EXPR during tsubsting
|
// bug 147. We ICE'd on an unprocessed LOOKUP_EXPR during tsubsting
|
||||||
|
|
||||||
namespace EManip {
|
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>
|
template <class T>
|
||||||
struct MatrixC
|
struct MatrixC
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ struct A {
|
||||||
template <int s>
|
template <int s>
|
||||||
static void g();
|
static void g();
|
||||||
template <int s>
|
template <int s>
|
||||||
void f(); // { dg-error "" } candiate
|
void f(); // { dg-message "" } candiate
|
||||||
|
|
||||||
static void f_plus ()
|
static void f_plus ()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// { dg-do assemble }
|
// { dg-do assemble }
|
||||||
|
|
||||||
template <class T> void foo(); // { dg-error "" } candidate
|
template <class T> void foo(); // { dg-message "" } candidate
|
||||||
|
|
||||||
void (*bar)() = foo<void>;
|
void (*bar)() = foo<void>;
|
||||||
void (*baz)() = foo; // { dg-error "" } can't deduce T
|
void (*baz)() = foo; // { dg-error "" } can't deduce T
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue