1 // RUN: %clang_cc1 -fblocks -Wno-unused-value -std=c++20 -ast-dump -verify %s -ast-dump | FileCheck %s
3 // expected-no-diagnostics
10 A(int v
) { this->data
= new int(v
); }
11 const int& get() const {
20 for (;A(1), P(), false;);
22 // CHECK: ExprWithCleanups
23 // CHECK-NEXT: BinaryOperator {{.*}} 'bool' ','
24 // CHECK-NEXT: BinaryOperator {{.*}} 'P' ','
25 // CHECK-NEXT: CXXFunctionalCastExpr {{.*}} 'A'
26 // CHECK-NEXT: CXXBindTemporaryExpr {{.*}} 'A'
27 // CHECK-NEXT: CXXConstructExpr {{.*}} 'A'
28 // CHECK: ConstantExpr {{.*}} 'P'
30 // CHECK-NEXT: ExprWithCleanups
35 for (; ^{ auto ptr
= &a
.get(); }(), P(), false;);
36 // CHECK: ExprWithCleanups
37 // CHECK-NEXT: cleanup Block
38 // CHECK-NEXT: BinaryOperator {{.*}} 'bool' ','
39 // CHECK-NEXT: BinaryOperator {{.*}} 'P' ','
40 // CHECK-NEXT: CallExpr
41 // CHECK-NEXT: BlockExpr
42 // CHECK: ConstantExpr {{.*}} 'P'
44 // CHECK-NEXT: ExprWithCleanups
45 // CHECK-NOT: cleanup Block
50 consteval
int get() { return *p
; }
51 constexpr ~B() { delete p
; }
56 // CHECK: ExprWithCleanups
57 // CHECK: ConstantExpr
59 // CHECK-NEXT: ExprWithCleanups