[PATCH] D142316: [clang] Add test for CWG2396

Vlad Serebrennikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 22 11:53:15 PST 2023


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.

Also mark CWG1291 and CWG2385 as "na".

P1787 <https://reviews.llvm.org/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 P1787 <https://reviews.llvm.org/P1787> is also relevant.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142316

Files:
  clang/test/CXX/drs/dr12xx.cpp
  clang/test/CXX/drs/dr23xx.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
@@ -7553,7 +7553,7 @@
     <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>
@@ -14117,7 +14117,7 @@
     <td><a href="https://wg21.link/cwg2385">2385</a></td>
     <td>CD5</td>
     <td>Lookup for <I>conversion-function-id</I>s</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="na" align="center">N/A</td>
   </tr>
   <tr id="2386">
     <td><a href="https://wg21.link/cwg2386">2386</a></td>
@@ -14183,7 +14183,7 @@
     <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>
Index: clang/test/CXX/drs/dr23xx.cpp
===================================================================
--- clang/test/CXX/drs/dr23xx.cpp
+++ clang/test/CXX/drs/dr23xx.cpp
@@ -169,6 +169,8 @@
 } //namespace dr2303
 #endif
 
+// dr2385: na
+
 namespace dr2394 { // dr2394: 15
 
 struct A {};
@@ -179,3 +181,26 @@
 B b;
 
 }
+
+namespace dr2396 { // dr2396: no
+  template<typename T>
+  struct identity {
+    typedef T type;
+  };
+
+  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())::*(); }
+  // void h(A a) { a.operator identity<B>::type B::*(); }  
+  // void h2(A a) { a.operator B identity<B>::type::*(); } 
+}
Index: clang/test/CXX/drs/dr12xx.cpp
===================================================================
--- clang/test/CXX/drs/dr12xx.cpp
+++ clang/test/CXX/drs/dr12xx.cpp
@@ -68,6 +68,8 @@
 #endif
 }
 
+// dr1291: na
+
 namespace dr1295 { // dr1295: 4
   struct X {
     unsigned bitfield : 4;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142316.491195.patch
Type: text/x-patch
Size: 2479 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230122/a2cb5bce/attachment.bin>


More information about the cfe-commits mailing list