-
Notifications
You must be signed in to change notification settings - Fork 15.9k
[HLSL] Add HLSL 202y language mode #108437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12397,6 +12397,9 @@ def warn_attr_min_eq_max: Warning< | |
| def err_hlsl_attribute_number_arguments_insufficient_shader_model: Error< | ||
| "attribute %0 with %1 arguments requires shader model %2 or greater">; | ||
|
|
||
| def ext_hlsl_auto_type_specifier : ExtWarn< | ||
| "'auto' type specifier is a HLSL 202y extension">, InGroup<HLSL202y>; | ||
|
||
|
|
||
| // Layout randomization diagnostics. | ||
| def err_non_designated_init_used : Error< | ||
| "a randomized struct can only be initialized with a designated initializer">; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1347,6 +1347,8 @@ ExprResult Parser::ParseLambdaExpressionAfterIntroducer( | |
| Diag(LambdaBeginLoc, getLangOpts().CPlusPlus11 | ||
| ? diag::warn_cxx98_compat_lambda | ||
| : diag::ext_lambda); | ||
| if (getLangOpts().HLSL) | ||
| Diag(LambdaBeginLoc, diag::ext_hlsl_lambda); | ||
|
||
|
|
||
| PrettyStackTraceLoc CrashInfo(PP.getSourceManager(), LambdaBeginLoc, | ||
| "lambda expression parsing"); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this warning default to error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I think we should just allow and warn on using extensions, that matches generally how Clang handles them unless you pass
-pedantic-errorswhich switches all the extension warnings to errors.