[clang] [clang][Modules] Diagnosing Module Redefinition Across ModuleMaps (PR #190085)

Qiongsi Wu via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 7 15:54:38 PDT 2026


================
@@ -0,0 +1,73 @@
+// Test duplicating module decls discovered during by-name module scanning with
+// a shared compiler instance.
+// This tests covers the case where the current modulemap we are loading
+// contains a module decl that satisfies two conditions:
+// 1. The compiler has seen the module decl during previous lookups.
+// 2. The previous decl comes from a different modulemap.
+// In this case, an error is produced with no dependency information returned.
+
+// RUN: rm -rf %t
+// RUN: split-file %s %t
+// RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
+
+// Scenario setup:
----------------
qiongsiwu wrote:

Done! 

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


More information about the cfe-commits mailing list