D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20011 - [REG] modification of member of a manifest constant that's also a struct is allowed
Summary: [REG] modification of member of a manifest constant that's also a struct is a...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: accepts-invalid, pull
Depends on:
Blocks:
 
Reported: 2019-06-29 18:06 UTC by basile-z
Modified: 2019-07-07 08:14 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description basile-z 2019-06-29 18:06:42 UTC
This is invalid code is not rejected anymore in latest ~master

---
struct Content{ubyte parts;}

void main(){
    enum Content content = {};
    content.parts = 2;
} 
---
Comment 1 Walter Bright 2019-06-29 22:34:14 UTC
Regression caused by https://github.com/dlang/dmd/pull/9505
Comment 2 Dlang Bot 2019-06-30 13:59:29 UTC
@Basile-z created dlang/dmd pull request #10115 "fix issue 20011, fix issue 17828 - crash or accept write operation on members of manifest constant structs" fixing this issue:

- fix issue 20011, fix issue 17828 - crash or accept write operation on members of manifest constant structs

https://github.com/dlang/dmd/pull/10115
Comment 3 Dlang Bot 2019-07-07 08:14:35 UTC
dlang/dmd pull request #10115 "fix issue 20011, 17828 - crash or accept write operation on members of manifest constant structs" was merged into stable:

- 44469ba0c915f2cc9f017f01a8a738219a130c51 by Basile Burg:
  fix issue 20011, 17828 - crash or accept write operation on members of manifest constant structs

https://github.com/dlang/dmd/pull/10115