Author: Vlad Serebrennikov
Date: 2023-04-25T09:03:46+03:00
New Revision: 5cda0d165a752c8041e8da4d39632c001463fa30

URL: 
https://github.com/llvm/llvm-project/commit/5cda0d165a752c8041e8da4d39632c001463fa30
DIFF: 
https://github.com/llvm/llvm-project/commit/5cda0d165a752c8041e8da4d39632c001463fa30.diff

LOG: [clang] Add test for CWG1821

[[https://wg21.link/p1787 | P1787]]: My clarification in [[ 
http://lists.isocpp.org/core/2019/06/6614.php | “Where can namespace-scope 
functions and variables be redeclared?” ]] is applied, resolving CWG1821.
Wording: (If the declaration is not a friend declaration:) If the id-expression 
in a declarator-id is a qualified-id Q, let S be its lookup context; the 
declaration shall inhabit a namespace scope. ([dcl.meaning]/1)

Reviewed By: shafik, #clang-language-wg

Differential Revision: https://reviews.llvm.org/D149003

Added: 
    

Modified: 
    clang/test/CXX/drs/dr18xx.cpp
    clang/www/cxx_dr_status.html

Removed: 
    


################################################################################
diff  --git a/clang/test/CXX/drs/dr18xx.cpp b/clang/test/CXX/drs/dr18xx.cpp
index 43db6e3a95a1f..cb9d02db01c62 100644
--- a/clang/test/CXX/drs/dr18xx.cpp
+++ b/clang/test/CXX/drs/dr18xx.cpp
@@ -51,6 +51,22 @@ namespace dr1815 { // dr1815: no
 #endif
 }
 
+namespace dr1821 { // dr1821: yes
+struct A {
+  template <typename> struct B {
+    void f();
+  };
+  template <typename T> void B<T>::f(){};
+  // expected-error@-1 {{non-friend class member 'f' cannot have a qualified 
name}}
+
+  struct C {
+    void f();
+  };
+  void C::f() {}
+  // expected-error@-1 {{non-friend class member 'f' cannot have a qualified 
name}}
+};
+} // namespace dr1821
+
 namespace dr1822 { // dr1822: yes
 #if __cplusplus >= 201103L
   int a;

diff  --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html
index 29532e4e42299..6206ea6664873 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -10733,7 +10733,7 @@ <h2 id="cxxdr">C++ defect report implementation 
status</h2>
     <td><a 
href="https://cplusplus.github.io/CWG/issues/1821.html";>1821</a></td>
     <td>CD6</td>
     <td>Qualified redeclarations in a class <I>member-specification</I></td>
-    <td class="none" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="1822">
     <td><a 
href="https://cplusplus.github.io/CWG/issues/1822.html";>1822</a></td>


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to