blob: cc11a173e1dd334e987f3e0e8144f39ef201c500 [file] [log] [blame]
Richard Smitha1087602014-03-10 00:04:29 +00001// RUN: rm -rf %t
2// RUN: %clang_cc1 -fmodules -verify -fmodules-cache-path=%t -I %S/Inputs/template-specialization-visibility -std=c++11 %s
3//
4// FIXME: We should accept the explicit instantiation cases below too.
5// Note, errors trigger implicit imports, so only enable one error at a time.
6// RUN: %clang_cc1 -fmodules -verify -fmodules-cache-path=%t -I %S/Inputs/template-specialization-visibility -std=c++11 -DERR1 %s
7// RUN: %clang_cc1 -fmodules -verify -fmodules-cache-path=%t -I %S/Inputs/template-specialization-visibility -std=c++11 -DERR2 %s
8// RUN: %clang_cc1 -fmodules -verify -fmodules-cache-path=%t -I %S/Inputs/template-specialization-visibility -std=c++11 -DERR3 %s
9
10#include "c.h"
11
12S<int> implicit_inst_class_template;
13int k1 = implicit_inst_class_template.n;
14
15#ifdef ERR1
16S<char> explicit_inst_class_template; // expected-error {{must be imported from module 'tsv.e'}}
17// expected-note@e.h:4 {{previous}}
18int k2 = explicit_inst_class_template.n;
19#endif
20
21#include "a.h"
22
23T<int>::S implicit_inst_member_class_template;
24int k3 = implicit_inst_member_class_template.n;
25
26#ifdef ERR2
27T<char>::S explicit_inst_member_class_template; // expected-error {{must be imported from module 'tsv.e'}}
28// expected-note@e.h:5 {{previous}}
29int k4 = explicit_inst_member_class_template.n;
30#endif
31
32T<int>::E implicit_inst_member_enum_template;
33int k5 = decltype(implicit_inst_member_enum_template)::e;
34
35#ifdef ERR3
36T<char>::E explicit_inst_member_enum_template; // expected-error {{must be imported from module 'tsv.e'}}
37// expected-note@e.h:5 {{previous}}
38int k6 = decltype(explicit_inst_member_enum_template)::e;
39#endif
40
41#if ERR1 + ERR2 + ERR3 == 0
42// expected-no-diagnostics
43#endif