This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG85452b5f9b5a: [clang] Add tests for CWG issues 977, 1482, 
2516 (authored by Endill).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151042

Files:
  clang/test/CXX/drs/dr14xx.cpp
  clang/test/CXX/drs/dr25xx.cpp
  clang/test/CXX/drs/dr9xx.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
@@ -5669,7 +5669,7 @@
     <td><a href="https://cplusplus.github.io/CWG/issues/977.html";>977</a></td>
     <td>CD3</td>
     <td>When is an enumeration type complete?</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="978">
     <td><a href="https://cplusplus.github.io/CWG/issues/978.html";>978</a></td>
@@ -8699,7 +8699,7 @@
     <td><a 
href="https://cplusplus.github.io/CWG/issues/1482.html";>1482</a></td>
     <td>CD3</td>
     <td>Point of declaration of enumeration</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="1483">
     <td><a 
href="https://cplusplus.github.io/CWG/issues/1483.html";>1483</a></td>
@@ -14903,7 +14903,7 @@
     <td><a 
href="https://cplusplus.github.io/CWG/issues/2516.html";>2516</a></td>
     <td>DR</td>
     <td>Locus of <I>enum-specifier</I> or <I>opaque-enum-declaration</I></td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="2517">
     <td><a 
href="https://cplusplus.github.io/CWG/issues/2517.html";>2517</a></td>
Index: clang/test/CXX/drs/dr9xx.cpp
===================================================================
--- clang/test/CXX/drs/dr9xx.cpp
+++ clang/test/CXX/drs/dr9xx.cpp
@@ -90,6 +90,17 @@
 #endif
 }
 
+namespace dr977 { // dr977: yes
+enum E { e = E() };
+// expected-error@-1 {{invalid use of incomplete type 'E'}}
+// expected-note@-2 {{definition of 'dr977::E' is not complete until the 
closing '}'}}
+#if __cplusplus >= 201103L
+enum E2 : int { e2 = E2() };
+enum struct E3 { e = static_cast<int>(E3()) };
+enum struct E4 : int { e = static_cast<int>(E4()) };
+#endif
+} // namespace dr977
+
 namespace dr990 { // dr990: 3.5
 #if __cplusplus >= 201103L
   struct A { // expected-note 2{{candidate}}
Index: clang/test/CXX/drs/dr25xx.cpp
===================================================================
--- clang/test/CXX/drs/dr25xx.cpp
+++ clang/test/CXX/drs/dr25xx.cpp
@@ -1,5 +1,16 @@
 // RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify
 
+namespace dr2516 { // dr2516: yes
+                   // NB: reusing 1482 test
+#if __cplusplus >= 201103L
+template <typename T> struct S {
+  typedef char I;
+};
+enum E2 : S<E2>::I { e };
+// expected-error@-1 {{use of undeclared identifier 'E2'}}
+#endif
+} // namespace dr2516
+
 namespace dr2518 { // dr2518: 17
 
 template <class T>
Index: clang/test/CXX/drs/dr14xx.cpp
===================================================================
--- clang/test/CXX/drs/dr14xx.cpp
+++ clang/test/CXX/drs/dr14xx.cpp
@@ -488,6 +488,17 @@
   int operator"" _a(const char*, std::size_t = 0); // expected-error {{literal 
operator cannot have a default argument}}
 }
 
+namespace dr1482 { // dr1482: yes
+                   // NB: sup 2516, test reused there
+#if __cplusplus >= 201103L
+template <typename T> struct S {
+  typedef char I;
+};
+enum E2 : S<E2>::I { e };
+// expected-error@-1 {{use of undeclared identifier 'E2'}}
+#endif
+} // namespace dr1482
+
 namespace dr1490 {  // dr1490: 3.7 c++11
   // List-initialization from a string literal
 


Index: clang/www/cxx_dr_status.html
===================================================================
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -5669,7 +5669,7 @@
     <td><a href="https://cplusplus.github.io/CWG/issues/977.html";>977</a></td>
     <td>CD3</td>
     <td>When is an enumeration type complete?</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="978">
     <td><a href="https://cplusplus.github.io/CWG/issues/978.html";>978</a></td>
@@ -8699,7 +8699,7 @@
     <td><a href="https://cplusplus.github.io/CWG/issues/1482.html";>1482</a></td>
     <td>CD3</td>
     <td>Point of declaration of enumeration</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="1483">
     <td><a href="https://cplusplus.github.io/CWG/issues/1483.html";>1483</a></td>
@@ -14903,7 +14903,7 @@
     <td><a href="https://cplusplus.github.io/CWG/issues/2516.html";>2516</a></td>
     <td>DR</td>
     <td>Locus of <I>enum-specifier</I> or <I>opaque-enum-declaration</I></td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="2517">
     <td><a href="https://cplusplus.github.io/CWG/issues/2517.html";>2517</a></td>
Index: clang/test/CXX/drs/dr9xx.cpp
===================================================================
--- clang/test/CXX/drs/dr9xx.cpp
+++ clang/test/CXX/drs/dr9xx.cpp
@@ -90,6 +90,17 @@
 #endif
 }
 
+namespace dr977 { // dr977: yes
+enum E { e = E() };
+// expected-error@-1 {{invalid use of incomplete type 'E'}}
+// expected-note@-2 {{definition of 'dr977::E' is not complete until the closing '}'}}
+#if __cplusplus >= 201103L
+enum E2 : int { e2 = E2() };
+enum struct E3 { e = static_cast<int>(E3()) };
+enum struct E4 : int { e = static_cast<int>(E4()) };
+#endif
+} // namespace dr977
+
 namespace dr990 { // dr990: 3.5
 #if __cplusplus >= 201103L
   struct A { // expected-note 2{{candidate}}
Index: clang/test/CXX/drs/dr25xx.cpp
===================================================================
--- clang/test/CXX/drs/dr25xx.cpp
+++ clang/test/CXX/drs/dr25xx.cpp
@@ -1,5 +1,16 @@
 // RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify
 
+namespace dr2516 { // dr2516: yes
+                   // NB: reusing 1482 test
+#if __cplusplus >= 201103L
+template <typename T> struct S {
+  typedef char I;
+};
+enum E2 : S<E2>::I { e };
+// expected-error@-1 {{use of undeclared identifier 'E2'}}
+#endif
+} // namespace dr2516
+
 namespace dr2518 { // dr2518: 17
 
 template <class T>
Index: clang/test/CXX/drs/dr14xx.cpp
===================================================================
--- clang/test/CXX/drs/dr14xx.cpp
+++ clang/test/CXX/drs/dr14xx.cpp
@@ -488,6 +488,17 @@
   int operator"" _a(const char*, std::size_t = 0); // expected-error {{literal operator cannot have a default argument}}
 }
 
+namespace dr1482 { // dr1482: yes
+                   // NB: sup 2516, test reused there
+#if __cplusplus >= 201103L
+template <typename T> struct S {
+  typedef char I;
+};
+enum E2 : S<E2>::I { e };
+// expected-error@-1 {{use of undeclared identifier 'E2'}}
+#endif
+} // namespace dr1482
+
 namespace dr1490 {  // dr1490: 3.7 c++11
   // List-initialization from a string literal
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to