Duplicate comments are unnecessarily attached to related decls
Open
clang:frontend
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Taking the example from #44510, the `FullComment` from the function f is attached to three different decls.
https://compiler-explorer.com/z/T4bYa5hq3
Besides the problems it creates in that issue, it seems unnecessary to have the comment duplicated three times in the example. The comment doesn't actually appear in source for the function template instantiation and IMO it's correct for it to be only associated with the function template (though I can see semantic arguments being made depending on its location). It can also be easily seen that there will possibly be hundreds of duplicate comments being attached in any reasonably sized project.
Contributor guide
Assessment
This issue has not been assessed yet.