1 // RUN: %clang_cc1 -fblocks -Wno-unused-value -std=c++20 -ast-dump -verify %s -ast-dump | FileCheck %s
2 // RUN: %clang_cc1 -fblocks -Wno-unused-value -std=c++20 -ast-dump -verify %s -ast-dump -fexperimental-new-constant-interpreter | FileCheck %s
4 // expected-no-diagnostics
11 A(int v
) { this->data
= new int(v
); }
12 const int& get() const {
21 for (;A(1), P(), false;);
23 // CHECK: ExprWithCleanups
24 // CHECK-NEXT: BinaryOperator {{.*}} 'bool' ','
25 // CHECK-NEXT: BinaryOperator {{.*}} 'P' ','
26 // CHECK-NEXT: CXXFunctionalCastExpr {{.*}} 'A'
27 // CHECK-NEXT: CXXBindTemporaryExpr {{.*}} 'A'
28 // CHECK-NEXT: CXXConstructExpr {{.*}} 'A'
29 // CHECK: ConstantExpr {{.*}} 'P'
31 // CHECK-NEXT: ExprWithCleanups
36 for (; ^{ auto ptr
= &a
.get(); }(), P(), false;);
37 // CHECK: ExprWithCleanups
38 // CHECK-NEXT: cleanup Block
39 // CHECK-NEXT: BinaryOperator {{.*}} 'bool' ','
40 // CHECK-NEXT: BinaryOperator {{.*}} 'P' ','
41 // CHECK-NEXT: CallExpr
42 // CHECK-NEXT: BlockExpr
43 // CHECK: ConstantExpr {{.*}} 'P'
45 // CHECK-NEXT: ExprWithCleanups
46 // CHECK-NOT: cleanup Block
51 consteval
int get() { return *p
; }
52 constexpr ~B() { delete p
; }
57 // CHECK: ExprWithCleanups
58 // CHECK: ConstantExpr
60 // CHECK-NEXT: ExprWithCleanups