1 // RUN: %clang_cc1 -std=c++20 -verify %s
5 ~A() = delete; // expected-note {{explicitly marked deleted}}
6 ~A() requires(N
== 1) = delete; // expected-note {{explicitly marked deleted}}
9 // FIXME: We should probably make it illegal to mix virtual and non-virtual methods
10 // this way. See CWG2488 and some discussion in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105699.
13 ~B() requires(N
== 1) = delete; // expected-note {{explicitly marked deleted}}
14 virtual ~B() = delete; // expected-note {{explicitly marked deleted}}
26 ~C() = delete; // expected-note {{explicitly marked deleted}}
27 ~C() requires(CO1
<N
>) = delete;
28 ~C() requires(CO1
<N
> &&CO2
<N
>) = delete; // expected-note {{explicitly marked deleted}}
33 ~D() requires(N
!= 0) = delete; // expected-note {{explicitly marked deleted}}
34 // expected-note@-1 {{candidate function has been explicitly deleted}}
35 // expected-note@-2 {{candidate function not viable: constraints not satisfied}}
36 // expected-note@-3 {{evaluated to false}}
37 ~D() requires(N
== 1) = delete;
38 // expected-note@-1 {{candidate function has been explicitly deleted}}
39 // expected-note@-2 {{candidate function not viable: constraints not satisfied}}
40 // expected-note@-3 {{evaluated to false}}
44 concept Foo
= requires(T t
) {
52 ~E() requires Foo
<E
> = delete; // expected-note {{explicitly marked deleted}}
61 template struct D
<0>; // expected-error {{no viable destructor found for class 'D<0>'}} expected-note {{in instantiation of template}}
62 template struct D
<1>; // expected-error {{destructor of class 'D<1>' is ambiguous}} expected-note {{in instantiation of template}}
67 A
<1> a1
; // expected-error {{attempt to use a deleted function}}
68 A
<2> a2
; // expected-error {{attempt to use a deleted function}}
69 B
<1> b1
; // expected-error {{attempt to use a deleted function}}
70 B
<2> b2
; // expected-error {{attempt to use a deleted function}}
71 C
<1> c1
; // expected-error {{attempt to use a deleted function}}
72 C
<2> c2
; // expected-error {{attempt to use a deleted function}}
75 D
<2> d2
; // expected-error {{attempt to use a deleted function}}
76 E
<1> e1
; // expected-error {{attempt to use a deleted function}}