Bug 6107 – ICE(expression.c) when a non-template member named '__ctor' exists in a struct, and the constructor is attempted to be invoked.

Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-06-05T00:52:00Z
Last change time
2015-06-17T21:01:57Z
Keywords
ice
Assigned to
nobody
Creator
kennytm

Comments

Comment #0 by kennytm — 2011-06-05T00:52:47Z
Test case: ---------------------------------- struct Foo { enum __ctor = 4; // can also be a function, struct, alias, but template is ok. } void main() { auto f = Foo("irrelevant"); // can also use 'new Foo(...)' } ---------------------------------- Assertion failed: (td), function semantic, file expression.c, line 7040. Abort trap ----------------------------------
Comment #1 by bugzilla — 2012-01-20T22:38:15Z
Names beginning with a double underscore are reserved for the compiler's use.
Comment #2 by andrej.mitrovich — 2013-01-10T07:14:02Z
(In reply to comment #1) > Names beginning with a double underscore are reserved for the compiler's use. Should we implement some kind of identifier checks in the front-end? We could gather all double-underscore symbols the compiler uses and just compare them when instantiating Identifier from user-code. Unless the compiler also generates these symbols with random names, in such a case we would have to ban all double-underscores identifiers in user-code because they might potentially clash.
Comment #3 by bugzilla — 2013-10-05T12:15:20Z
Comment #4 by github-bugzilla — 2013-10-08T21:27:55Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/69d30ad53f5b136e4e79d552e69650d1a3f576b7 fix Issue 6107 - ICE(expression.c) when a non-template member named '__ctor' exists in a struct, and the constructor is attempted to be invoked. https://github.com/D-Programming-Language/dmd/commit/003af73463b8126e30613b6c125ce87c45b294c6 Merge pull request #2631 from WalterBright/fix6107 fix Issue 6107 - ICE(expression.c) when a non-template member named '__c...
Comment #5 by github-bugzilla — 2015-03-28T20:19:08Z
Comment #6 by github-bugzilla — 2015-06-17T21:01:57Z