[Issue 11553] dmd segfault with recursive template

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 7 02:31:31 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=11553


Kenji Hara <k.hara.pg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |regression


--- Comment #7 from Kenji Hara <k.hara.pg at gmail.com> 2014-01-07 02:31:10 PST ---
(In reply to comment #0)
> An example that is clearly wrong code, but segfaults the compiler on
> Scope::push
> 
> template A(alias T)
> {
>     template A()
>     {
>     alias A = T!();
>     }
> }
> alias B() = A!(.B);
> 
> static if(A!B){}

With 2.063, following equivalent code did not cause segfault.

template A(alias T)
{
    template A()
    {
        alias A = T!();
    }
}
template B() { alias B = A!(.B); }
static if (A!B) {}  // Line 9

Output:
test.d(9): Error: expression template A() of type void does not have a boolean
value

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list