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/Templ.cppm -emit-module-interface -o %t/Templ.pcm 6 // RUN: %clang_cc1 -std=c++20 %t/Use.cppm -fprebuilt-module-path=%t -emit-module-interface -o %t/Use.pcm 7 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t -I%t %t/Use.cpp -verify -fsyntax-only 8 // 9 //--- Templ.h 10 #ifndef TEMPL_H 11 #define TEMPL_H 12 template <class T> 13 class Wrapper { 14 public: 15 T value; 16 }; 17 #endif 18 19 //--- Templ.cppm 20 export module Templ; 21 export template <class T> 22 class Wrapper2 { 23 public: 24 T value; 25 }; 26 27 //--- Use.cppm 28 module; 29 #include "Templ.h" 30 export module Use; 31 import Templ; 32 33 export template <class T> 34 class Use { 35 public: 36 Wrapper<T> value; 37 Wrapper2<T> value2; 38 }; 39 40 export template <class T> 41 Wrapper<T> wrapper; 42 43 //--- Use.cpp 44 // expected-no-diagnostics 45 module; 46 #include "Templ.h" 47 export module User; 48 49 export template <class T> 50 class User { 51 public: 52 Wrapper<T> value; 53 }; 54