[clang] [HLSL] Implement `export` keyword (PR #96823)
Helena Kotas via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 1 13:55:12 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}}
----------------
hekota wrote:
Each export creates a new ExportDecl node in the AST three and limiting it to just one make it cleaner. I am not aware of any specific reason other than maybe this and to keep the syntax and parsing code identical to C++ modules export.
https://github.com/llvm/llvm-project/pull/96823
More information about the cfe-commits
mailing list