[PATCH] D142315: [clang] Add test for CWG1111

Vlad Serebrennikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 26 06:37:47 PST 2023


Endill updated this revision to Diff 492430.
Endill edited the summary of this revision.
Endill added a comment.

Move CWG2385 ("na") from D142316 <https://reviews.llvm.org/D142316> into this patch. It makes more sense to put it here, because it fixes inconsistent wording introduced by CWG1111 resolution.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142315/new/

https://reviews.llvm.org/D142315

Files:
  clang/test/CXX/drs/dr11xx.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
@@ -6473,7 +6473,7 @@
     <td><a href="https://wg21.link/cwg1111">1111</a></td>
     <td>C++11</td>
     <td>Remove dual-scope lookup of member template names</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="1112">
     <td><a href="https://wg21.link/cwg1112">1112</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>
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 {};
Index: clang/test/CXX/drs/dr11xx.cpp
===================================================================
--- clang/test/CXX/drs/dr11xx.cpp
+++ clang/test/CXX/drs/dr11xx.cpp
@@ -4,6 +4,46 @@
 // 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: yes
+namespace example1 {
+template <typename> struct set;
+
+struct X {
+  template <typename T> void set(const T &value);
+};
+void foo() {
+  X x;
+#pragma clang diagnostic push
+#if __cplusplus < 201103L
+#pragma clang diagnostic ignored "-Wambiguous-member-template"
+#endif
+  x.set<double>(3.2);
+#pragma clang diagnostic pop
+}
+
+struct Y {};
+void bar() {
+  Y y;
+  y.set<double>(3.2); // expected-error {{no member named 'set' in 'dr1111::example1::Y'}}
+}
+} // namespace example1
+
+namespace example2 {
+struct A {};
+namespace N {
+struct A {
+  void g() {}
+  template <class T> operator T();
+};
+} // namespace N
+
+void baz() {
+  N::A a;
+  a.operator A();
+}
+} // namespace example2
+} // namespace dr1111
+
 namespace dr1113 { // dr1113: partial
   namespace named {
     extern int a; // expected-note {{previous}}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142315.492430.patch
Type: text/x-patch
Size: 2387 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230126/dab3954d/attachment.bin>


More information about the cfe-commits mailing list