Skip to content

Commit 779cde1

Browse files
committed
[AST][test] Add regression test forPointerExprEvaluator::VisitCXXNewExpr
This assert was failing: assert(CAT && "unexpected type for array initializer"); until this patch landed: 9a7eda1 PR45350: Handle unsized array CXXConstructExprs in constant evaluation
1 parent 2964fdf commit 779cde1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only %s
2+
3+
struct Bar {int a;};
4+
const Bar arr[2] = {{1}};
5+
6+
struct Foo {};
7+
8+
const int b = 2;
9+
10+
void foo(int a) {
11+
Foo *foo_array;
12+
foo_array = new Foo[arr[0].a];
13+
}

0 commit comments

Comments
 (0)