diff options
author | Xavier Leroy <xavierleroy@users.noreply.github.com> | 2022-05-09 14:39:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-09 14:39:51 +0200 |
commit | 1d572b330362711c808094333134ba94fcd7b768 (patch) | |
tree | cc6e0c7fdf4fe12f5e6d5099fa7adf3174a2d862 | |
parent | a4c98b19ccf5a72bfe551fd5b2f8689442a661a6 (diff) | |
download | compcert-1d572b330362711c808094333134ba94fcd7b768.tar.gz compcert-1d572b330362711c808094333134ba94fcd7b768.zip |
Fix the parsing of unprototyped function types in casts (#431)
Before, in casts, `int (*)()` was parsed like `int (*)(void)`.
This caused expressions like `((int (*)()) &f)(42)` to be rejected.
Declarations were correctly parsed.
-rw-r--r-- | cparser/Parser.vy | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cparser/Parser.vy b/cparser/Parser.vy index f1abe3d9..d489d339 100644 --- a/cparser/Parser.vy +++ b/cparser/Parser.vy @@ -720,9 +720,9 @@ direct_abstract_declarator: | LPAREN params = parameter_type_list RPAREN { Cabs.PROTO Cabs.JUSTBASE params } | typ = direct_abstract_declarator LPAREN RPAREN - { Cabs.PROTO typ ([], false) } + { Cabs.PROTO_OLD typ [] } | LPAREN RPAREN - { Cabs.PROTO Cabs.JUSTBASE ([], false) } + { Cabs.PROTO_OLD Cabs.JUSTBASE [] } (* 6.7.8 *) c_initializer: |