diff options
author | Jakub Jelinek <jakub@redhat.com> | 2022-12-19 20:55:56 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2022-12-19 20:55:56 +0100 |
commit | 4e4620d8c796af482b57b94932618d1f9d9af9f7 (patch) | |
tree | bc4a2a0333f66eb9484db68f0fb32724b12d146b /gcc/rust/backend | |
parent | 68e51bd0a85794cd437d3e740357dfef84dc560d (diff) | |
download | gcc-4e4620d8c796af482b57b94932618d1f9d9af9f7.zip gcc-4e4620d8c796af482b57b94932618d1f9d9af9f7.tar.gz gcc-4e4620d8c796af482b57b94932618d1f9d9af9f7.tar.bz2 |
c: Diagnose compound literals with function type [PR108043]
Both C99 and latest C2X say that compound literal shall have an object type
(complete object type in the latter case) or array of unknown bound,
so complit with function type is invalid. When the initializer had to be
non-empty for such case, we used to diagnose it as incorrect initializer,
but with (fntype){} now allowed we just ICE on it.
The following patch diagnoses that.
2022-12-19 Jakub Jelinek <jakub@redhat.com>
PR c/108043
* c-parser.cc (c_parser_postfix_expression_after_paren_type): Diagnose
compound literals with function type.
* gcc.dg/pr108043.c: New test.
* gcc.dg/c99-complit-2.c (foo): Adjust expected diagnostics for
complit with function type.
Diffstat (limited to 'gcc/rust/backend')
0 files changed, 0 insertions, 0 deletions