Issue |
138596
|
Summary |
Attributes appertaining to inner classes of class template specializations are duplicated
|
Labels |
new issue
|
Assignees |
|
Reporter |
katzdm
|
Given the following:
```cpp
template <class T>
struct X {
struct [[deprecated]] Inner { };
[[deprecated]] static void fn() { };
};
int main() {
X<int>::Inner d;
X<int>::fn();
}
```
([Godbolt link w/ AST](https://godbolt.org/z/PTafvec6q))
Two duplicate `DeprecatedAttr` nodes are attached to the `ClassTemplateSpecializationDecl` corresponding to `X<int>::Inner`. This can be observed for attributes whose `Attr.td` entry has both `Clone` and `MeaningfulToClassTemplateSpecialization` equal to `1`.
I believe that both `sema::instantiateTemplateAttribute` and `sema::instantiateTemplateAttributeForDecl` are being invoked for each attribute.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs