Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Issue 15490 - Error variable __nrvoretval cannot be modified at c…
…ompile time when using -inline CTFE interpretr can recognize a form `CommaExp(DeclaraationExp(v), VarExp(v))` as a CTFEable variable declaration when `v._init` is `null`. In other cases, for examle a sole `DeclarationExp` should have v._init for CTFE-ability. Supply `VoidInitializer` to allow inlining the temporary for NRVO.
- Loading branch information
Showing
5 changed files
with
38 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,8 @@ | ||
module imports.imp15490a; | ||
|
||
import imports.imp15490b; | ||
|
||
void listenTCP() | ||
{ | ||
enum r = regex(); | ||
} |
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,12 @@ | ||
module imports.imp15490b; | ||
|
||
int regex() | ||
{ | ||
return regexImpl(); | ||
} | ||
|
||
auto regexImpl() | ||
{ | ||
int r = 0; | ||
return r; | ||
} |
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,12 @@ | ||
// REQUIRED_ARGS: -o- -inline | ||
// PERMUTE_ARGS: | ||
module test15490; | ||
|
||
import imports.imp15490a; | ||
import imports.imp15490b; | ||
|
||
void main() | ||
{ | ||
regex(); | ||
listenTCP(); | ||
} |