Thread overview
[Issue 3293] New: A few more bugs with template mixins with identifiers
Sep 03, 2009
2korden@gmail.com
Sep 07, 2009
Don
Sep 07, 2009
Don
Sep 08, 2009
Don
[Issue 3293] ICE(expression.c) recursive alias template parameters
Sep 08, 2009
Don
Sep 11, 2009
Koroskin Denis
Nov 15, 2010
Don
September 03, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3293

           Summary: A few more bugs with template mixins with identifiers
           Product: D
           Version: 2.031
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-valid-code, rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: 2korden@gmail.com


template ReferenceType(T)
{
    alias T* ReferenceType;
}

struct SomeRange(T, alias Storage = 0)
{
    bool foo()
    {
        return guard == guard;    // bug 1: replace == with is and DMD crashes
with no output
    }

    enum guard = cast(ReferenceType!(T))SomeContainer!(T, Storage).guard;
}

struct SomeContainer(T, alias Storage = 0)
{
    auto opSlice()    // bug 2: replace auto with SomeRange!(T, Storage) and
get an ICE
    {
        return SomeRange!(T, Storage)();
    }

    enum ReferenceType!(T) guard =
cast(ReferenceType!(T))cast(void*)0xFEFEFEFE;    // bug 3: remove guard type
and DMD crashes with no output
}

class A
{
    SomeRange!(int, 0) test()    // bug 4: 0 is not omissible
    {
        return SomeContainer!(int)()[];
    }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 07, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3293


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug@yahoo.com.au


--- Comment #1 from Don <clugdbug@yahoo.com.au> 2009-09-07 03:18:35 PDT ---
(1) I can't see 'mixin' anywhere in any of these bugs!
(2) Cannot reproduce bug 3.
(3) Please don't report multiple bugs in a single bug report. There are
definitely at least 3 different bugs in here.
Bug 1 is Segfault(statement.c)
bug 2 is ICE(expression.c)
bug 4 is a rejects-valid.

It's possible they all have the same root cause, but I doubt it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 07, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3293



--- Comment #2 from Don <clugdbug@yahoo.com.au> 2009-09-07 08:29:30 PDT ---
Bug 1 is now its own issue, bug 3304.
Bug 3 is now its own issue, bug 3305.
They are completely unrelated to one another.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 08, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3293



--- Comment #3 from Don <clugdbug@yahoo.com.au> 2009-09-08 08:51:49 PDT ---
Here's a reduced test case for the second bug, which is ICE(expression.c).
Something to do with recursive alias parameters causing data corruption.
Only happens if there is an infinite template expansion, so I think this one is
ice-on-invalid-code. Somehow defining the return type as 'auto' circumvents the
infinite expansion -- but I'm not sure that it should.

---
alias const(void*) VoidPtr;

struct SomeRange(alias Storage){
    const guard = cast(const void *)Bug3293!(Storage).guard;
}

struct Bug3293(alias Storage){
    SomeRange!(Storage) foo;
    const VoidPtr guard = cast(void *)345;
}

SomeRange!(0)  a = Bug3293!(0)().foo;

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 08, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3293


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-valid-code,          |ice-on-invalid-code
                   |rejects-valid               |
            Summary|A few more bugs with        |ICE(expression.c) recursive
                   |template mixins with        |alias template parameters
                   |identifiers                 |


--- Comment #4 from Don <clugdbug@yahoo.com.au> 2009-09-08 13:30:18 PDT ---
And the fourth bug has been moved to bug 3307. I'm therefore changing the title to reflect the remaining bug, as described in comment 3.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 11, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3293



--- Comment #5 from Koroskin Denis <2korden@gmail.com> 2009-09-11 02:03:32 PDT ---
Thanks and sorry for confusion!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 15, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3293


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #6 from Don <clugdbug@yahoo.com.au> 2010-11-15 00:17:40 PST ---
Fixed DMD2.047.

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