| 1 |
// RUN: rm -rf %t |
| 2 |
// RUN: split-file %s %t |
| 3 |
// RUN: cd %t |
| 4 |
// |
| 5 |
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -I%t -emit-module-interface -o %t/A.pcm |
| 6 |
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only |
| 7 |
// |
| 8 |
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -I%t -emit-reduced-module-interface -o %t/A.pcm |
| 9 |
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only |
| 10 |
// |
| 11 |
//--- foo.h |
| 12 |
|
| 13 |
namespace ns { |
| 14 |
struct A {}; |
| 15 |
|
| 16 |
template<typename Func> |
| 17 |
constexpr bool __call_is_nt(A) |
| 18 |
{ |
| 19 |
return true; |
| 20 |
} |
| 21 |
ns::A make(); |
| 22 |
|
| 23 |
template <typename T> |
| 24 |
bool foo(T t) { |
| 25 |
auto func = [](){}; |
| 26 |
return __call_is_nt<decltype(func)>(t); |
| 27 |
} |
| 28 |
} |
| 29 |
|
| 30 |
//--- A.cppm |
| 31 |
module; |
| 32 |
#include "foo.h" |
| 33 |
export module A; |
| 34 |
export namespace ns { |
| 35 |
using ns::foo; |
| 36 |
using ns::make; |
| 37 |
} |
| 38 |
|
| 39 |
//--- Use.cpp |
| 40 |
// expected-no-diagnostics |
| 41 |
import A; |
| 42 |
void test() { |
| 43 |
auto a = ns::make(); |
| 44 |
ns::foo(a); |
| 45 |
} |