]> gcc.gnu.org Git - gcc.git/commit
c++: Fix up __builtin_convertvector parsing
authorJakub Jelinek <jakub@redhat.com>
Sat, 26 Mar 2022 07:11:58 +0000 (08:11 +0100)
committerJakub Jelinek <jakub@redhat.com>
Tue, 10 May 2022 08:14:35 +0000 (10:14 +0200)
commit91cc882245d7d93876d34f4d4c2e425acf48c8bb
tree4e705781125be0dbc1c4ea714e93eec3dd8fafa8
parent125234a3b78138e22112bb3f207df987817b6818
c++: Fix up __builtin_convertvector parsing

Jonathan reported on IRC that we don't parse
__builtin_bit_cast (type, val).field
etc.
The problem is that for these 2 builtins we return from
cp_parser_postfix_expression instead of setting postfix_expression
to the cp_build_* value and falling through into the postfix regression
suffix handling loop.

2022-03-26  Jakub Jelinek  <jakub@redhat.com>

* parser.c (cp_parser_postfix_expression)
<case RID_BILTIN_CONVERTVECTOR>: Don't
return cp_build_vec_convert result right away, instead
set postfix_expression to it and break.

* c-c++-common/builtin-convertvector-3.c: New test.

(cherry picked from commit 1806829e08f14e4cacacec43d7845cc2dad2ddc8)
gcc/cp/parser.c
gcc/testsuite/c-c++-common/builtin-convertvector-3.c [new file with mode: 0644]
This page took 0.056578 seconds and 6 git commands to generate.