[clang] [HLSL] Implement `export` keyword (PR #96823)

Damyan Pepper via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 1 11:20:59 PDT 2024


================
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - %s -verify
+
+export void f1();
+
+export void f1() {}
+
+namespace { // expected-note {{anonymous namespace begins here}}
+    export void f2(); // expected-error {{export declaration appears within anonymous namespace}}
+}
+
+export void f3();
+
+export { // expected-note {{export block begins here}}
+    void f4() {}
+    export void f5() {} // expected-error {{export declaration appears within another export declaration}}
----------------
damyanp wrote:

What's the rationale for prohibiting nested exports?

I notice that C++ allows nested `extern 'C'`s, for example.

https://github.com/llvm/llvm-project/pull/96823


More information about the cfe-commits mailing list