Update status of WG21 DR1042
authorAaron Ballman <aaron@aaronballman.com>
Mon, 6 Feb 2023 13:34:31 +0000 (08:34 -0500)
committerAaron Ballman <aaron@aaronballman.com>
Mon, 6 Feb 2023 13:34:31 +0000 (08:34 -0500)
We've supported attributes on alias declarations at least as far back
as Clang 3.5 from my testing. This also updates the RUN lines to test
the newer language modes as well.

clang/test/CXX/drs/dr10xx.cpp
clang/www/cxx_dr_status.html

index f629280..4d49a18 100644 (file)
@@ -1,7 +1,9 @@
 // RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
-// RUN: %clang_cc1 -std=c++1z %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
 
 namespace std {
   __extension__ typedef __SIZE_TYPE__ size_t;
@@ -83,3 +85,16 @@ namespace dr1070 { // dr1070: 3.5
   C c = {};
 #endif
 }
+
+namespace dr1042 { // dr1042: 3.5
+#if __cplusplus >= 201402L
+  // C++14 added an attribute that we can test the semantics of.
+  using foo [[deprecated]] = int; // expected-note {{'foo' has been explicitly marked deprecated here}}
+  foo f = 12; // expected-warning {{'foo' is deprecated}}
+#elif __cplusplus >= 201103L
+  // C++11 did not have any attributes that could be applied to an alias
+  // declaration, so the best we can test is that we accept an empty attribute
+  // list in this mode.
+  using foo [[]] = int;
+#endif
+}
index b54c65e..dbd4e34 100755 (executable)
@@ -6059,7 +6059,7 @@ and <I>POD class</I></td>
     <td><a href="https://wg21.link/cwg1042">1042</a></td>
     <td>C++11</td>
     <td>Attributes in <I>alias-declaration</I>s</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">3.5</td>
   </tr>
   <tr id="1043">
     <td><a href="https://wg21.link/cwg1043">1043</a></td>