Commit ac23f74
authored
[clang] fix nested tags of the same name not being included in their context (#155965)
Fix an error in the logic meant to handle a redeclaration such as:
```C++
struct A {
struct __attribute__((foo)) A *ptr;
};
```
In the declaration of ptr, we must introduce a new redeclaration of A in
order for it to carry the new attribute. This is a redeclaration of the
existing A, but it is only lexically contained in A, still semantically
belonging to the TU. This is the same deal as happens with friend
declarations, and the logic used to handle that is reused here.
But this was going haywire with a class indirectly nested within a class
of the same name.
The fix limits this logic to only apply when the tag use is just a
simple reference.
Since this regression was never released, there are no release notes.
Fixes #1559361 parent 88d0751 commit ac23f74
2 files changed
+17
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18050 | 18050 | | |
18051 | 18051 | | |
18052 | 18052 | | |
18053 | | - | |
| 18053 | + | |
| 18054 | + | |
18054 | 18055 | | |
18055 | 18056 | | |
18056 | 18057 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
990 | 990 | | |
991 | 991 | | |
992 | 992 | | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
0 commit comments