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. ***