Richard Smith | 87bb569 | 2015-06-09 00:35:49 +0000 | [diff] [blame] | 1 | // RUN: rm -rf %t |
Richard Smith | 35c1df5 | 2015-06-17 20:16:32 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -verify -fmodules-cache-path=%t -fno-modules-error-recovery -I %S/Inputs/template-default-args -std=c++11 %s |
Richard Smith | 87bb569 | 2015-06-09 00:35:49 +0000 | [diff] [blame] | 3 | |
| 4 | template<typename T> struct A; |
| 5 | template<typename T> struct B; |
| 6 | template<typename T> struct C; |
| 7 | template<typename T = int> struct D; |
Richard Smith | e7bd6de | 2015-06-10 20:30:23 +0000 | [diff] [blame] | 8 | template<typename T = int> struct E {}; |
Richard Smith | 35c1df5 | 2015-06-17 20:16:32 +0000 | [diff] [blame] | 9 | template<typename T> struct H {}; |
Richard Smith | afe800c | 2015-06-17 22:13:23 +0000 | [diff] [blame^] | 10 | template<typename T = int, typename U = int> struct I {}; |
Richard Smith | 87bb569 | 2015-06-09 00:35:49 +0000 | [diff] [blame] | 11 | |
| 12 | #include "b.h" |
| 13 | |
| 14 | template<typename T = int> struct A {}; |
| 15 | template<typename T> struct B {}; |
| 16 | template<typename T = int> struct B; |
| 17 | template<typename T = int> struct C; |
| 18 | template<typename T> struct D {}; |
Richard Smith | e7bd6de | 2015-06-10 20:30:23 +0000 | [diff] [blame] | 19 | template<typename T> struct F {}; |
Richard Smith | 35c1df5 | 2015-06-17 20:16:32 +0000 | [diff] [blame] | 20 | template<typename T> struct G {}; |
Richard Smith | e7bd6de | 2015-06-10 20:30:23 +0000 | [diff] [blame] | 21 | |
| 22 | #include "c.h" |
Richard Smith | 87bb569 | 2015-06-09 00:35:49 +0000 | [diff] [blame] | 23 | |
| 24 | A<> a; |
| 25 | B<> b; |
| 26 | extern C<> c; |
| 27 | D<> d; |
Richard Smith | e7bd6de | 2015-06-10 20:30:23 +0000 | [diff] [blame] | 28 | E<> e; |
| 29 | F<> f; |
Richard Smith | 35c1df5 | 2015-06-17 20:16:32 +0000 | [diff] [blame] | 30 | G<> g; // expected-error {{default argument of 'G' must be imported from module 'X.A' before it is required}} |
| 31 | // expected-note@a.h:6 {{default argument declared here}} |
| 32 | H<> h; // expected-error {{default argument of 'H' must be imported from module 'X.A' before it is required}} |
| 33 | // expected-note@a.h:7 {{default argument declared here}} |
Richard Smith | afe800c | 2015-06-17 22:13:23 +0000 | [diff] [blame^] | 34 | I<> i; |