diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:44:14 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:44:14 +0000 |
| commit | 2b6b257f4e5503a7a2675bdb8735693db769f75c (patch) | |
| tree | e85e046ae7003fe3bcc8b5454cd0fa3f7407b470 /test/CXX/basic/basic.lookup | |
| parent | b4348ed0b7e90c0831b925fbee00b5f179a99796 (diff) | |
Notes
Diffstat (limited to 'test/CXX/basic/basic.lookup')
| -rw-r--r-- | test/CXX/basic/basic.lookup/basic.lookup.classref/p1.cpp | 17 | ||||
| -rw-r--r-- | test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp | 9 |
2 files changed, 19 insertions, 7 deletions
diff --git a/test/CXX/basic/basic.lookup/basic.lookup.classref/p1.cpp b/test/CXX/basic/basic.lookup/basic.lookup.classref/p1.cpp index c20728332704..bb6bb73ec702 100644 --- a/test/CXX/basic/basic.lookup/basic.lookup.classref/p1.cpp +++ b/test/CXX/basic/basic.lookup/basic.lookup.classref/p1.cpp @@ -1,4 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -fdiagnostics-show-option -verify %s +// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-show-option -verify -std=c++98 %s +// RUN: %clang_cc1 -fsyntax-only -fdiagnostics-show-option -verify -std=c++11 %s // C++98 [basic.lookup.classref]p1: // In a class member access expression (5.2.5), if the . or -> token is @@ -21,10 +23,16 @@ // From PR 7247 template<typename T> -struct set{}; // expected-note{{lookup from the current scope refers here}} +struct set{}; +#if __cplusplus <= 199711L +// expected-note@-2 {{lookup from the current scope refers here}} +#endif struct Value { template<typename T> - void set(T value) {} // expected-note{{lookup in the object type 'Value' refers here}} + void set(T value) {} +#if __cplusplus <= 199711L + // expected-note@-2 {{lookup in the object type 'Value' refers here}} +#endif void resolves_to_same() { Value v; @@ -36,7 +44,10 @@ void resolves_to_different() { Value v; // The fact that the next line is a warning rather than an error is an // extension. - v.set<double>(3.2); // expected-warning{{lookup of 'set' in member access expression is ambiguous; using member of 'Value'}} + v.set<double>(3.2); +#if __cplusplus <= 199711L + // expected-warning@-2 {{lookup of 'set' in member access expression is ambiguous; using member of 'Value'}} +#endif } { int set; // Non-template. diff --git a/test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp b/test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp index d1562d4cd18b..f32b23976547 100644 --- a/test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp +++ b/test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp @@ -53,16 +53,17 @@ namespace InhCtor { int n = b.T(); // expected-error {{'T' is a protected member of 'InhCtor::A'}} // expected-note@-15 {{declared protected here}} + // FIXME: EDG and GCC reject this too, but it's not clear why it would be + // ill-formed. template<typename T> struct S : T { - struct U : S { + struct U : S { // expected-note 6{{candidate}} using S::S; }; using T::T; }; - - S<A>::U ua(0); - S<B>::U ub(0); + S<A>::U ua(0); // expected-error {{no match}} + S<B>::U ub(0); // expected-error {{no match}} template<typename T> struct X : T { |
