This revision was automatically updated to reflect the committed changes. Closed by commit rG80bae9aacc14: [clang] Add test for CWG405 (authored by Endill).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139095/new/ https://reviews.llvm.org/D139095 Files: clang/test/CXX/drs/dr2xx.cpp clang/test/CXX/drs/dr4xx.cpp clang/www/cxx_dr_status.html Index: clang/www/cxx_dr_status.html =================================================================== --- clang/www/cxx_dr_status.html +++ clang/www/cxx_dr_status.html @@ -2470,7 +2470,7 @@ <td><a href="https://wg21.link/cwg405">405</a></td> <td>CD6</td> <td>Unqualified function name lookup</td> - <td class="none" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="406"> <td><a href="https://wg21.link/cwg406">406</a></td> Index: clang/test/CXX/drs/dr4xx.cpp =================================================================== --- clang/test/CXX/drs/dr4xx.cpp +++ clang/test/CXX/drs/dr4xx.cpp @@ -3,6 +3,7 @@ // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // FIXME: __SIZE_TYPE__ expands to 'long long' on some targets. __extension__ typedef __SIZE_TYPE__ size_t; @@ -79,6 +80,40 @@ // dr404: na // (NB: also sup 594) +namespace dr405 { // dr405: yes + // NB: also dup 218 + namespace A { + struct S {}; + void f(S); + } + namespace B { + struct S {}; + void f(S); + } + + struct C { + int f; + void test1(A::S as) { f(as); } // expected-error {{called object type 'int'}} + void test2(A::S as) { void f(); f(as); } // expected-error {{too many arguments}} expected-note {{}} + void test3(A::S as) { using A::f; f(as); } // ok + void test4(A::S as) { using B::f; f(as); } // ok + void test5(A::S as) { int f; f(as); } // expected-error {{called object type 'int'}} + void test6(A::S as) { struct f {}; (void) f(as); } // expected-error {{no matching conversion}} expected-note +{{}} + }; + + namespace D { + struct S {}; + struct X { void operator()(S); } f; + } + void testD(D::S ds) { f(ds); } // expected-error {{undeclared identifier}} + + namespace E { + struct S {}; + struct f { f(S); }; + } + void testE(E::S es) { f(es); } // expected-error {{undeclared identifier}} +} + namespace dr406 { // dr406: yes typedef struct { static int n; // expected-error {{static data member 'n' not allowed in anonymous struct}} Index: clang/test/CXX/drs/dr2xx.cpp =================================================================== --- clang/test/CXX/drs/dr2xx.cpp +++ clang/test/CXX/drs/dr2xx.cpp @@ -141,6 +141,7 @@ } namespace dr218 { // dr218: yes + // NB: also dup 405 namespace A { struct S {}; void f(S);
Index: clang/www/cxx_dr_status.html =================================================================== --- clang/www/cxx_dr_status.html +++ clang/www/cxx_dr_status.html @@ -2470,7 +2470,7 @@ <td><a href="https://wg21.link/cwg405">405</a></td> <td>CD6</td> <td>Unqualified function name lookup</td> - <td class="none" align="center">Unknown</td> + <td class="full" align="center">Yes</td> </tr> <tr id="406"> <td><a href="https://wg21.link/cwg406">406</a></td> Index: clang/test/CXX/drs/dr4xx.cpp =================================================================== --- clang/test/CXX/drs/dr4xx.cpp +++ clang/test/CXX/drs/dr4xx.cpp @@ -3,6 +3,7 @@ // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // FIXME: __SIZE_TYPE__ expands to 'long long' on some targets. __extension__ typedef __SIZE_TYPE__ size_t; @@ -79,6 +80,40 @@ // dr404: na // (NB: also sup 594) +namespace dr405 { // dr405: yes + // NB: also dup 218 + namespace A { + struct S {}; + void f(S); + } + namespace B { + struct S {}; + void f(S); + } + + struct C { + int f; + void test1(A::S as) { f(as); } // expected-error {{called object type 'int'}} + void test2(A::S as) { void f(); f(as); } // expected-error {{too many arguments}} expected-note {{}} + void test3(A::S as) { using A::f; f(as); } // ok + void test4(A::S as) { using B::f; f(as); } // ok + void test5(A::S as) { int f; f(as); } // expected-error {{called object type 'int'}} + void test6(A::S as) { struct f {}; (void) f(as); } // expected-error {{no matching conversion}} expected-note +{{}} + }; + + namespace D { + struct S {}; + struct X { void operator()(S); } f; + } + void testD(D::S ds) { f(ds); } // expected-error {{undeclared identifier}} + + namespace E { + struct S {}; + struct f { f(S); }; + } + void testE(E::S es) { f(es); } // expected-error {{undeclared identifier}} +} + namespace dr406 { // dr406: yes typedef struct { static int n; // expected-error {{static data member 'n' not allowed in anonymous struct}} Index: clang/test/CXX/drs/dr2xx.cpp =================================================================== --- clang/test/CXX/drs/dr2xx.cpp +++ clang/test/CXX/drs/dr2xx.cpp @@ -141,6 +141,7 @@ } namespace dr218 { // dr218: yes + // NB: also dup 405 namespace A { struct S {}; void f(S);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits