aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlad Serebrennikov <serebrennikov.vladislav@gmail.com>2023-04-25 09:03:14 +0300
committerVlad Serebrennikov <serebrennikov.vladislav@gmail.com>2023-04-25 09:03:46 +0300
commit5cda0d165a752c8041e8da4d39632c001463fa30 (patch)
tree36ab1df0a4d5828afcc2566183fdf5a8bb66d1f6
parent68dd51421f16f1e17cd453cb1730fcca99a6cfb7 (diff)
downloadllvm-5cda0d165a752c8041e8da4d39632c001463fa30.tar.gz
llvm-5cda0d165a752c8041e8da4d39632c001463fa30.tar.bz2
llvm-5cda0d165a752c8041e8da4d39632c001463fa30.zip
[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
-rw-r--r--clang/test/CXX/drs/dr18xx.cpp16
-rwxr-xr-xclang/www/cxx_dr_status.html2
2 files changed, 17 insertions, 1 deletions
diff --git a/clang/test/CXX/drs/dr18xx.cpp b/clang/test/CXX/drs/dr18xx.cpp
index 43db6e3a95a1..cb9d02db01c6 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 29532e4e4229..6206ea666487 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -10733,7 +10733,7 @@ and <I>POD class</I></td>
<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>