diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2025-01-02 17:36:54 +0100 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2025-01-13 11:52:56 +0100 |
commit | 26b649b2d17dccf0f4c3c048f37c49660aad7f71 (patch) | |
tree | a1e7c0ffa9c6fadcffd5f8fb5955a8ab334c5b1f /gcc/expr.cc | |
parent | d3904a3ad9d7b4c8e5e536e5166b89548510fd48 (diff) | |
download | gcc-26b649b2d17dccf0f4c3c048f37c49660aad7f71.zip gcc-26b649b2d17dccf0f4c3c048f37c49660aad7f71.tar.gz gcc-26b649b2d17dccf0f4c3c048f37c49660aad7f71.tar.bz2 |
ada: Fix parsing of raise expressions with no parens
According to Ada grammar, raise expression is an expression, but requires
parens to be a simple_expression. We wrongly classified raise expressions
as expressions, because we mishandled a global state variable in the parser.
This patch causes some illegal code to be rejected.
gcc/ada/ChangeLog:
* par-ch4.adb (P_Relation): Prevent Expr_Form to be overwritten when
parsing the raise expression itself.
(P_Simple_Expression): Fix manipulation of Expr_Form.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions