[all-commits] [llvm/llvm-project] ac23f7: [clang] fix nested tags of the same name not being...
Matheus Izvekov via All-commits
all-commits at lists.llvm.org
Thu Aug 28 20:34:18 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: ac23f7465eedd0dd565ffb201f573e7a69695fa3
https://github.com/llvm/llvm-project/commit/ac23f7465eedd0dd565ffb201f573e7a69695fa3
Author: Matheus Izvekov <mizvekov at gmail.com>
Date: 2025-08-29 (Fri, 29 Aug 2025)
Changed paths:
M clang/lib/Sema/SemaDecl.cpp
M clang/test/AST/ast-dump-decl.cpp
Log Message:
-----------
[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 #155936
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list