diff --git a/src/cast.c b/src/cast.c index 094b915ba2ca..3c14c94f0857 100644 --- a/src/cast.c +++ b/src/cast.c @@ -193,6 +193,8 @@ MATCH IntegerExp::implicitConvTo(Type *t) if (t->ty == Tvector) { TypeVector *tv = (TypeVector *)t; TypeBasic *tb = tv->elementType(); + if (tb->ty == Tvoid) + goto Lno; toty = tb->ty; } diff --git a/test/fail_compilation/fail9301.d b/test/fail_compilation/fail9301.d new file mode 100644 index 000000000000..df040780e51b --- /dev/null +++ b/test/fail_compilation/fail9301.d @@ -0,0 +1,13 @@ +/* +REQUIRED_ARGS: -o- +PERMUTE_ARGS: +TEST_OUTPUT: +--- +fail_compilation/fail9301.d(12): Error: cannot implicitly convert expression (0) of type int to __vector(void[16]) +--- +*/ + +void main() +{ + __vector(void[16]) x = 0x0; +}