mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-18 12:16:49 +00:00
4b35dd57b8
was shipped to address https://github.com/llvm/llvm-project/issues/120277 . It was thought to be a regression in 19.x according to this comment: https://github.com/llvm/llvm-project/issues/120277#issuecomment-2558991129 This is a test case that fails even in 17.x but nevertheless is also fixed by:4b35dd57b8
This commit is contained in:
parent
7c60725fcf
commit
59cbe2ff59
66
clang/test/Modules/pr120277-2.cpp
Normal file
66
clang/test/Modules/pr120277-2.cpp
Normal file
@ -0,0 +1,66 @@
|
||||
// RUN: rm -rf %t
|
||||
// RUN: mkdir -p %t
|
||||
// RUN: split-file %s %t
|
||||
|
||||
// RUN: %clang_cc1 -std=c++20 -emit-header-unit -xc++-user-header %t/hu-01.h \
|
||||
// RUN: -o %t/hu-01.pcm
|
||||
|
||||
// RUN: %clang_cc1 -std=c++20 -emit-header-unit -xc++-user-header %t/hu-02.h \
|
||||
// RUN: -Wno-experimental-header-units -fmodule-file=%t/hu-01.pcm -o %t/hu-02.pcm
|
||||
|
||||
// RUN: %clang_cc1 -std=c++20 -emit-header-unit -xc++-user-header %t/hu-03.h \
|
||||
// RUN: -Wno-experimental-header-units \
|
||||
// RUN: -fmodule-file=%t/hu-01.pcm -o %t/hu-03.pcm
|
||||
|
||||
// RUN: %clang_cc1 -std=c++20 -emit-header-unit -xc++-user-header %t/hu-04.h \
|
||||
// RUN: -Wno-experimental-header-units -fmodule-file=%t/hu-02.pcm \
|
||||
// RUN: -fmodule-file=%t/hu-03.pcm -o %t/hu-04.pcm
|
||||
|
||||
// RUN: %clang_cc1 -std=c++20 -emit-obj %t/main.cpp \
|
||||
// RUN: -Wno-experimental-header-units -fmodule-file=%t/hu-04.pcm
|
||||
//--- hu-01.h
|
||||
template <typename T>
|
||||
struct A {
|
||||
~A() { f(); }
|
||||
auto f() const { return 0; }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct B {
|
||||
int g() const { return a.f(); }
|
||||
A<T> a;
|
||||
};
|
||||
|
||||
//--- hu-02.h
|
||||
import "hu-01.h";
|
||||
|
||||
template <typename = void>
|
||||
struct C {
|
||||
void h() {
|
||||
B<int>().g();
|
||||
}
|
||||
};
|
||||
|
||||
template struct A<double>;
|
||||
|
||||
//--- hu-03.h
|
||||
import "hu-01.h";
|
||||
|
||||
inline B<int> b() {
|
||||
return {};
|
||||
}
|
||||
|
||||
//--- hu-04.h
|
||||
import "hu-02.h";
|
||||
import "hu-03.h";
|
||||
|
||||
inline void f4() {
|
||||
C{}.h();
|
||||
}
|
||||
|
||||
//--- main.cpp
|
||||
import "hu-04.h";
|
||||
|
||||
int main() {
|
||||
f4();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user