llvm / llvm/llvm-project

Duplicate comments are unnecessarily attached to related decls

Open
#200,283 3 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.