gribozavr wrote: I'd like to push back against this change, I believe it is too broad. (Full disclosure: I'm the original author of this subsystem in Clang.)
We (Google) are integrating this change downstream and it causes a bunch of comments to get associated to unrelated declarations. The problem is particularly bad with file-level comments, which get attached to the first declaration. For example: https://github.com/google/crubit/blob/main/rs_bindings_from_cc/test/golden/definition_of_forward_declaration.h In this file the license comment gets attached to `ForwardDeclaredStruct` even though they are separated by an `#include` directive. I think you should at the very minimum check for `#include` directives as a negative signal that breaks the connection. https://github.com/llvm/llvm-project/pull/88367 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits