summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/lambda-invalid-capture.cpp
blob: 32349704caa2031626a02c9bd00dd890b73d5099 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// RUN: %clang_cc1 -fsyntax-only -verify %s
// Don't crash.

struct g {
  j; // expected-error {{C++ requires a type specifier for all declarations}}
};

void captures_invalid_type() {
  g child;
  auto q = [child]{};
  const int n = sizeof(q);
}

void captures_invalid_array_type() {
  g child[100];
  auto q = [child]{};
  const int n = sizeof(q);
}
OpenPOWER on IntegriCloud