Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4084 from 9rnsr/fix13601
[REG2.064] Issue 13601 - static if (__ctfe) should emit error
- Loading branch information
Showing
4 changed files
with
34 additions
and
4 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
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,17 @@ | ||
/* | ||
TEST_OUTPUT: | ||
--- | ||
fail_compilation/fail13601.d(13): Error: variable __ctfe cannot be read at compile time | ||
fail_compilation/fail13601.d(14): Error: variable __ctfe cannot be read at compile time | ||
fail_compilation/fail13601.d(15): Error: variable __ctfe cannot be read at compile time | ||
fail_compilation/fail13601.d(16): Error: variable __ctfe cannot be read at compile time | ||
--- | ||
*/ | ||
|
||
void test() | ||
{ | ||
static if (__ctfe) {} | ||
enum a = __ctfe ? "a" : "b"; | ||
static int b = __ctfe * 2; | ||
int[__ctfe] sarr; | ||
} |