[clang] [clang] fix redecl chain assumption when checking linkage consistency (PR #153996)

Chuanqi Xu via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 17 18:51:23 PDT 2025


================
@@ -0,0 +1,22 @@
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: split-file %s %t
+//
+// RUN: %clang_cc1 -std=c++20 %t/B.cppm -emit-module-interface -o %t/B.pcm
+// RUN: %clang_cc1 -std=c++20 -fsyntax-only -fprebuilt-module-path=%t %t/C.cpp
+
+//--- A.hpp
+template<class> struct A {};
+template<class T> struct B {
+  virtual A<T> v() { return {}; }
+};
+B<void> x;
+
+//--- B.cppm
+module;
+#include "A.hpp"
+export module B;
----------------
ChuanqiXu9 wrote:

```suggestion
export module B;
using ::x;
```

Reduced BMI is the default. Although it is temporarily fine in this test since you used `emit-module-interface`, it is better to make it conforming.

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


More information about the cfe-commits mailing list