13 lines · c
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c23 %s2 3// This was previously causing a stack overflow when checking the valid4// declaration of an invalid type. Ensure we issue reasonable diagnostics5// instead of crashing.6struct 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};11constexpr struct GH140887 a; // expected-error {{constexpr variable 'a' must be initialized by a constant expression}}12 13