mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
Fix Bugzilla 24807 - Error message missing parens for template instance (#17015)
This commit is contained in:
parent
58e4136f47
commit
941a6e62ef
2 changed files with 19 additions and 1 deletions
|
@ -3796,7 +3796,8 @@ private void tiargsToBuffer(TemplateInstance ti, ref OutBuffer buf, ref HdrGenSt
|
||||||
}
|
}
|
||||||
else if (Expression e = isExpression(oarg))
|
else if (Expression e = isExpression(oarg))
|
||||||
{
|
{
|
||||||
if (e.op == EXP.int64 || e.op == EXP.float64 || e.op == EXP.null_ || e.op == EXP.string_ || e.op == EXP.this_)
|
if (!(e.type && e.type.isTypeEnum()) && e.op == EXP.int64 || e.op == EXP.float64 ||
|
||||||
|
e.op == EXP.null_ || e.op == EXP.string_ || e.op == EXP.this_)
|
||||||
{
|
{
|
||||||
toCBuffer(e, buf, hgs);
|
toCBuffer(e, buf, hgs);
|
||||||
return;
|
return;
|
||||||
|
|
17
compiler/test/fail_compilation/template_enum_param.d
Normal file
17
compiler/test/fail_compilation/template_enum_param.d
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
/*
|
||||||
|
TEST_OUTPUT:
|
||||||
|
---
|
||||||
|
fail_compilation/template_enum_param.d(15): Error: static assert: `false` is false
|
||||||
|
fail_compilation/template_enum_param.d(17): instantiated from here: `X!(E.a)`
|
||||||
|
---
|
||||||
|
*/
|
||||||
|
|
||||||
|
enum E
|
||||||
|
{
|
||||||
|
a,b,c
|
||||||
|
}
|
||||||
|
template X(E e)
|
||||||
|
{
|
||||||
|
static assert(false);
|
||||||
|
}
|
||||||
|
alias Y = X!(E.a);
|
Loading…
Add table
Add a link
Reference in a new issue