diff --git a/clang/test/CXX/drs/dr18xx.cpp b/clang/test/CXX/drs/dr18xx.cpp index 55f79295934c8..02739cd2c0005 100644 --- a/clang/test/CXX/drs/dr18xx.cpp +++ b/clang/test/CXX/drs/dr18xx.cpp @@ -2,7 +2,8 @@ // 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++17 -triple x86_64-unknown-unknown %s -verify -fexceptions -Wno-deprecated-builtins -fcxx-exceptions -pedantic-errors -// RUN: %clang_cc1 -std=c++2a -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}} @@ -59,6 +60,43 @@ namespace dr1822 { // dr1822: yes #endif } +namespace dr1837 { // dr1837: 3.3 +#if __cplusplus >= 201103L + template + struct Fish { static const bool value = true; }; + + struct Other { + int p(); + auto q() -> decltype(p()) *; + }; + + class Outer { + friend auto Other::q() -> decltype(this->p()) *; // expected-error {{invalid use of 'this'}} + int g(); + int f() { + extern void f(decltype(this->g()) *); + struct Inner { + static_assert(Fishg())>::value, ""); // expected-error {{invalid use of 'this'}} + enum { X = Fishf())>::value }; // expected-error {{invalid use of 'this'}} + struct Inner2 : Fishg())> { }; // expected-error {{invalid use of 'this'}} + friend void f(decltype(this->g()) *); // expected-error {{invalid use of 'this'}} + friend auto Other::q() -> decltype(this->p()) *; // expected-error {{invalid use of 'this'}} + }; + return 0; + } + }; + + struct A { + int f(); + bool b = [] { + struct Local { + static_assert(sizeof(this->f()) == sizeof(int), ""); + }; + }; + }; +#endif +} + namespace dr1872 { // dr1872: 9 #if __cplusplus >= 201103L template struct A : T { diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html index 67350fa35938e..bac8a52c2d5bd 100755 --- a/clang/www/cxx_dr_status.html +++ b/clang/www/cxx_dr_status.html @@ -10829,7 +10829,7 @@

C++ defect report implementation status

1837 CD6 Use of this in friend and local class declarations - Unknown + Clang 3.3 1838