| 1 |
// RUN: rm -rf %t |
| 2 |
// RUN: mkdir -p %t |
| 3 |
// RUN: split-file %s %t |
| 4 |
// |
| 5 |
// RUN: %clang_cc1 -std=c++20 %t/B.cppm -emit-module-interface -o %t/B.pcm |
| 6 |
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify |
| 7 |
|
| 8 |
// RUN: %clang_cc1 -std=c++20 %t/B.cppm -emit-reduced-module-interface -o %t/B.pcm |
| 9 |
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -fsyntax-only -verify |
| 10 |
// |
| 11 |
//--- templ.h |
| 12 |
template <typename T, typename U = T> |
| 13 |
class templ {}; |
| 14 |
template <typename T, typename U = void> |
| 15 |
void templ_func() {} |
| 16 |
|
| 17 |
//--- B.cppm |
| 18 |
module; |
| 19 |
#include "templ.h" |
| 20 |
export module B; |
| 21 |
export template <typename G> |
| 22 |
templ<G> bar() { |
| 23 |
templ_func<G>(); |
| 24 |
return {}; |
| 25 |
} |
| 26 |
|
| 27 |
//--- Use.cpp |
| 28 |
// expected-no-diagnostics |
| 29 |
import B; |
| 30 |
auto foo() { |
| 31 |
return bar<int>(); |
| 32 |
} |