diff options
Diffstat (limited to 'test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp')
-rw-r--r-- | test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp b/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp index ccadf41..15d86b7 100644 --- a/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp +++ b/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp @@ -19,8 +19,9 @@ namespace D { } namespace C { - class C {}; - void func(C); + class C {}; // expected-note {{candidate constructor (the implicit copy constructor) not viable: no known conversion from 'B::B' to 'const C::C &' for 1st argument}} + void func(C); // expected-note {{'C::func' declared here}} \ + // expected-note {{passing argument to parameter here}} C operator+(C,C); D::D operator+(D::D,D::D); } @@ -32,7 +33,13 @@ namespace D { namespace Test { void test() { func(A::A()); - func(B::B()); // expected-error {{use of undeclared identifier 'func'}} + // FIXME: namespace-aware typo correction causes an extra, misleading + // message in this case; some form of backtracking, diagnostic message + // delaying, or argument checking before emitting diagnostics is needed to + // avoid accepting and printing out a typo correction that proves to be + // incorrect once argument-dependent lookup resolution has occurred. + func(B::B()); // expected-error {{use of undeclared identifier 'func'; did you mean 'C::func'?}} \ + // expected-error {{no viable conversion from 'B::B' to 'C::C'}} func(C::C()); A::A() + A::A(); B::B() + B::B(); |