2015-06-09 08:35:49 +08:00
|
|
|
// RUN: rm -rf %t
|
2015-07-20 07:44:27 +08:00
|
|
|
// 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 -DBEGIN= -DEND=
|
|
|
|
// 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 -DBEGIN="namespace N {" -DEND="}"
|
2015-06-09 08:35:49 +08:00
|
|
|
|
2015-07-20 07:44:27 +08:00
|
|
|
BEGIN
|
2015-06-09 08:35:49 +08:00
|
|
|
template<typename T> struct A;
|
|
|
|
template<typename T> struct B;
|
|
|
|
template<typename T> struct C;
|
|
|
|
template<typename T = int> struct D;
|
2015-06-11 04:30:23 +08:00
|
|
|
template<typename T = int> struct E {};
|
2015-06-18 04:16:32 +08:00
|
|
|
template<typename T> struct H {};
|
2015-06-18 06:13:23 +08:00
|
|
|
template<typename T = int, typename U = int> struct I {};
|
2015-07-20 07:44:27 +08:00
|
|
|
END
|
2015-06-09 08:35:49 +08:00
|
|
|
|
|
|
|
#include "b.h"
|
2015-09-12 06:39:35 +08:00
|
|
|
#include "d.h"
|
2015-06-09 08:35:49 +08:00
|
|
|
|
2015-07-20 07:44:27 +08:00
|
|
|
BEGIN
|
2015-06-09 08:35:49 +08:00
|
|
|
template<typename T = int> struct A {};
|
|
|
|
template<typename T> struct B {};
|
|
|
|
template<typename T = int> struct B;
|
|
|
|
template<typename T = int> struct C;
|
|
|
|
template<typename T> struct D {};
|
2015-06-11 04:30:23 +08:00
|
|
|
template<typename T> struct F {};
|
2015-06-18 04:16:32 +08:00
|
|
|
template<typename T> struct G {};
|
2015-08-18 04:24:17 +08:00
|
|
|
template<typename T> struct J {};
|
|
|
|
template<typename T = int> struct J;
|
|
|
|
struct K : J<> {};
|
2015-07-20 07:44:27 +08:00
|
|
|
END
|
2015-06-11 04:30:23 +08:00
|
|
|
|
|
|
|
#include "c.h"
|
2015-06-09 08:35:49 +08:00
|
|
|
|
2015-07-20 07:44:27 +08:00
|
|
|
BEGIN
|
2015-06-09 08:35:49 +08:00
|
|
|
A<> a;
|
|
|
|
B<> b;
|
|
|
|
extern C<> c;
|
|
|
|
D<> d;
|
2015-06-11 04:30:23 +08:00
|
|
|
E<> e;
|
|
|
|
F<> f;
|
2015-06-18 04:16:32 +08:00
|
|
|
G<> g; // expected-error {{default argument of 'G' must be imported from module 'X.A' before it is required}}
|
|
|
|
// expected-note@a.h:7 {{default argument declared here}}
|
2015-07-20 07:44:27 +08:00
|
|
|
H<> h; // expected-error {{default argument of 'H' must be imported from module 'X.A' before it is required}}
|
|
|
|
// expected-note@a.h:8 {{default argument declared here}}
|
2015-06-18 06:13:23 +08:00
|
|
|
I<> i;
|
2015-09-12 06:39:35 +08:00
|
|
|
L<> *l;
|
2015-07-20 07:44:27 +08:00
|
|
|
END
|