c++: Fix ICE with xobj parms and maybe incomplete decl-specifiers
commit7318f1a389769ab540f414fcba743e90051d466b
authorNathaniel Shead <nathanieloshead@gmail.com>
Sat, 20 Apr 2024 04:44:11 +0000 (20 14:44 +1000)
committerNathaniel Shead <nathanieloshead@gmail.com>
Tue, 23 Apr 2024 23:24:17 +0000 (24 09:24 +1000)
tree8951496428cf42bcc5a29d85299e6b377444f865
parent628c2221d38715a64f828e3635317293d150e001
c++: Fix ICE with xobj parms and maybe incomplete decl-specifiers

This fixes a null dereference issue when decl_specifiers.type is not yet
provided.

gcc/cp/ChangeLog:

* parser.cc (cp_parser_parameter_declaration): Check if
decl_specifiers.type is null.

gcc/testsuite/ChangeLog:

* g++.dg/cpp23/explicit-obj-basic7.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
gcc/cp/parser.cc
gcc/testsuite/g++.dg/cpp23/explicit-obj-basic7.C [new file with mode: 0644]