diff --git a/clang/test/CXX/drs/dr15xx.cpp b/clang/test/CXX/drs/dr15xx.cpp index 195c0fa610d57..6e3ad41c748fb 100644 --- a/clang/test/CXX/drs/dr15xx.cpp +++ b/clang/test/CXX/drs/dr15xx.cpp @@ -555,7 +555,7 @@ auto DR1579_lambda_invalid = []() -> GenericMoveOnly { #endif } // end namespace dr1579 -namespace dr1584 { +namespace dr1584 { // dr1584: 7 drafting 2015-05 #if __cplusplus >= 201103L // Deducing function types from cv-qualified types template void f(const T *); // #dr1584-f diff --git a/clang/test/CXX/drs/dr19xx.cpp b/clang/test/CXX/drs/dr19xx.cpp index 716b1476831ed..f8c1581f08540 100644 --- a/clang/test/CXX/drs/dr19xx.cpp +++ b/clang/test/CXX/drs/dr19xx.cpp @@ -34,7 +34,7 @@ namespace dr1902 { // dr1902: 3.7 #endif } -namespace dr1903 { +namespace dr1903 { // dr1903: 2.7 namespace A { struct a {}; int a; diff --git a/clang/test/CXX/drs/dr3xx.cpp b/clang/test/CXX/drs/dr3xx.cpp index 483ebf7a08aad..d5cfebccf8134 100644 --- a/clang/test/CXX/drs/dr3xx.cpp +++ b/clang/test/CXX/drs/dr3xx.cpp @@ -1568,6 +1568,25 @@ namespace dr391 { // dr391: 2.8 c++11 } // dr392 is in dr392.cpp + +namespace dr393 { // dr393: 2.7 +template +struct S {}; + +void f1(S); +void f2(S); +void g(int(*S::*)[]); + +template +void sp_assert_convertible( T* ) {} + +template +void h() { + T (*p) [] = (U(*)[])0; + sp_assert_convertible( (U(*)[])0 ); +} +} // namespace dr393 + // dr394: na namespace dr395 { // dr395: 3.0 diff --git a/clang/test/CXX/drs/dr4xx.cpp b/clang/test/CXX/drs/dr4xx.cpp index 34dd638c1d9b0..9b7a9777202f2 100644 --- a/clang/test/CXX/drs/dr4xx.cpp +++ b/clang/test/CXX/drs/dr4xx.cpp @@ -2,8 +2,9 @@ // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++11 %s -verify=expected,cxx98-14,cxx98-17,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++14 %s -verify=expected,cxx98-14,cxx98-17,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++17 %s -verify=expected,since-cxx17,cxx98-17,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors -// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++20 %s -verify=expected,since-cxx17,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors -// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++23 %s -verify=expected,since-cxx17,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++20 %s -verify=expected,since-cxx20,since-cxx17,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++23 %s -verify=expected,since-cxx20,since-cxx17,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors +// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %clang_cc1 -std=c++2c %s -verify=expected,since-cxx20,since-cxx17,since-cxx11 -fexceptions -fcxx-exceptions -pedantic-errors // FIXME: __SIZE_TYPE__ expands to 'long long' on some targets. __extension__ typedef __SIZE_TYPE__ size_t; @@ -949,33 +950,34 @@ namespace dr460 { // dr460: yes // dr465: na namespace dr466 { // dr466: 2.8 - typedef int I; - typedef const int CI; - typedef volatile int VI; - void f(int *a, CI *b, VI *c) { - a->~I(); - a->~CI(); - a->~VI(); - a->I::~I(); - a->CI::~CI(); - a->VI::~VI(); - - a->CI::~VI(); // allowed by changes to [expr.id.prim.qual]/2 introduced in P1131R2 - - b->~I(); - b->~CI(); - b->~VI(); - b->I::~I(); - b->CI::~CI(); - b->VI::~VI(); - - c->~I(); - c->~CI(); - c->~VI(); - c->I::~I(); - c->CI::~CI(); - c->VI::~VI(); - } +typedef int I; +typedef const int CI; +typedef volatile int VI; +void g(int a, CI b, VI c) { +// since-cxx20-warning@-1 {{volatile-qualified parameter type 'VI' (aka 'volatile int') is deprecated}} + a.~I(); + a.~CI(); + a.~VI(); + a.I::~I(); + a.CI::~CI(); + a.VI::~VI(); + + a.CI::~VI(); // allowed by changes to [expr.id.prim.qual]/2 introduced in P1131R2 + + b.~I(); + b.~CI(); + b.~VI(); + b.I::~I(); + b.CI::~CI(); + b.VI::~VI(); + + c.~I(); + c.~CI(); + c.~VI(); + c.I::~I(); + c.CI::~CI(); + c.VI::~VI(); +} } namespace dr467 { // dr467: yes diff --git a/clang/test/CXX/drs/dr5xx.cpp b/clang/test/CXX/drs/dr5xx.cpp index 0ea306a041167..d473f4827455c 100644 --- a/clang/test/CXX/drs/dr5xx.cpp +++ b/clang/test/CXX/drs/dr5xx.cpp @@ -18,6 +18,10 @@ namespace std { void *operator new(size_t, std::align_val_t); // #dr5xx-global-operator-new-aligned #endif +namespace std { + struct type_info; +} + namespace dr500 { // dr500: dup 372 class D; class A { @@ -265,6 +269,18 @@ namespace dr527 { // dr527: na int ax = a.x, bx = b.x, cx = c.x, dx = d.x, ex = E::e->x, fx = F::f->x; } +namespace dr528 { // dr528: 2.7 + +struct S; // #dr528-S + +void f() { + typeid(S); + // expected-error@-1 {{'typeid' of incomplete type 'S'}} + // expected-note@#dr528-S {{forward declaration of 'dr528::S'}} +} + +} // namespace dr528 + namespace dr530 { // dr530: yes template struct S { enum { N = 1 }; }; template struct T { enum { N = 1 }; }; @@ -618,6 +634,8 @@ namespace dr548 { // dr548: dup 482 template void dr548::f(); } +// dr550: dup 393 + namespace dr551 { // dr551: yes c++11 // FIXME: This obviously should apply in C++98 mode too. template void f() {} @@ -641,6 +659,7 @@ namespace dr552 { // dr552: yes X x; } +// dr553: 2.7 struct dr553_class { friend void *operator new(size_t, dr553_class); }; @@ -661,6 +680,62 @@ namespace dr553 { } // dr554: na + +namespace dr555 { // dr555: 2.8 +typedef int I; +typedef const int CI; +typedef volatile int VI; +void f(int *a, CI *b, VI *c) { + a->~I(); + a->~CI(); + a->~VI(); + a->I::~I(); + a->CI::~CI(); + a->VI::~VI(); + + a->CI::~VI(); // allowed by changes to [expr.id.prim.qual]/2 introduced in P1131R2 + + b->~I(); + b->~CI(); + b->~VI(); + b->I::~I(); + b->CI::~CI(); + b->VI::~VI(); + + c->~I(); + c->~CI(); + c->~VI(); + c->I::~I(); + c->CI::~CI(); + c->VI::~VI(); +} + +void g(int &a, CI &b, VI &c) { + a.~I(); + a.~CI(); + a.~VI(); + a.I::~I(); + a.CI::~CI(); + a.VI::~VI(); + + a.CI::~VI(); // allowed by changes to [expr.id.prim.qual]/2 introduced in P1131R2 + + b.~I(); + b.~CI(); + b.~VI(); + b.I::~I(); + b.CI::~CI(); + b.VI::~VI(); + + c.~I(); + c.~CI(); + c.~VI(); + c.I::~I(); + c.CI::~CI(); + c.VI::~VI(); +} +} // namespace dr555 + // dr556: na namespace dr557 { // dr557: 3.1 @@ -689,6 +764,20 @@ namespace dr558 { // dr558: 2.9 template struct dr559 { typedef int T; dr559::T u; }; // dr559: yes +namespace dr560 { // dr560: 16 + +template +struct Outer { + struct Inner { + Inner* self(); + }; +}; +template +Outer::Inner* Outer::Inner::self() { return this; } +// cxx98-17-error@-1 {{missing 'typename' prior to dependent type name Outer::Inner; implicit 'typename' is a C++20 extension}} + +} // namespace dr560 + namespace dr561 { // dr561: yes template void f(int); template void g(T t) { diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html index 6daa5ad2d1316..83b71e7c122d1 100755 --- a/clang/www/cxx_dr_status.html +++ b/clang/www/cxx_dr_status.html @@ -2398,7 +2398,7 @@

C++ defect report implementation status

393 CD4 Pointer to array of unknown bound in template argument list in parameter - Unknown + Clang 2.7 394 @@ -3208,7 +3208,7 @@

C++ defect report implementation status

528 NAD Why are incomplete class types not allowed with typeid? - Unknown + Clang 2.7 529 @@ -3342,7 +3342,7 @@

C++ defect report implementation status

550 dup Pointer to array of unknown bound in parameter declarations - Unknown + Duplicate of 393 551 @@ -3360,7 +3360,7 @@

C++ defect report implementation status

553 NAD Problems with friend allocation and deallocation functions - Unknown + Clang 2.7 554 @@ -3372,7 +3372,7 @@

C++ defect report implementation status

555 CD5 Pseudo-destructor name lookup - Unknown + Clang 2.8 556 @@ -3402,7 +3402,7 @@

C++ defect report implementation status

560 NAD Use of the typename keyword in return types - Unknown + Clang 16 561 @@ -9312,7 +9312,7 @@

C++ defect report implementation status

1584 drafting Deducing function types from cv-qualified types - Not resolved + Not Resolved* 1585 @@ -11226,7 +11226,7 @@

C++ defect report implementation status

1903 CD4 What declarations are introduced by a non-member using-declaration? - Unknown + Clang 2.7 1904