1 // RUN: %clang_cc1 -std=c++20 -triple x86_64-pc-linux -ast-dump=json %s | FileCheck %s
2 // RUN: %clang_cc1 -std=c++20 -triple x86_64-pc-win32 -ast-dump=json %s | FileCheck %s -check-prefixes=CHECK,WIN32
4 // This test validates that we compute correct AST properties of classes after choosing
5 // their destructor when doing destructor overload resolution with concepts.
9 ~A() requires(N
== 1) = default;
10 ~A() requires(N
== 2) = delete;
11 ~A() requires(N
== 3);
12 constexpr ~A() requires(N
== 4);
15 ~A() requires(N
== 5) = default;
20 // CHECK: "kind": "ClassTemplateSpecializationDecl",
21 // CHECK: "definitionData": {
22 // CHECK-NEXT: "canConstDefaultInit": true,
23 // CHECK-NEXT: "canPassInRegisters": true,
24 // CHECK-NEXT: "copyAssign": {
27 // CHECK-NEXT: "irrelevant": true,
28 // CHECK-NEXT: "trivial": true,
29 // CHECK-NEXT: "userDeclared": true
31 // CHECK-NEXT: "hasConstexprNonCopyMoveConstructor": true,
32 // CHECK-NEXT: "isAggregate": true,
33 // CHECK-NEXT: "isEmpty": true,
34 // CHECK-NEXT: "isLiteral": true,
35 // CHECK-NEXT: "isStandardLayout": true,
36 // CHECK-NEXT: "isTrivial": true,
37 // CHECK-NEXT: "isTriviallyCopyable": true,
38 // CHECK-NEXT: "moveAssign": {},
39 // CHECK-NEXT: "moveCtor": {}
42 // CHECK: "kind": "ClassTemplateSpecializationDecl",
43 // CHECK: "definitionData": {
44 // CHECK-NEXT: "canConstDefaultInit": true,
45 // CHECK-NEXT: "canPassInRegisters": true,
46 // CHECK-NEXT: "copyAssign": {
49 // CHECK-NEXT: "trivial": true,
50 // CHECK-NEXT: "userDeclared": true
52 // CHECK-NEXT: "hasConstexprNonCopyMoveConstructor": true,
53 // CHECK-NEXT: "isAggregate": true,
54 // CHECK-NEXT: "isEmpty": true,
55 // CHECK-NEXT: "isStandardLayout": true,
56 // CHECK-NEXT: "isTrivial": true,
57 // CHECK-NEXT: "isTriviallyCopyable": true,
58 // CHECK-NEXT: "moveAssign": {},
59 // CHECK-NEXT: "moveCtor": {}
62 // CHECK: "kind": "ClassTemplateSpecializationDecl",
63 // CHECK: "definitionData": {
64 // CHECK-NEXT: "canConstDefaultInit": true,
65 // WIN32-NEXT: "canPassInRegisters": true,
66 // CHECK-NEXT: "copyAssign": {
69 // CHECK-NEXT: "nonTrivial": true,
70 // CHECK-NEXT: "userDeclared": true
72 // CHECK-NEXT: "hasConstexprNonCopyMoveConstructor": true,
73 // CHECK-NEXT: "isAggregate": true,
74 // CHECK-NEXT: "isEmpty": true,
75 // CHECK-NEXT: "isStandardLayout": true,
76 // CHECK-NEXT: "moveAssign": {},
77 // CHECK-NEXT: "moveCtor": {}
80 // CHECK: "kind": "ClassTemplateSpecializationDecl",
81 // CHECK: "definitionData": {
82 // CHECK-NEXT: "canConstDefaultInit": true,
83 // WIN32-NEXT: "canPassInRegisters": true,
84 // CHECK-NEXT: "copyAssign": {
87 // CHECK-NEXT: "nonTrivial": true,
88 // CHECK-NEXT: "userDeclared": true
90 // CHECK-NEXT: "hasConstexprNonCopyMoveConstructor": true,
91 // CHECK-NEXT: "isAggregate": true,
92 // CHECK-NEXT: "isEmpty": true,
93 // CHECK-NEXT: "isLiteral": true,
94 // CHECK-NEXT: "isStandardLayout": true,
95 // CHECK-NEXT: "moveAssign": {},
96 // CHECK-NEXT: "moveCtor": {}
99 // CHECK: "kind": "ClassTemplateSpecializationDecl",
100 // CHECK: "definitionData": {
101 // CHECK-NEXT: "canConstDefaultInit": true,
102 // CHECK-NEXT: "canPassInRegisters": true,
103 // CHECK-NEXT: "copyAssign": {
106 // CHECK-NEXT: "trivial": true,
107 // CHECK-NEXT: "userDeclared": true
109 // CHECK-NEXT: "hasConstexprNonCopyMoveConstructor": true,
110 // CHECK-NEXT: "isAggregate": true,
111 // CHECK-NEXT: "isEmpty": true,
112 // CHECK-NEXT: "isLiteral": true,
113 // CHECK-NEXT: "isStandardLayout": true,
114 // CHECK-NEXT: "isTrivial": true,
115 // CHECK-NEXT: "isTriviallyCopyable": true,
116 // CHECK-NEXT: "moveAssign": {},
117 // CHECK-NEXT: "moveCtor": {}