https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120663
Bug ID: 120663 Summary: [OpenMP]ICE Segmentation fault with auto function parameter and '-fopenmp' Product: gcc Version: 16.0 Status: UNCONFIRMED Keywords: ice-checking, ice-on-invalid-code, openmp Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: rush102333 at gmail dot com Target Milestone: --- $cat test_3274.cpp template <typename T> void foo (const T &x) { [&] (auto &&y) { #pragma omp parallel for for (this const &, auto &&[v1, v2] : x) ; } } $g++ -fsyntax-only -fopenmp test_3274.cpp <source>: In lambda function: <source>:7:10: error: expected declaration before 'this' [-Wtemplate-body] 7 | for (this const &, auto &&[v1, v2] : x) | ^~~~ <source>:7:10: error: expected ':' before 'this' [-Wtemplate-body] 7 | for (this const &, auto &&[v1, v2] : x) | ^~~~ | : <source>:7:10: internal compiler error: Segmentation fault 7 | for (this const &, auto &&[v1, v2] : x) | ^~~~ 0x2833015 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t) ???:0 0x28547a6 internal_error(char const*, ...) ???:0 0xd05f53 c_parse_file() ???:0 0xe6db59 c_common_parse_file() ???:0 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. Compiler returned: 1 Please see https://godbolt.org/z/4cYzqMcKM