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 #5014 from 9rnsr/fix14992
Issue 14992 - static array local variables always require .init
- Loading branch information
Showing
6 changed files
with
74 additions
and
43 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
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,5 @@ | ||
module imports.a14992; | ||
|
||
struct S1 { } | ||
|
||
struct S2 { int v; int[] a; } |
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,22 @@ | ||
import imports.a14992; // do not link | ||
|
||
int test() | ||
{ | ||
S1 v1; // OK | ||
S1* p1; // OK | ||
S1[] da1; // OK | ||
S1[2] a1; // OK <- NG | ||
|
||
S2 v2; // OK | ||
S2* p2; // OK | ||
S2[] da2; // OK | ||
S2[2] a2; // OK <- NG | ||
|
||
return 1; | ||
} | ||
static assert(test()); | ||
|
||
void main() | ||
{ | ||
test(); | ||
} |