
There is a `IDNS_Ordinary` flag in `IndirectFieldDecl::IdentifierNamespace` so that members in nested anonymous struct/union can be found as ordinary identifiers. ```c struct S { struct { int x; }; // Previous behaviour: `x` in previous line is found // Expected: nothing is found int arr[sizeof(x)]; }; ``` This PR fixes this issue. Fixes #31295.
7 lines
157 B
C
7 lines
157 B
C
// RUN: %clang_cc1 -std=c11 -verify %s
|
|
|
|
struct GH31295 {
|
|
struct { int x; };
|
|
int arr[sizeof(x)]; // expected-error{{use of undeclared identifier 'x'}}
|
|
};
|