www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2251] New: Variadic templates and auto return types don't work together.

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

           Summary: Variadic templates and auto return types don't work
                    together.
           Product: D
           Version: 2.017
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: dsimcha yahoo.com


It seems that one cannot use both variadic templates tuple parameters and auto
return types in the same template function.  Consider the following functions:

/*If instantiated with any of several types I tried, compile time error: 
Assertion failure: '0' on line 847 in file 'glue.c'*/

auto foo(T...)(T dummyInput) {  
    int i = 1;
    return i;
}

//Works.
int bar(T...)(T dummyInput) {
    int i = 1;
    return i;
}

//Works.
auto baz(T)(T dummyInput) {
    int i = 1;
    return i;
}


-- 
Jul 28 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2251


dsimcha yahoo.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
            Summary|Variadic templates and auto |ICE:  Variadic templates and
                   |return types don't work     |auto return types don't work
                   |together.                   |together.





Adding ice-on-valid-code keyword, now that I realize what that stands for.


-- 
Jul 28 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2251


dsimcha yahoo.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |samukha voliacable.com





*** Bug 2349 has been marked as a duplicate of this bug. ***


-- 
Sep 08 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2251






Possibly related to http://d.puremagic.com/issues/show_bug.cgi?id=854 ?


-- 
Mar 29 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2251


dsimcha yahoo.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com





*** Bug 2863 has been marked as a duplicate of this bug. ***


-- 
May 04 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2251






Bug 854 is very closely related to this and has had a patch for a while that
probably fixes this one, too.  Please apply.


-- 
May 04 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2251


David Simcha <dsimcha yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrei metalanguage.com





---
*** Issue 2982 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: -------
May 16 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2251


Don <clugdbug yahoo.com.au> changed:

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





Fixed DMD 2.031

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






---
This one missed the changelog somehow.  Please update.  Anyhow, thanks for the
fix.

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