Bug 11856 – DMD segfault with circular template constraints

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-01T07:14:35Z
Last change time
2020-03-21T03:56:41Z
Keywords
ice, pull
Assigned to
No Owner
Creator
Peter Alexander

Comments

Comment #0 by peter.alexander.au — 2014-01-01T07:14:35Z
struct A {} void f(T)(T x) if (is(typeof(x.g()))) {} void g(T)(T x) if (is(typeof(x.f()))) {} void main() { A().g(); } Attempting to compile with default flags causes segfault.
Comment #1 by timon.gehr — 2016-09-03T09:18:38Z
Another case: int f(T)(T t) if(!__traits(compiles,.f!T)) { return 0; } int f(T)(T t) if(!__traits(compiles,.f!T)) { return 1; } enum x=f(2);
Comment #2 by dlang-bot — 2019-07-21T09:54:49Z
@Basile-z created dlang/dmd pull request #10205 "fix issue 11856 - segfault with circular template constraints" fixing this issue: - fix issue 11856 - segfault with circular template constraints https://github.com/dlang/dmd/pull/10205
Comment #3 by dlang-bot — 2019-07-21T11:20:43Z
dlang/dmd pull request #10205 "fix issue 11856 - segfault with circular template constraints" was merged into stable: - f93ec135b7af7c249ad60e272467514a9d0891cf by Basile Burg: fix issue 11856 - segfault with circular template constraints https://github.com/dlang/dmd/pull/10205
Comment #4 by dlang-bot — 2019-07-29T23:53:45Z
dlang/dmd pull request #10239 "redo fix for issue 11856: segfault with circular template constraints" was merged into stable: - 121b29b160972349e36cf358e4d82f3660f4dc7d by Rainer Schuetze: redo fix for issue 11856: segfault with circular template constraints reverts most of PR 10205, now fixing the existing recursion check. https://github.com/dlang/dmd/pull/10239