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