[clang] 51a07fc - [clang] Add test for CWG2396

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 13 10:53:08 PST 2023


Author: Vlad Serebrennikov
Date: 2023-02-13T21:53:00+03:00
New Revision: 51a07fc24cb909011e0b16793800aab4b93031ed

URL: https://github.com/llvm/llvm-project/commit/51a07fc24cb909011e0b16793800aab4b93031ed
DIFF: https://github.com/llvm/llvm-project/commit/51a07fc24cb909011e0b16793800aab4b93031ed.diff

LOG: [clang] Add test for CWG2396

Also mark [[ https://wg21.link/cwg1291 | CWG1291 ]] as "na".

[[ https://wg21.link/p1787 | P1787 ]]: CWG1291 and CWG2396 are resolved by explicitly specifying how to look up names in a conversion-type-id.
Wording: see changes to [basic.lookup.unqual]/5 and [basic.lookup.qual]/2.

"Calling a conversion function" example in [[ https://wg21.link/p1787 | P1787 ]] is also relevant.

Differential Revision: https://reviews.llvm.org/D142316

Added: 
    

Modified: 
    clang/test/CXX/drs/dr12xx.cpp
    clang/test/CXX/drs/dr23xx.cpp
    clang/www/cxx_dr_status.html

Removed: 
    


################################################################################
diff  --git a/clang/test/CXX/drs/dr12xx.cpp b/clang/test/CXX/drs/dr12xx.cpp
index dcc131104e7bd..9f09ff1f698e5 100644
--- a/clang/test/CXX/drs/dr12xx.cpp
+++ b/clang/test/CXX/drs/dr12xx.cpp
@@ -68,6 +68,8 @@ namespace dr1265 { // dr1265: 5
 #endif
 }
 
+// dr1291: na
+
 namespace dr1295 { // dr1295: 4
   struct X {
     unsigned bitfield : 4;

diff  --git a/clang/test/CXX/drs/dr23xx.cpp b/clang/test/CXX/drs/dr23xx.cpp
index 59e1f27491d26..a60aa8e5609c6 100644
--- a/clang/test/CXX/drs/dr23xx.cpp
+++ b/clang/test/CXX/drs/dr23xx.cpp
@@ -181,3 +181,19 @@ struct B { const A a; };
 B b;
 
 }
+
+namespace dr2396 { // dr2396: no
+  struct A {
+    struct B;
+    operator B B::*();
+  };
+  struct B;
+
+  // FIXME: per P1787 "Calling a conversion function" example, all of the
+  // examples below are well-formed, with B resolving to A::B, but currently
+  // it's been resolved to dr2396::B. 
+
+  // void f(A a) { a.operator B B::*(); }            
+  // void g(A a) { a.operator decltype(B()) B::*(); }
+  // void g2(A a) { a.operator B decltype(B())::*(); }
+}

diff  --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html
index 8123c476abb8c..fdf8e6b4baeb1 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -7553,7 +7553,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://wg21.link/cwg1291">1291</a></td>
     <td>CD6</td>
     <td>Looking up a <I>conversion-type-id</I></td>
-    <td class="none" align="center">Unknown</td>
+    <td class="na" align="center">N/A</td>
   </tr>
   <tr id="1292">
     <td><a href="https://wg21.link/cwg1292">1292</a></td>
@@ -14183,7 +14183,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://wg21.link/cwg2396">2396</a></td>
     <td>CD6</td>
     <td>Lookup of names in complex <I>conversion-type-id</I>s</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="none" align="center">No</td>
   </tr>
   <tr id="2397">
     <td><a href="https://wg21.link/cwg2397">2397</a></td>


        


More information about the cfe-commits mailing list