Chuanqi Xu 3f0cf742ac [C++20] [Modules] [Reduced BMI] Don't write specializations with local args
Close https://github.com/llvm/llvm-project/issues/119947

As discussed in the above thread, we shouldn't write specializations
with local args in reduced BMI. Since users can't find such
specializations any way.
2025-06-12 14:42:04 +08:00

55 lines
599 B
C++

// RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: split-file %s %t
//
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-reduced-module-interface -o %t/a.pcm
// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fprebuilt-module-path=%t -emit-llvm -o -
//--- a.cppm
export module a;
struct a_inner {
~a_inner() {
}
void f(auto) {
}
};
export template<typename T>
struct a {
a() {
struct local {};
inner.f(local());
}
private:
a_inner inner;
};
namespace {
struct s {
};
} // namespace
void f() {
a<s> x;
}
//--- use.cpp
import a;
namespace {
struct s {
};
} // namespace
void g() {
a<s> x;
}