22 lines · c
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c23 %s2// RUN: %clang_cc1 -fsyntax-only -verify -std=c23 -Wvisibility %s3 4// In C23 mode, we only want to diagnose a declaration in a prototype if that5// declaration is for an incomplete tag type. Otherwise, we silence the6// diagnostic because the function could be called with a compatible type.7 8void f(struct Incomplete); // expected-warning {{will not be visible outside of this function}}9void g(struct Complete { int x; });10 11struct A {12 struct B {13 int j; // #j14 } b;15};16 17void complicated(struct A { struct B { int j; } b; }); // Okay18 19void also_complicated(struct A { struct B { int glorx; } b; }); // expected-error {{type 'struct B' has incompatible definitions}} \20 expected-note {{field has name 'glorx' here}} \21 expected-note@#j {{field has name 'j' here}}22