aboutsummaryrefslogtreecommitdiff
path: root/gcc/dwarf2ctf.cc
diff options
context:
space:
mode:
authorSandra Loosemore <sloosemore@baylibre.com>2025-05-26 19:21:48 +0000
committerSandra Loosemore <sloosemore@baylibre.com>2025-05-30 14:12:42 +0000
commitd67a38ca08298fbe2e18e938165bab4adfda7293 (patch)
treece66624e59e62b5d9295770103146a57e2c8053e /gcc/dwarf2ctf.cc
parentb368dd5de53fc981b5b20e2fd6d7de9116e82331 (diff)
downloadgcc-d67a38ca08298fbe2e18e938165bab4adfda7293.zip
gcc-d67a38ca08298fbe2e18e938165bab4adfda7293.tar.gz
gcc-d67a38ca08298fbe2e18e938165bab4adfda7293.tar.bz2
OpenMP: Fix ICE and other issues in C/C++ metadirective error recovery.
The new testcase included in this patch used to ICE in gcc after diagnosing the first error, and in g++ it only diagnosed the error in the first metadirective, ignoring the second one. The solution is to make error recovery in the C front end more like that in the C++ front end, and remove the code in both front ends that previously tried to skip all the way over the following statement (instead of just to the end of the metadirective pragma) after an error. gcc/c/ChangeLog * c-parser.cc (c_parser_skip_to_closing_brace): New, copied from the equivalent function in the C++ front end. (c_parser_skip_to_end_of_block_or_statement): Pass false to the error flag. (c_parser_omp_context_selector): Immediately return error_mark_node after giving an error that the integer trait property is invalid, similarly to C++ front end. (c_parser_omp_context_selector_specification): Likewise handle error return from c_parser_omp_context_selector similarly to C++. (c_parser_omp_metadirective): Do not call c_parser_skip_to_end_of_block_or_statement after an error. gcc/cp/ChangeLog * parser.cc (cp_parser_omp_metadirective): Do not call cp_parser_skip_to_end_of_block_or_statement after an error. gcc/testsuite/ChangeLog * c-c++-common/gomp/declare-variant-2.c: Adjust patterns now that C and C++ now behave similarly. * c-c++-common/gomp/metadirective-error-recovery.c: New. (cherry picked from commit 33b65e4d1c83808b54cd6b3fc97ebacc522b125d)
Diffstat (limited to 'gcc/dwarf2ctf.cc')
0 files changed, 0 insertions, 0 deletions