Skip to content

Commit

Permalink
Merge pull request #3950 from 9rnsr/fix13417
Browse files Browse the repository at this point in the history
[REG2.066] Issue 13417 - segmentation fault when deduce template type
  • Loading branch information
WalterBright authored and 9rnsr committed Sep 7, 2014
1 parent 03800d0 commit 37b1552
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/template.c
Expand Up @@ -4057,6 +4057,7 @@ MATCH deduceType(RootObject *o, Scope *sc, Type *tparam, TemplateParameters *par
// (it may be from a parent template, for example)
}

e2 = e2->semantic(sc); // Bugzilla 13417
e2 = e2->ctfeInterpret();

//printf("e1 = %s, type = %s %d\n", e1->toChars(), e1->type->toChars(), e1->type->ty);
Expand Down
17 changes: 17 additions & 0 deletions test/runnable/template9.d
Expand Up @@ -4192,6 +4192,23 @@ MinType13379!T min13379(T...)(T args) // #4 MinType!uint (speculative && thist
return cast(typeof(return)) (a < b ? a : b);
}

/******************************************/
// 13417

struct V13417(size_t N, E, alias string AS)
{
}

auto f13417(E)(in V13417!(4, E, "ijka"))
{
return V13417!(3, E, "xyz")();
}

void test13417()
{
f13417(V13417!(4, float, "ijka")());
}

/******************************************/

int main()
Expand Down

0 comments on commit 37b1552

Please sign in to comment.