Skip to content
This repository has been archived by the owner on Jun 20, 2019. It is now read-only.

Commit

Permalink
Merge fix from upstream.
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuclaw committed Apr 9, 2013
1 parent fec4b87 commit c6e1377
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gcc/d/dfrontend/cast.c
Expand Up @@ -2491,13 +2491,15 @@ int typeMerge(Scope *sc, Expression *e, Type **pt, Expression **pe1, Expression
{
e2 = e2->castTo(sc, t1);
t2 = t1;
t = t1;
goto Lagain;
}
else if (t2->ty == Tvector && t1->ty != Tvector &&
e1->implicitConvTo(t2))
{
e1 = e1->castTo(sc, t2);
t1 = t2;
t = t1;
goto Lagain;
}
else if (t1->isintegral() && t2->isintegral())
Expand Down
13 changes: 13 additions & 0 deletions gcc/testsuite/gdc.test/runnable/testxmm.d
Expand Up @@ -1149,6 +1149,18 @@ void test9304()

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

void test9910()
{
float4 f = [1, 1, 1, 1];
auto works = f + 3;
auto bug = 3 + f;

assert (works.array == [4,4,4,4]);
assert (bug.array == [4,4,4,4]); // no property 'array' for type 'int'
}

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

int main()
{
test1();
Expand All @@ -1175,6 +1187,7 @@ int main()
test7413_2();
// test9200();
test9304();
test9910();

return 0;
}
Expand Down

0 comments on commit c6e1377

Please sign in to comment.