Skip to content

Commit

Permalink
Merge pull request #2916 from ibuclaw/issue11371
Browse files Browse the repository at this point in the history
Issue 11371 - [CTFE] vector literals are not valid values
  • Loading branch information
WalterBright committed Dec 3, 2013
2 parents dfb43d5 + 19599cb commit f3f0b2b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ctfeexpr.c
Expand Up @@ -2065,6 +2065,9 @@ bool isCtfeValueValid(Expression *newval)
if (newval->op == TOKfunction)
return true; // function literal or delegate literal

if (newval->op == TOKvector)
return true; // vector literal

if (newval->op == TOKdelegate)
{
Expression *dge = ((DelegateExp *)newval)->e1;
Expand Down
11 changes: 11 additions & 0 deletions test/compilable/test11371.d
@@ -0,0 +1,11 @@

version(D_SIMD)
{
__vector(long[2]) f()
{
__vector(long[2]) q;
return q;
}

enum __vector(long[2]) v = f();
}

0 comments on commit f3f0b2b

Please sign in to comment.