aboutsummaryrefslogtreecommitdiff
path: root/clang/test/AST/regression-new-expr-crash.cpp
blob: e1d93f92a125b21a3e98f3b9cb084c69a4feffab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -verify %s

struct Bar {int a;};
const Bar arr[2] = {{1}};

struct Foo {};

const int b = 2;

void foo(int a) {
  Foo *foo_array;
  foo_array = new Foo[arr[0].a];
}

void Test(int N) {
  int arr[N];
  decltype([&arr]{}) *p; // expected-error {{lambda expression in an unevaluated operand}}
}