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.
14 lines
513 B
HLSL
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;
|