[clang] [SystemZ][z/OS] Add visibility features for z/OS (eg. _Export, pragma export) (PR #111035)

Hubert Tong via cfe-commits cfe-commits at lists.llvm.org
Fri May 9 14:47:53 PDT 2025


================
@@ -4504,6 +4504,11 @@ void Parser::ParseDeclarationSpecifiers(
       isInvalid = DS.setFunctionSpecNoreturn(Loc, PrevSpec, DiagID);
       break;
 
+    case tok::kw__Export:
+      // We're done with the declaration-specifiers.
+      goto DoneWithDeclSpec;
----------------
hubert-reinterpretcast wrote:

`_Export` is not really a declaration specifier (at least in the traditional implementation).
It is more like a C++11 attribute except that it lives on the left of a _declarator-id_ instead of on the right.
In some realizations, the (less clean) conceptual model is that it is a declarator like `*` is, except it binds more strongly than `(<function parameters>)` or `[<array bound>]`.

@perry-ca, I don't see any test in this PR for `_Export` in positions like:
```cpp
int (*_Export x)(void) = 0;
```

Is the above accepted with this PR? Which conceptual model is being implemented here?

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


More information about the cfe-commits mailing list