1 // 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 
12 S<int> implicit_inst_class_template;
13 int k1 = implicit_inst_class_template.n;
14 
15 #ifdef ERR1
16 S<char> explicit_inst_class_template; // expected-error {{must be imported from module 'tsv.e'}}
17 // [email protected]:4 {{previous}}
18 int k2 = explicit_inst_class_template.n;
19 #endif
20 
21 #include "a.h"
22 
23 T<int>::S implicit_inst_member_class_template;
24 int k3 = implicit_inst_member_class_template.n;
25 
26 #ifdef ERR2
27 T<char>::S explicit_inst_member_class_template; // expected-error {{must be imported from module 'tsv.e'}}
28 // [email protected]:5 {{previous}}
29 int k4 = explicit_inst_member_class_template.n;
30 #endif
31 
32 T<int>::E implicit_inst_member_enum_template;
33 int k5 = decltype(implicit_inst_member_enum_template)::e;
34 
35 #ifdef ERR3
36 T<char>::E explicit_inst_member_enum_template; // expected-error {{must be imported from module 'tsv.e'}}
37 // [email protected]:5 {{previous}}
38 int k6 = decltype(explicit_inst_member_enum_template)::e;
39 #endif
40 
41 #if ERR1 + ERR2 + ERR3 == 0
42 // expected-no-diagnostics
43 #endif
44