1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - %s -verify
7 namespace { // expected-note {{anonymous namespace begins here}}
8 export void f2(); // expected-error {{export declaration appears within anonymous namespace}}
13 export { // expected-note {{export block begins here}}
15 export void f5() {} // expected-error {{export declaration appears within another export declaration}}
16 int A; // expected-error {{export declaration can only be used on functions}}
17 namespace ns { // expected-error {{export declaration can only be used on functions}}
22 export { // expected-note {{export block begins here}}
23 export { // expected-error {{export declaration appears within another export declaration}}
28 void export f7() {} // expected-error {{expected unqualified-id}}
30 export static void f8() {} // expected-error {{declaration of 'f8' with internal linkage cannot be exported}}
32 export void f9(); // expected-note {{previous declaration is here}}
33 static void f9(); // expected-error {{static declaration of 'f9' follows non-static declaration}}
35 static void f10(); // expected-note {{previous declaration is here}}
36 export void f10(); // expected-error {{cannot export redeclaration 'f10' here since the previous declaration has internal linkage}}
41 void f12(); // expected-note{{previous declaration is here}}
42 export void f12() {} // expected-error{{cannot export redeclaration 'f12' here since the previous declaration is not exported}}
44 export float V1; // expected-error {{export declaration can only be used on functions}}
46 static export float V2; // expected-error{{expected unqualified-id}}
48 export static float V3 = 0; // expected-error {{export declaration can only be used on functions}}
50 export groupshared float V4; // expected-error {{export declaration can only be used on functions}}
53 export int i; // expected-error {{expected expression}}
56 export cbuffer CB { // expected-error {{export declaration can only be used on functions}}
60 export template<typename T> void tf1(T t) {} // expected-error {{export declaration can only be used on functions}}
62 void f5() export {} // expected-error {{expected function body after function declarator}}