1 // RUN: %clang_cc1 -std=c++2a -emit-header-module -fmodule-name=attrs -x c++-header %S/Inputs/empty.h %S/Inputs/attrs.h -o %t.pcm 2 // RUN: %clang_cc1 -std=c++2a %s -fmodule-file=%t.pcm -fsyntax-only -verify -I%S/Inputs 3 4 template<int> struct import; // expected-note 2{{previous}} 5 constexpr struct { int h; } empty = {0}; 6 struct A; 7 struct B; 8 struct C; 9 template<> struct import<0> { 10 static A a; 11 static B b; 12 static C c; 13 }; 14 15 // OK, not an import-declaration. 16 struct A {} 17 ::import 18 <empty.h>::a; 19 20 // This is invalid: the tokens after 'import' are a header-name, so cannot be 21 // parsed as a template-argument-list. 22 struct B {} 23 import // expected-error {{redefinition of 'import'}} expected-error {{expected ';'}} 24 <empty.h>::b; // (error recovery skips these tokens) 25 26 // Likewise, this is ill-formed after the tokens are reconstituted into a 27 // header-name token. 28 struct C {} 29 import // expected-error {{redefinition of 'import'}} expected-error {{expected ';'}} 30 < 31 empty.h // (error recovery skips these tokens) 32 >::c; 33