diff --git a/clang/test/CXX/drs/dr18xx.cpp b/clang/test/CXX/drs/dr18xx.cpp --- a/clang/test/CXX/drs/dr18xx.cpp +++ b/clang/test/CXX/drs/dr18xx.cpp @@ -168,3 +168,60 @@ b = static_cast(b); // expected-error {{copy assignment operator is implicitly deleted}} #endif } + +namespace dr1894 { // dr1894: 3.8 + // NB: reusing dr407 test + struct S; + typedef struct S S; + void f() { + struct S *p; + { + typedef struct S S; // #dr1894-typedef-S-S + struct S *p; + // expected-error@-1 {{typedef 'S' cannot be referenced with a struct specifier}} + // expected-note@#dr1894-typedef-S-S {{here}} + } + } + struct S {}; + + namespace UsingDir { + namespace A { + struct S {}; // #dr1894-struct-S + } + namespace B { + typedef int S; // #dr1894-typedef-int-S + } + namespace C { + using namespace A; + using namespace B; + struct S s; + // expected-error@-1 {{ambiguous}} + // expected-note@#dr1894-struct-S {{candidate}} + // expected-note@#dr1894-typedef-int-S {{candidate}} + } + namespace D { + using A::S; + typedef struct S S; + struct S s; + } + namespace E { + typedef A::S S; + using A::S; + struct S s; + } + namespace F { + typedef A::S S; + } + + namespace G { + using namespace A; + using namespace F; + struct S s; + } + namespace H { + using namespace F; + using namespace A; + struct S s; + } + } +} diff --git a/clang/test/CXX/drs/dr21xx.cpp b/clang/test/CXX/drs/dr21xx.cpp --- a/clang/test/CXX/drs/dr21xx.cpp +++ b/clang/test/CXX/drs/dr21xx.cpp @@ -1,7 +1,9 @@ // RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors // RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors -// RUN: %clang_cc1 -std=c++1z -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors +// RUN: %clang_cc1 -std=c++2b -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors #if __cplusplus < 201103L // expected-error@+1 {{variadic macro}} @@ -188,3 +190,60 @@ B &B::operator=(B&&) = default; // expected-error {{would delete}} expected-note@-10{{inaccessible move assignment}} #endif } + +namespace dr2199 { // dr2199: 3.8 + // NB: reusing dr407 test + struct S; + typedef struct S S; + void f() { + struct S *p; + { + typedef struct S S; // #dr2199-typedef-S-S + struct S *p; + // expected-error@-1 {{typedef 'S' cannot be referenced with a struct specifier}} + // expected-note@#dr2199-typedef-S-S {{here}} + } + } + struct S {}; + + namespace UsingDir { + namespace A { + struct S {}; // #dr2199-struct-S + } + namespace B { + typedef int S; // #dr2199-typedef-int-S + } + namespace C { + using namespace A; + using namespace B; + struct S s; + // expected-error@-1 {{ambiguous}} + // expected-note@#dr2199-struct-S {{candidate}} + // expected-note@#dr2199-typedef-int-S {{candidate}} + } + namespace D { + using A::S; + typedef struct S S; + struct S s; + } + namespace E { + typedef A::S S; + using A::S; + struct S s; + } + namespace F { + typedef A::S S; + } + + namespace G { + using namespace A; + using namespace F; + struct S s; + } + namespace H { + using namespace F; + using namespace A; + struct S s; + } + } +} diff --git a/clang/test/CXX/drs/dr4xx.cpp b/clang/test/CXX/drs/dr4xx.cpp --- a/clang/test/CXX/drs/dr4xx.cpp +++ b/clang/test/CXX/drs/dr4xx.cpp @@ -124,6 +124,7 @@ } namespace dr407 { // dr407: 3.8 + // NB: reused by dr1894 and dr2199 struct S; typedef struct S S; void f() { diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html --- a/clang/www/cxx_dr_status.html +++ b/clang/www/cxx_dr_status.html @@ -11171,7 +11171,7 @@