-
-
Notifications
You must be signed in to change notification settings - Fork 597
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Issue 16627 - non-static structs with postblit/dtor fields now ne…
…sted - Since #5500 buildPostblit/Dtor/OpAssign are run before the struct size is finalized, thereby now making structs nested that previously were not. - Not sure if the old behavior was an intended feature. If not we might want to deprecate it.
- Loading branch information
1 parent
2ef2272
commit 868ce84
Showing
3 changed files
with
24 additions
and
1 deletion.
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,18 @@ | ||
void test() | ||
{ | ||
int a; | ||
|
||
struct Field | ||
{ | ||
this(this) { ++a; } | ||
~this() { --a; } | ||
} | ||
|
||
struct S | ||
{ | ||
Field field; // generates __fieldPostblit, __fieldDtor, and opAssign | ||
} | ||
|
||
static assert(__traits(isNested, Field)); | ||
static assert(!__traits(isNested, S)); | ||
} |