Close https://github.com/llvm/llvm-project/issues/137533 This may be fixed by other PR before. Adding a test for avoid further regression.
26 lines
672 B
C++
26 lines
672 B
C++
// RUN: rm -rf %t
|
|
// RUN: mkdir -p %t
|
|
// RUN: split-file %s %t
|
|
//
|
|
// RUN: %clang_cc1 -std=c++20 %t/m.cppm -emit-module-interface -o %t/m.pcm
|
|
// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fmodule-file=m=%t/m.pcm -fsyntax-only -verify
|
|
//
|
|
// RUN: %clang_cc1 -std=c++20 %t/m.cppm -emit-reduced-module-interface -o %t/m.pcm
|
|
// RUN: %clang_cc1 -std=c++20 %t/use.cpp -fmodule-file=m=%t/m.pcm -fsyntax-only -verify
|
|
|
|
//--- m.cppm
|
|
export module m;
|
|
static const char * f() { return "m.cppm"; }
|
|
export auto &fr = f;
|
|
|
|
//--- use.cpp
|
|
// expected-no-diagnostics
|
|
import m;
|
|
static const char * f() { return "use.cpp"; }
|
|
constexpr auto &fr1 = f;
|
|
auto &fr2 = fr;
|
|
int main() {
|
|
fr1();
|
|
fr2();
|
|
}
|