www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3429] New: Core dump on passing template literal to member function.

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

           Summary: Core dump on passing template literal to member
                    function.
           Product: D
           Version: 2.035
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dsimcha yahoo.com


--- Comment #0 from David Simcha <dsimcha yahoo.com> 2009-10-20 18:22:13 PDT ---
struct Foo {
    void doStuff(alias fun)() {}
}

void main() {
    Foo foo;
    foo.doStuff!( (i) { return i; })();
}

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



--- Comment #1 from Don <clugdbug yahoo.com.au> 2009-10-21 02:26:17 PDT ---
Looks very similar to bug 2325 (but 2325 is D1-only). Probably has the same 
root cause.

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


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |clugdbug yahoo.com.au


--- Comment #2 from Don <clugdbug yahoo.com.au> 2009-10-21 03:24:08 PDT ---
This one is trivial. 
PATCH: template.c, line 4139. d needs to be initialized BEFORE the goto,
because it is used in the error message.

        Declaration *d = NULL;
        TemplateDeclaration *td = sa->isTemplateDeclaration();
+        d = sa->isDeclaration();
        if (td && td->literal)
        {
        goto L2;
        }
-        d = sa->isDeclaration();
        if (d && !d->isDataseg() &&
#if DMDV2
        !(d->storage_class & STCmanifest) &&
#endif
        (!d->isFuncDeclaration() || d->isFuncDeclaration()->isNested()) &&
        !isTemplateMixin())
        {        
         L2:


Actually, I'm not sure why this goto is even there. It could just be a clause
in the 'if' statement!

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


Kosmonaut <Kosmonaut tempinbox.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Kosmonaut tempinbox.com


--- Comment #3 from Kosmonaut <Kosmonaut tempinbox.com> 2009-10-31 21:39:12 PDT
---
Relevant SVN repository: http://www.dsource.org/projects/dmd/changeset/231

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


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


--- Comment #4 from Walter Bright <bugzilla digitalmars.com> 2009-11-06
11:35:00 PST ---
Fixed dmd 2.036

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