| 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: %clang -std=c++20 %t/test.cc -fprebuilt-module-path=%t -fsyntax-only -Xclang -verify |
| 7 |
|
| 8 |
//--- a.h |
| 9 |
namespace ns { |
| 10 |
template <typename G> static void func() {} |
| 11 |
template <typename T = long> void a() { func<T>(); } |
| 12 |
} |
| 13 |
|
| 14 |
//--- a.cppm |
| 15 |
module; |
| 16 |
#include "a.h" |
| 17 |
export module a; |
| 18 |
export using ns::a; |
| 19 |
|
| 20 |
//--- test.cc |
| 21 |
import a; |
| 22 |
auto m = (a(), 0); |
| 23 |
|
| 24 |
// expected-no-diagnostics |