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//--- Templ.cppm 9export module Templ; 10template <typename T> 11class Templ { 12public: 13 Templ(T a) {} 14}; 15 16template<typename T> 17Templ(T t) -> Templ<T>; 18 19//--- Use.cpp 20import Templ; 21void func() { 22 Templ t(5); // expected-error {{declaration of 'Templ' must be imported from module 'Templ' before it is required}} 23 // expected-error@-1 {{unknown type name 'Templ'}} 24 // [email protected]:3 {{declaration here is not visible}} 25} 26 27