aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.cc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2023-03-02 09:02:12 +0100
committerJakub Jelinek <jakub@redhat.com>2023-03-02 09:06:58 +0100
commitf0ef740d54f47ff614eb02e13e8f4cb11dfbb140 (patch)
tree910ce6a610ee4dea1bd8f024efcd06138941305e /gcc/fold-const.cc
parenta2926653ebbc88e8bba335563fa86b44651598d6 (diff)
downloadgcc-f0ef740d54f47ff614eb02e13e8f4cb11dfbb140.zip
gcc-f0ef740d54f47ff614eb02e13e8f4cb11dfbb140.tar.gz
gcc-f0ef740d54f47ff614eb02e13e8f4cb11dfbb140.tar.bz2
openmp: Fix up error recovery for invalid structured bindings in OpenMP range for loops [PR105839]
The PR108503 temporary DECL_HAS_VALUE_EXPR_P clearing code can ICE during recovery, because cp_finish_decomp when it detects errors and reports them clears DECL_HAS_VALUE_EXPR_P, clears DECL_VALUE_EXPR and sets TREE_TYPE of the structured binding vars to error_mark_node. The PR108503 code had an assertion that DECL_HAS_VALUE_EXPR_P is set so that it can clear it and restore later. The following patch allows DECL_HAS_VALUE_EXPR_P to be unset if type is error_mark_node and doesn't set it again in that case. 2023-03-02 Jakub Jelinek <jakub@redhat.com> PR c++/105839 * parser.cc (cp_convert_omp_range_for): Allow in assert decomp_first_name without DECL_HAS_VALUE_EXPR_P if it has error_mark_node type. (cp_finish_omp_range_for): Don't set DECL_HAS_VALUE_EXPR_P back on decls which have error_mark_node type. * g++.dg/gomp/pr105839-1.C: New test. * g++.dg/gomp/pr105839-2.C: New test.
Diffstat (limited to 'gcc/fold-const.cc')
0 files changed, 0 insertions, 0 deletions