Bug 2251 – ICE(glue.c): Variadic templates and auto return types don't work together.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2008-07-28T13:17:00Z
Last change time
2015-06-09T01:19:59Z
Keywords
ice-on-valid-code
Assigned to
nobody
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2008-07-28T13:17:26Z
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; }
Comment #1 by dsimcha — 2008-07-28T19:54:52Z
Adding ice-on-valid-code keyword, now that I realize what that stands for.
Comment #2 by dsimcha — 2008-09-08T12:49:56Z
*** Bug 2349 has been marked as a duplicate of this bug. ***
Comment #3 by dsimcha — 2009-03-29T18:00:03Z
Comment #4 by dsimcha — 2009-05-04T21:41:55Z
*** Bug 2863 has been marked as a duplicate of this bug. ***
Comment #5 by dsimcha — 2009-05-04T21:44:41Z
Bug 854 is very closely related to this and has had a patch for a while that probably fixes this one, too. Please apply.
Comment #6 by dsimcha — 2009-05-16T12:46:56Z
*** Issue 2982 has been marked as a duplicate of this issue. ***
Comment #7 by clugdbug — 2009-07-07T08:11:18Z
Fixed DMD 2.031
Comment #8 by dsimcha — 2009-07-09T12:36:54Z
This one missed the changelog somehow. Please update. Anyhow, thanks for the fix.