diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 18:43:11 +0900 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2025-01-09 18:43:11 +0900 |
commit | 0e1a753549b29ff1f5a190aca83b803a33b51628 (patch) | |
tree | e5578f8810c65711304128d0c8add7fa1f77b9d8 /clang/test/Modules/expose-static-inline-from-gmf-1.cppm | |
parent | 3c6252260ee11e3a453076b4d96ffffe20d49998 (diff) | |
parent | bdcf47e4bcb92889665825654bb80a8bbe30379e (diff) | |
download | llvm-users/chapuni/cov/single/if.zip llvm-users/chapuni/cov/single/if.tar.gz llvm-users/chapuni/cov/single/if.tar.bz2 |
Merge branch 'users/chapuni/cov/single/base' into users/chapuni/cov/single/ifusers/chapuni/cov/single/if
Conflicts:
clang/lib/CodeGen/CoverageMappingGen.cpp
Diffstat (limited to 'clang/test/Modules/expose-static-inline-from-gmf-1.cppm')
-rw-r--r-- | clang/test/Modules/expose-static-inline-from-gmf-1.cppm | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/clang/test/Modules/expose-static-inline-from-gmf-1.cppm b/clang/test/Modules/expose-static-inline-from-gmf-1.cppm new file mode 100644 index 0000000..4de9b58 --- /dev/null +++ b/clang/test/Modules/expose-static-inline-from-gmf-1.cppm @@ -0,0 +1,37 @@ +// RUN: rm -rf %t +// RUN: mkdir -p %t +// RUN: split-file %s %t +// +// RUN: %clang -std=c++20 %t/a.cppm --precompile -o %t/a.pcm \ +// RUN: -DTEST_INLINE +// RUN: %clang -std=c++20 %t/test.cc -fprebuilt-module-path=%t -fsyntax-only -Xclang -verify \ +// RUN: -DTEST_INLINE +// +// RUN: %clang -std=c++20 %t/a.cppm --precompile -o %t/a.pcm +// RUN: %clang -std=c++20 %t/test.cc -fprebuilt-module-path=%t -fsyntax-only -Xclang -verify + +//--- a.h +#ifdef TEST_INLINE +#define INLINE inline +#else +#define INLINE +#endif +static INLINE void func(long) {} +template <typename T = long> void a() { func(T{}); } + +//--- a.cppm +module; +#include "a.h" +export module a; +export using ::a; + +//--- test.cc +import a; +auto m = (a(), 0); + +#ifdef TEST_INLINE +// expected-no-diagnostics +#else +// expected-error@a.h:7 {{no matching function for call to 'func'}} +// expected-note@test.cc:2 {{in instantiation of function template specialization 'a<long>' requested here}} +#endif |