[HLSL] Adjust access specifier behavior
authorChris Bieneman <chris.bieneman@me.com>
Thu, 28 Apr 2022 15:13:20 +0000 (10:13 -0500)
committerChris Bieneman <chris.bieneman@me.com>
Thu, 28 Apr 2022 15:37:50 +0000 (10:37 -0500)
commit0d6b574b8717a44cda565baa756875f762fa60b9
treefba6193be8b1ee8e5fb3e744ff4b40cfb5700c47
parentbd30d4be2354f149fa6cb6d65fd95e6796951529
[HLSL] Adjust access specifier behavior

HLSL doesn't support access specifiers. This change has two components:

1) Make default access for classes public
2) Diagnose the use of access specifiers as a clang HLSL extension

As long as the default behavior for access specifiers matches HLSL,
allowing them to be used doesn't cause sourece incompatability with
valid code. As such enabling them as a clang extension seems like a
reasonable approach.

Fixes #55124

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D124487
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/lib/Parse/ParseDeclCXX.cpp
clang/lib/Sema/SemaDeclCXX.cpp
clang/test/ParserHLSL/access_specifiers.hlsl [new file with mode: 0644]