diff --git a/clang/test/CXX/drs/dr11xx.cpp b/clang/test/CXX/drs/dr11xx.cpp --- a/clang/test/CXX/drs/dr11xx.cpp +++ b/clang/test/CXX/drs/dr11xx.cpp @@ -1,9 +1,35 @@ -// RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++98 %s -verify=expected,cxx98 -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++2a %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +namespace dr1111 { // dr1111: 6 + // FIXME: warning is emitted for well-formed code in C++98 mode, which + // follows the old behavior (clang 5 and earlier). Behavior is correct in all + // modes, though: only candidates from the class of the object expression are + // considered. + + template + struct set; // #dr1111-set-template + + struct X { + template void set(const T& value); // #dr1111-set-member + }; + void foo() { + X x; + x.set(3.2); // cxx98-error {{lookup of 'set' in member access expression is ambiguous; using member of 'X'}} + // cxx98-note@#dr1111-set-member {{lookup in the object type 'X' refers here}} + // cxx98-note@#dr1111-set-template {{lookup from the current scope refers here}} + } + + struct Y {}; + void bar() { + Y y; + y.set(3.2); // expected-error {{no member named 'set' in 'dr1111::Y'}} + } +} + namespace dr1113 { // dr1113: partial namespace named { extern int a; // expected-note {{previous}} diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html --- a/clang/www/cxx_dr_status.html +++ b/clang/www/cxx_dr_status.html @@ -6473,7 +6473,7 @@ 1111 C++11 Remove dual-scope lookup of member template names - Unknown + Clang 6 1112