template f(A) {} void g(A)(A); f!({g("%s");}) _; causes: cc1d: internal compiler error: Segmentation fault 0xa81fef crash_signal ../../gcc/toplev.c:337 0x6e53eb verror(Loc, char const*, __va_list_tag*, char const*, char const*, char const*) ../../gcc/d/d-glue.cc:191 0x5b094d Dsymbol::error(char const*, ...) ../../gcc/d/dfrontend/dsymbol.c:633 0x68e723 TemplateInstance::findBestMatch(Scope*, Array<Expression*>*) ../../gcc/d/dfrontend/template.c:6377 0x692cf8 TemplateInstance::semantic(Scope*, Array<Expression*>*) ../../gcc/d/dfrontend/template.c:5317 0x692cf8 TemplateInstance::semantic(Scope*) ../../gcc/d/dfrontend/template.c:5202 0x6404fa TypeInstance::resolve(Loc, Scope*, Expression**, Type**, Dsymbol**, bool) ../../gcc/d/dfrontend/mtype.c:7284 0x6404fa TypeInstance::semantic(Loc, Scope*) ../../gcc/d/dfrontend/mtype.c:7301 0x5a27c9 VarDeclaration::semantic(Scope*) ../../gcc/d/dfrontend/declaration.c:884 0x649fbd Module::semantic() ../../gcc/d/dfrontend/module.c:744 0x69d293 d_parse_file() ../../gcc/d/d-lang.cc:1007 Please submit a full bug report,
Can not reproduce on current master. I get: bug143.d:3: error: template instance f!(function () { g("f(A)"); } ) does not match template declaration (null)
(In reply to Iain Buclaw from comment #1) > Can not reproduce on current master. I get: > > bug143.d:3: error: template instance f!(function () > { > g("f(A)"); > } > ) does not match template declaration (null) I only ran into this while reducing another testcase, so I don't have a better example. Note that it crashes _only_ when that string literal contains "%s" (or '%' followed by other chars), it seems that it tries to interpret it as a format string. If the output you got was from the original unmodified testcase then the error message is bogus - there's no "f(A)" string there. (That 'null' would also be an issue; IIRC I've seen that here too, while trying to figure out what was triggering the crash)
Ah right, I didn't bother reading the *actual* message contents.
https://github.com/D-Programming-GDC/GDC/commit/553a30c13d53e129159213cec329dcaff678ffbd