blob: dc44534302b2c821e30a0d5f2d00aa0294d31ca5 [file] [log] [blame]
Richard Smith87bb5692015-06-09 00:35:49 +00001// RUN: rm -rf %t
Richard Smith35c1df52015-06-17 20:16:32 +00002// 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 Smith87bb5692015-06-09 00:35:49 +00003
4template<typename T> struct A;
5template<typename T> struct B;
6template<typename T> struct C;
7template<typename T = int> struct D;
Richard Smithe7bd6de2015-06-10 20:30:23 +00008template<typename T = int> struct E {};
Richard Smith35c1df52015-06-17 20:16:32 +00009template<typename T> struct H {};
Richard Smithafe800c2015-06-17 22:13:23 +000010template<typename T = int, typename U = int> struct I {};
Richard Smith87bb5692015-06-09 00:35:49 +000011
12#include "b.h"
13
14template<typename T = int> struct A {};
15template<typename T> struct B {};
16template<typename T = int> struct B;
17template<typename T = int> struct C;
18template<typename T> struct D {};
Richard Smithe7bd6de2015-06-10 20:30:23 +000019template<typename T> struct F {};
Richard Smith35c1df52015-06-17 20:16:32 +000020template<typename T> struct G {};
Richard Smithe7bd6de2015-06-10 20:30:23 +000021
22#include "c.h"
Richard Smith87bb5692015-06-09 00:35:49 +000023
24A<> a;
25B<> b;
26extern C<> c;
27D<> d;
Richard Smithe7bd6de2015-06-10 20:30:23 +000028E<> e;
29F<> f;
Richard Smith35c1df52015-06-17 20:16:32 +000030G<> 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}}
32H<> 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 Smithafe800c2015-06-17 22:13:23 +000034I<> i;