| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify -std=c23 %s |
| 2 |
|
| 3 |
// This was previously causing a stack overflow when checking the valid |
| 4 |
// declaration of an invalid type. Ensure we issue reasonable diagnostics |
| 5 |
// instead of crashing. |
| 6 |
struct GH140887 { // expected-note {{definition of 'struct GH140887' is not complete until the closing '}'}} |
| 7 |
GH140887(); // expected-error {{must use 'struct' tag to refer to type 'GH140887'}} \ |
| 8 |
expected-error {{expected member name or ';' after declaration specifiers}} \ |
| 9 |
expected-error {{field has incomplete type 'struct GH140887'}} |
| 10 |
}; |
| 11 |
constexpr struct GH140887 a; // expected-error {{constexpr variable 'a' must be initialized by a constant expression}} |
| 12 |
|