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 // FIXME: This is valid, see PR41192 17 struct A {} // FIXME expected-error {{expected ';'}} 18 ::import 19 <empty.h>::a; // FIXME expected-error {{requires a type specifier}} 20 21 // This is invalid: the tokens after 'import' are a header-name, so cannot be 22 // parsed as a template-argument-list. 23 struct B {} 24 import // expected-error {{redefinition of 'import'}} expected-error {{expected ';'}} 25 <empty.h>::b; // (error recovery skips these tokens) 26 27 // Likewise, this is ill-formed after the tokens are reconstituted into a 28 // header-name token. 29 struct C {} 30 import // expected-error {{redefinition of 'import'}} expected-error {{expected ';'}} 31 < 32 empty.h // (error recovery skips these tokens) 33 >::c; 34