Created attachment 1411
gdb output
[code]
struct Vector(size_t N,E,alias string AS) { }
auto someFunc(E)( in Vector!(4,E,"ijka") ) { return Vector!(3,E,"xyz")(); }
void main() { someFunc( Vector!(4,float,"ijka")() ); }
[/code]
% dmd fnc.d
zsh: segmentation fault (core dumped) dmd fnc.d
if change line 3
[code]
void main() { someFunc!float( Vector!(4,float,"ijka")() ); }
[/code]
program compiles
% dmd -v
DMD64 D Compiler v2.066.0
Comment #1 by hsteoh — 2014-09-05T16:20:33Z
Hmm. What's an "alias string" supposed to do? I've never seen that before. Usually for passing compile-time strings, we just write "string". What did you wish to accomplish with "alias string"?
Comment #2 by hsteoh — 2014-09-05T16:21:28Z
Actually, that doesn't appear to be related to the problem. Removing "alias" still causes the compiler to crash...
Comment #3 by hsteoh — 2014-09-05T16:31:12Z
I managed to reduce the test case a little more:
------
struct Vector(string x, E) { }
void someFunc(E)(Vector!("", E)) { }
void main() {
someFunc(Vector!("", float)());
}
------
Here's the compiler stacktrace under gdb:
------
Program received signal SIGSEGV, Segmentation fault.
0x000000000047670a in ctfeInterpret(Expression*) ()
(gdb) bt
#0 0x000000000047670a in ctfeInterpret(Expression*) ()
#1 0x000000000045793a in deduceType(RootObject*, Scope*, Type*, Array<TemplateParameter*>*, Array<RootObject*>*, unsigned int*, unsigned long)::DeduceType::visit(TypeInstance*) ()
#2 0x0000000000456734 in deduceType(RootObject*, Scope*, Type*, Array<TemplateParameter*>*, Array<RootObject*>*, unsigned int*, unsigned long) ()
#3 0x0000000000457307 in deduceType(RootObject*, Scope*, Type*, Array<TemplateParameter*>*, Array<RootObject*>*, unsigned int*, unsigned long)::DeduceType::visit(TypeStruct*) ()
#4 0x000000000045a93d in deduceType(RootObject*, Scope*, Type*, Array<TemplateParameter*>*, Array<RootObject*>*, unsigned int*, unsigned long)::DeduceType::visit(Expression*) ()
#5 0x0000000000456717 in deduceType(RootObject*, Scope*, Type*, Array<TemplateParameter*>*, Array<RootObject*>*, unsigned int*, unsigned long) ()
#6 0x0000000000459238 in TemplateDeclaration::deduceFunctionTemplateMatch(TemplateInstance*, Scope*, FuncDeclaration*&, Type*, Array<Expression*>*) ()
#7 0x00000000004635ab in functionResolve(Match*, Dsymbol*, Loc, Scope*, Array<RootObject*>*, Type*, Array<Expression*>*)::ParamDeduce::fp(void*, Dsymbol*) ()
#8 0x00000000004f9d93 in overloadApply(Dsymbol*, void*, int (*)(void*, Dsymbol*)) ()
#9 0x0000000000462ebf in functionResolve(Match*, Dsymbol*, Loc, Scope*, Array<RootObject*>*, Type*, Array<Expression*>*) ()
#10 0x00000000004faabd in resolveFuncCall(Loc, Scope*, Dsymbol*, Array<RootObject*>*, Type*, Array<Expression*>*, int) ()
#11 0x00000000004e1839 in CallExp::semantic(Scope*) [clone .part.122] ()
#12 0x0000000000441d0b in ExpStatement::semantic(Scope*) ()
#13 0x000000000044683f in CompoundStatement::semantic(Scope*) ()
#14 0x00000000004fc94a in FuncDeclaration::semantic3(Scope*) ()
#15 0x0000000000407d48 in Module::semantic3() ()
#16 0x0000000000405484 in tryMain(unsigned long, char const**) ()
#17 0x00007ffff70b5eed in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#18 0x0000000000402c75 in _start ()
------