| 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 |
| 10 | import Foo; |
| 11 | #endif |
| 12 | |
| 13 | #ifdef EARLY_IMPLEMENTATION |
| 14 | module Foo; |
| 15 | #endif |
| 16 | |
| 17 | template<typename T> struct type_template { |
| 18 | typedef T type; |
| 19 | void f(type); |
| 20 | }; |
| 21 | |
| 22 | template<typename T> void type_template<T>::f(type) {} |
| 23 | |
| 24 | template<int = 0, typename = int, template<typename> class = type_template> |
| 25 | struct default_template_args {}; |
| 26 | |
| 27 | #ifdef INTERFACE |
| 28 | export module Foo; |
| 29 | #endif |
| 30 | |
| 31 | #ifdef IMPLEMENTATION |
| 32 | module Foo; |
| 33 | #endif |
| 34 | |