| 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 -emit-module-interface -o %t/A.pcm |
| 6 |
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t -I%t %t/Use.cppm -verify -fsyntax-only |
| 7 |
|
| 8 |
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-reduced-module-interface -o %t/A.pcm |
| 9 |
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t -I%t %t/Use.cppm -verify -fsyntax-only |
| 10 |
|
| 11 |
//--- foo.h |
| 12 |
template <typename T, typename U = int> |
| 13 |
class Templ; |
| 14 |
|
| 15 |
template <typename T, typename U> |
| 16 |
class Templ { |
| 17 |
public: |
| 18 |
Templ(T t) {} |
| 19 |
}; |
| 20 |
|
| 21 |
template <typename T> |
| 22 |
Templ(T t) -> Templ<T, int>; |
| 23 |
|
| 24 |
//--- A.cppm |
| 25 |
module; |
| 26 |
#include "foo.h" |
| 27 |
export module A; |
| 28 |
|
| 29 |
//--- Use.cppm |
| 30 |
// expected-no-diagnostics |
| 31 |
module; |
| 32 |
#include "foo.h" |
| 33 |
export module X; |
| 34 |
import A; |
| 35 |
void foo() { |
| 36 |
Templ t(0); |
| 37 |
} |