Files
clang-p2996/clang/test/ParserHLSL/group_shared.hlsl
Chris B 2222e27d9e [HLSL] Add HLSL 202y language mode (#108437)
This change adds a new HLSL 202y language mode. Currently HLSL 202y is
planned to add `auto` and `constexpr`.

This change updates extension diagnostics to state that lambadas are a
"clang HLSL" extension (since we have no planned release yet to include
them), and that `auto` is a HLSL 202y extension when used in earlier
language modes.

Note: This PR does temporarily work around some differences between HLSL
2021 and 202x in Clang by changing test cases to explicitly specify
202x. A subsequent PR will update 2021's language flags to match 202x.
2024-09-13 16:11:19 -05:00

14 lines
513 B
HLSL

// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -std=hlsl202x -o - -fsyntax-only %s -verify
extern groupshared float f;
extern float groupshared f; // Ok, redeclaration?
// expected-warning@#gs_lambda {{lambdas are a clang HLSL extension}}
// expected-error@#gs_lambda {{expected body of lambda expression}}
// expected-warning@#gs_lambda {{'auto' type specifier is a HLSL 202y extension}}
auto l = []() groupshared {}; // #gs_lambda
float groupshared [[]] i = 12;
float groupshared const i2 = 12;