Debian Codegraph @

clang/test/Modules/expose-static-inline-from-gmf-1.cppm

raw
1 // RUN: rm -rf %t
2 // RUN: mkdir -p %t
3 // RUN: split-file %s %t
4 //
5 // RUN: %clang -std=c++20 %t/a.cppm --precompile -o %t/a.pcm \
6 // RUN: -DTEST_INLINE
7 // RUN: %clang -std=c++20 %t/test.cc -fprebuilt-module-path=%t -fsyntax-only -Xclang -verify \
8 // RUN: -DTEST_INLINE
9 //
10 // RUN: %clang -std=c++20 %t/a.cppm --precompile -o %t/a.pcm
11 // RUN: %clang -std=c++20 %t/test.cc -fprebuilt-module-path=%t -fsyntax-only -Xclang -verify
12
13 //--- a.h
14 #ifdef TEST_INLINE
15 #define INLINE inline
16 #else
17 #define INLINE
18 #endif
19 static INLINE void func(long) {}
20 template <typename T = long> void a() { func(T{}); }
21
22 //--- a.cppm
23 module;
24 #include "a.h"
25 export module a;
26 export using ::a;
27
28 //--- test.cc
29 import a;
30 auto m = (a(), 0);
31
32 #ifdef TEST_INLINE
33 // expected-no-diagnostics
34 #else
35 // [email protected]:7 {{no matching function for call to 'func'}}
36 // [email protected]:2 {{in instantiation of function template specialization 'a<long>' requested here}}
37 #endif