c++: ICE casting class to vector [PR100517]
authorJason Merrill <jason@redhat.com>
Tue, 11 May 2021 13:53:20 +0000 (09:53 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 11 May 2021 14:20:46 +0000 (10:20 -0400)
commit010d4a5047166037b316ed22331f3d99742f1f1d
tree3daa117b78d761fcb86f5f2e762b67ec48861ccb
parentdfdedc1a753ebaa68381638dd8a2bcd84de5ec9e
c++: ICE casting class to vector [PR100517]

My recent change to reject calling rvalue() with an argument of class type
crashes on this testcase, where we use rvalue() on what we expect to be an
argument of integer or vector type.  Fixed by checking first.

gcc/cp/ChangeLog:

PR c++/100517
* typeck.c (build_reinterpret_cast_1): Check intype on
cast to vector.

gcc/testsuite/ChangeLog:

PR c++/100517
* g++.dg/ext/vector41.C: New test.
gcc/cp/typeck.c
gcc/testsuite/g++.dg/ext/vector41.C [new file with mode: 0644]