Clang Project

clang_source_code/test/CXX/modules-ts/dcl.dcl/dcl.module/p5.cpp
1// RUN: rm -f %t
2// RUN: %clang_cc1 -std=c++1z -fmodules-ts -emit-module-interface %s -o %t -DINTERFACE
3// RUN: %clang_cc1 -std=c++1z -fmodules-ts -fmodule-file=%t %s -verify -DIMPLEMENTATION
4// RUN: %clang_cc1 -std=c++1z -fmodules-ts -fmodule-file=%t %s -verify -DEARLY_IMPLEMENTATION
5// RUN: %clang_cc1 -std=c++1z -fmodules-ts -fmodule-file=%t %s -verify -DUSER
6
7// expected-no-diagnostics
8
9#ifdef USER
10import Foo;
11#endif
12
13#ifdef EARLY_IMPLEMENTATION
14module Foo;
15#endif
16
17template<typename T> struct type_template {
18  typedef T type;
19  void f(type);
20};
21
22template<typename T> void type_template<T>::f(type) {}
23
24template<int = 0, typename = int, template<typename> class = type_template>
25struct default_template_args {};
26
27#ifdef INTERFACE
28export module Foo;
29#endif
30
31#ifdef IMPLEMENTATION
32module Foo;
33#endif
34