[clang] [clang][Modules] Keep existing global definition on type mismatch in GetOrCreateLLVMGlobal (PR #223877)

Yuxuan Chen via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 17 21:18:24 PDT 2026


yuxuanchen1997 wrote:

> > There's no second VarDecl
> 
> No.... This is not what merged mean. When we said merged, the redeclarations should appear as a redecl link. It proves that exactly the merging is not happening properly.

Actually, taking a step back. Why do we expect `S` to be considered redeclared? There's a single global decl in `a.h`. `b.h` imports `a.h`, and should `S` be even considered declared again?  It'd be surprising for the AST to be wrong on such a trivial case.

https://github.com/llvm/llvm-project/pull/223877


More information about the cfe-commits mailing list