Bug 17407 – [REG2.067] __traits(compiles) triggers assertion failure

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-05-18T12:20:00Z
Last change time
2017-08-07T13:16:19Z
Keywords
CTFE, ice
Assigned to
nobody
Creator
mathias.lang

Comments

Comment #0 by mathias.lang — 2017-05-18T12:20:32Z
``` bool foo () { void delegate ( ) longest_convert; return __traits(compiles, longest_convert = &doesNotExists); } static assert(!foo); ``` This code result in an assertion failure with DMD v2.075.0-devel-f234dde37 (master) and probably earlier. The assertion in question is https://github.com/dlang/dmd/blob/f234dde373acc2d6b4c32656c13edba764a925a5/src/ddmd/dinterpret.d#L7125 It only shows up with a debug build of DMD, as release builds don't have `assert` on.
Comment #1 by bugzilla — 2017-05-18T18:49:01Z
Comment #2 by github-bugzilla — 2017-05-23T07:13:41Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/ed8e853224800282396df5dd6b5dc1ae9e0db5b2 fix Issue 17407 - [REG] __traits(compiles) triggers assertion failure https://github.com/dlang/dmd/commit/cf2f95461ae6e16e786232777162cf62b7da04ce Merge pull request #6807 from WalterBright/fix17407 fix Issue 17407 - [REG] __traits(compiles) triggers assertion failure merged-on-behalf-of: Martin Nowak <[email protected]>
Comment #3 by github-bugzilla — 2017-05-23T22:45:32Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/ed8e853224800282396df5dd6b5dc1ae9e0db5b2 fix Issue 17407 - [REG] __traits(compiles) triggers assertion failure https://github.com/dlang/dmd/commit/cf2f95461ae6e16e786232777162cf62b7da04ce Merge pull request #6807 from WalterBright/fix17407
Comment #4 by github-bugzilla — 2017-08-07T13:16:19Z
Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/ed8e853224800282396df5dd6b5dc1ae9e0db5b2 fix Issue 17407 - [REG] __traits(compiles) triggers assertion failure https://github.com/dlang/dmd/commit/cf2f95461ae6e16e786232777162cf62b7da04ce Merge pull request #6807 from WalterBright/fix17407