1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -std=c++17 -fsyntax-only -verify %s
3 // RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s
8 Y::~Y() { } // expected-error{{non-friend class member '~Y' cannot have a qualified name}}
9 ~Z(); // expected-error{{expected the class name after '~' to name the enclosing class}}
18 #if __cplusplus >= 202002L
19 // FIXME: This isn't valid in C++20 and later.
26 ~B(); // expected-error {{expected the class name after '~' to name the enclosing class}}
33 static constexpr int secret
= 42;
41 struct BadInstantiation
{
47 struct GoodInstantiation
{
54 // FIXME: We should diagnose this while instantiating.
55 E
<BadInstantiation
> x
;
56 E
<GoodInstantiation
> y
;
73 friend X::~Y(); // expected-error {{expected the class name after '~' to name the enclosing class}}
78 friend X::~Y(); // expected-error {{expected the class name after '~' to name the enclosing class}}