D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 17407 - [REG2.067] __traits(compiles) triggers assertion failure
Summary: [REG2.067] __traits(compiles) triggers assertion failure
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: CTFE, ice
Depends on:
Blocks:
 
Reported: 2017-05-18 12:20 UTC by Mathias Lang
Modified: 2017-08-07 13:16 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Mathias Lang 2017-05-18 12:20:32 UTC
```
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 Walter Bright 2017-05-18 18:49:01 UTC
https://github.com/dlang/dmd/pull/6807
Comment 2 github-bugzilla 2017-05-23 07:13:41 UTC
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 <code@dawg.eu>
Comment 3 github-bugzilla 2017-05-23 22:45:32 UTC
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 github-bugzilla 2017-08-07 13:16:19 UTC
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