-
Notifications
You must be signed in to change notification settings - Fork 722
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sema: fix string literal allowed in templates (#6920)
String literal are not supported in HLSL, except in the special printf case. Most cases were handled, but not the templated function case. Fixes #6877 Signed-off-by: Nathan Gauër <[email protected]>
- Loading branch information
Showing
3 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// RUN: %dxc -T cs_6_0 -verify %s | ||
|
||
template<typename T> | ||
void take_string(T s) { | ||
} | ||
|
||
[numthreads(1, 1, 1)] | ||
void main() { | ||
take_string("toto"); /* expected-error {{string literals parameters are not supported in HLSL}} */ | ||
|
||
// Fine. | ||
printf("toto"); | ||
} |