]> git.draconx.ca Git - cdecl99.git/commit
libcdecl: Fix regression in function parsing.
authorNick Bowler <nbowler@draconx.ca>
Thu, 6 Jul 2023 06:15:35 +0000 (02:15 -0400)
committerNick Bowler <nbowler@draconx.ca>
Fri, 7 Jul 2023 00:27:21 +0000 (20:27 -0400)
commitbcde46a8503359755ca72fe581a18f7a3bcaaf37
tree6313129c31d06d49272d846ad631468f9e6b6841
parentc733aff6d0b2b107c88e37a1491f270db0634819
libcdecl: Fix regression in function parsing.

Merging the reduce_parentheses and simplify_functions step missed a case
where the function simplification could pull a fake function declarator
up to the current tree position.  Continuing the tree traversal will miss
this, leaving the fake parameter in the tree (which is then rejected as
a syntax error later).

The fix is easy enough, just repeat the whole reduction step until no
changes are needed at the current position before continuing traversal.

Add a new test case that targets this behaviour.
src/parse-decl.c
tests/decl-good.at