-
Notifications
You must be signed in to change notification settings - Fork 14.6k
[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>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we can't do it because of the different warning groups, but it'd be nice if this could reuse There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could share the string, but since we want different warning groups they do need to be different warnings. |
||
|
||
// 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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this will issue two warnings if someone specifies |
||
|
||
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-errors
which switches all the extension warnings to errors.