www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1144] New: template mixin causes DMD crash

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1144

           Summary: template mixin causes DMD crash
           Product: D
           Version: 1.012
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: CppCoder gmail.com


template testHelper( A ... )
{
        char []testHelper()
        {
                char []result;
                foreach(  t; a )
                {
                        result ~= "int " ~ t ~ ";\r\n";
                }
                return result;
        }
}

template test( A ... )
{
        const char []test = testHelper( A );
}

int main( char [][]args )
{
        mixin( test!( "hello", "world" ) );
        return 0;
}


-- 
Apr 14 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1144


thomas-dloop kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows                     |All




------- Comment #1 from thomas-dloop kuehne.cn  2007-04-23 12:56 -------
Added to DStress as
http://dstress.kuehne.cn/nocmpile/m/mixin_34_A.d


-- 
Apr 23 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1144


bugzilla digitalmars.com changed:

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




------- Comment #2 from bugzilla digitalmars.com  2007-04-27 14:57 -------
Fixed DMD 1.014


-- 
Apr 27 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1144


clugdbug yahoo.com.au changed:

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




------- Comment #3 from clugdbug yahoo.com.au  2009-04-19 03:36 -------
This is fixed in DMD2.028 but not in 1.042.

Assertion failure: 'i < parameters->dim' on line 806 in file 'template.c'


-- 
Apr 19 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1144


Don <clugdbug yahoo.com.au> changed:

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


--- Comment #4 from Don <clugdbug yahoo.com.au> 2009-09-12 11:58:52 PDT ---
This is the test case which is failing in dstress:

char[] testHelper(A ...)(){
   char[] result;
         foreach(t; a){
             result ~= "int " ~ t ~ ";\n";
         }
         return result;
}

     int main(){
         mixin( testHelper!( "hello", "world" )() );
         return 0;
     }

Note that in the foreach(), it's 'a' instead of 'A'. So it's a bad test, which
is actually an instance of bug 2229 (which I've just patched). The bug here was
indeed fixed in 1.014.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 12 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1144


Robert Clipsham <robert octarineparrot.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |robert octarineparrot.com
            Version|1.012                       |1.051
         Resolution|FIXED                       |
           Severity|normal                      |regression


--- Comment #5 from Robert Clipsham <robert octarineparrot.com> 2009-11-07
07:52:58 PST ---
The dstress test is failing again in dmd 1051:
dmd: template.c:4017: Identifier* TemplateInstance::genIdent(): Assertion `0'
failed.

That DStress case is correct, it's in nocompile/, so shouldn't compile.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 07 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1144


Robert Clipsham <robert octarineparrot.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nfxjfg gmail.com


--- Comment #6 from Robert Clipsham <robert octarineparrot.com> 2009-11-07
07:54:22 PST ---
*** Issue 3482 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 07 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1144


Don <clugdbug yahoo.com.au> changed:

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


--- Comment #7 from Don <clugdbug yahoo.com.au> 2009-11-07 14:49:53 PST ---
(In reply to comment #5)
 The dstress test is failing again in dmd 1051:
 dmd: template.c:4017: Identifier* TemplateInstance::genIdent(): Assertion `0'
 failed.
 
 That DStress case is correct, it's in nocompile/, so shouldn't compile.

Yes, but it's testing bug 2229, not the one which was originally reported here. I'm closing this one, and re-opening the other. BTW it's not a regression. Bug 2229 was never fixed properly. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 07 2009