| 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
|---|---|
| 2 | // Don't crash. |
| 3 | |
| 4 | struct g { |
| 5 | j; // expected-error {{C++ requires a type specifier for all declarations}} |
| 6 | }; |
| 7 | |
| 8 | void captures_invalid_type() { |
| 9 | g child; |
| 10 | auto q = [child]{}; |
| 11 | const int n = sizeof(q); |
| 12 | } |
| 13 | |
| 14 | void captures_invalid_array_type() { |
| 15 | g child[100]; |
| 16 | auto q = [child]{}; |
| 17 | const int n = sizeof(q); |
| 18 | } |
| 19 |