Endill created this revision. Endill added a reviewer: clang-language-wg. Herald added a project: All. Endill requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
P1787 <https://wg21.link/p1787>: CWG2007 is resolved by skipping unqualified lookup for operators that must be member functions. Wording: For the operators =, [], or ->, the set of non-member candidates is empty; otherwise, it includes the result of the unqualified lookup for operator@... ([over.match.oper]/3) Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D147839 Files: clang/test/CXX/drs/dr20xx.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 @@ -11849,7 +11849,7 @@ <td><a href="https://wg21.link/cwg2007">2007</a></td> <td>CD6</td> <td>Argument-dependent lookup for <TT>operator=</TT></td> - <td class="none" align="center">Unknown</td> + <td class="partial" align="center">Partial</td> </tr> <tr id="2008"> <td><a href="https://wg21.link/cwg2008">2008</a></td> Index: clang/test/CXX/drs/dr20xx.cpp =================================================================== --- clang/test/CXX/drs/dr20xx.cpp +++ clang/test/CXX/drs/dr20xx.cpp @@ -3,12 +3,23 @@ // RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -// RUN: %clang_cc1 -std=c++2a -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++2b -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors #if __cplusplus < 201103L #define static_assert(...) _Static_assert(__VA_ARGS__) #endif +namespace dr2007 { // dr2007: partial +template<typename T> struct A { typename T::error e; }; +template<typename T> struct B { }; +B<A<void> > b1; +B<A<void> > b2 = b1; +int a = b2[0]; // expected-error {{does not provide a subscript operator}} +// FIXME: the following code shouldn't instantiate A<void>. +// int b = (&b2)->foo; +} + namespace dr2026 { // dr2026: 11 template<int> struct X {};
Index: clang/www/cxx_dr_status.html =================================================================== --- clang/www/cxx_dr_status.html +++ clang/www/cxx_dr_status.html @@ -11849,7 +11849,7 @@ <td><a href="https://wg21.link/cwg2007">2007</a></td> <td>CD6</td> <td>Argument-dependent lookup for <TT>operator=</TT></td> - <td class="none" align="center">Unknown</td> + <td class="partial" align="center">Partial</td> </tr> <tr id="2008"> <td><a href="https://wg21.link/cwg2008">2008</a></td> Index: clang/test/CXX/drs/dr20xx.cpp =================================================================== --- clang/test/CXX/drs/dr20xx.cpp +++ clang/test/CXX/drs/dr20xx.cpp @@ -3,12 +3,23 @@ // RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -// RUN: %clang_cc1 -std=c++2a -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++2b -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors #if __cplusplus < 201103L #define static_assert(...) _Static_assert(__VA_ARGS__) #endif +namespace dr2007 { // dr2007: partial +template<typename T> struct A { typename T::error e; }; +template<typename T> struct B { }; +B<A<void> > b1; +B<A<void> > b2 = b1; +int a = b2[0]; // expected-error {{does not provide a subscript operator}} +// FIXME: the following code shouldn't instantiate A<void>. +// int b = (&b2)->foo; +} + namespace dr2026 { // dr2026: 11 template<int> struct X {};
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits