[PATCH] D138822: [clang] Add test for CWG36

Vlad Serebrennikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 28 11:39:17 PST 2022


Endill updated this revision to Diff 478303.
Endill added a comment.

Incorporate D138835 <https://reviews.llvm.org/D138835> (correctly this time around)


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

https://reviews.llvm.org/D138822

Files:
  clang/test/CXX/drs/dr0xx.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
@@ -254,7 +254,7 @@
     <td><a href="https://wg21.link/cwg36">36</a></td>
     <td>CD6</td>
     <td><I>using-declaration</I>s in multiple-declaration contexts</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="37">
     <td><a href="https://wg21.link/cwg37">37</a></td>
Index: clang/test/CXX/drs/dr0xx.cpp
===================================================================
--- clang/test/CXX/drs/dr0xx.cpp
+++ clang/test/CXX/drs/dr0xx.cpp
@@ -2,6 +2,8 @@
 // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
 // RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
+// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
 
 namespace dr1 { // dr1: no
   namespace X { extern "C" void dr1_f(int a = 1); }
@@ -448,6 +450,50 @@
 
 // dr34: na
 // dr35: dup 178
+
+namespace dr36 { // dr36: yes
+namespace example1 {
+  namespace A {
+    int i;
+  }
+  
+  namespace A1 {
+    using A::i;
+    using A::i;
+  }
+  
+  void f()
+  {
+    using A::i;
+    using A::i;
+  }
+}
+
+namespace example2 {
+  struct A
+  {
+    int i;
+    static int j;
+  };
+
+  struct B : A { };
+  struct C : A { };
+
+  struct D : virtual B, virtual C
+  {
+    using B::i; // expected-note {{previous using declaration}}
+    using C::i; // expected-note {{previous using declaration}}
+    using B::j; // expected-note {{previous using declaration}}
+    using C::j; // expected-note {{previous using declaration}}
+
+    using B::i; // expected-error {{redeclaration of using declaration}}
+    using C::i; // expected-error {{redeclaration of using declaration}}
+    using B::j; // expected-error {{redeclaration of using declaration}}
+    using C::j; // expected-error {{redeclaration of using declaration}}
+  };
+}
+}
+
 // dr37: sup 475
 
 namespace dr38 { // dr38: yes
@@ -699,6 +745,8 @@
 }
 
 namespace dr59 { // dr59: yes
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-volatile"
   template<typename T> struct convert_to { operator T() const; };
   struct A {}; // expected-note 5+{{candidate}}
   struct B : A {}; // expected-note 0+{{candidate}}
@@ -732,6 +780,7 @@
   int n3 = convert_to<const int>();
   int n4 = convert_to<const volatile int>();
   int n5 = convert_to<const volatile int&>();
+#pragma clang diagnostic pop
 }
 
 namespace dr60 { // dr60: yes


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138822.478303.patch
Type: text/x-patch
Size: 2950 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221128/edce2edf/attachment.bin>


More information about the cfe-commits mailing list