https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84430
Bug ID: 84430 Summary: [7/8 Regression] ICE with #pragma omp simd in lambda Product: gcc Version: 8.0 Status: UNCONFIRMED Keywords: ice-on-valid-code, openmp Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: reichelt at gcc dot gnu.org Target Milestone: --- The following valid code snippet (compiled with "-std=c++1z -fopenmp") triggers an ICE since GCC 7.1.0: ======================================= void foo() { []{ #pragma omp simd for (int i = 0; i < 10; ++i) ; }; } ======================================= bug.cc: In lambda function: bug.cc:7:3: sorry, unimplemented: unexpected AST of kind omp_simd }; ^ bug.cc:7:3: internal compiler error: in potential_constant_expression_1, at cp/constexpr.c:5993 0x857e92 potential_constant_expression_1 ../../gcc/gcc/cp/constexpr.c:5993 0x8975c6 finish_function(bool) ../../gcc/gcc/cp/decl.c:15671 0x8d83c2 finish_lambda_function(tree_node*) ../../gcc/gcc/cp/lambda.c:1384 0x91d8c1 cp_parser_lambda_body ../../gcc/gcc/cp/parser.c:10675 0x91d8c1 cp_parser_lambda_expression ../../gcc/gcc/cp/parser.c:10176 0x91d8c1 cp_parser_primary_expression ../../gcc/gcc/cp/parser.c:5257 0x9301bc cp_parser_postfix_expression ../../gcc/gcc/cp/parser.c:7026 0x930d90 cp_parser_unary_expression ../../gcc/gcc/cp/parser.c:8318 0x91117f cp_parser_cast_expression ../../gcc/gcc/cp/parser.c:9086 0x91198a cp_parser_binary_expression ../../gcc/gcc/cp/parser.c:9187 0x913164 cp_parser_assignment_expression ../../gcc/gcc/cp/parser.c:9476 0x913878 cp_parser_expression ../../gcc/gcc/cp/parser.c:9645 0x915538 cp_parser_expression_statement ../../gcc/gcc/cp/parser.c:11112 0x91b8ad cp_parser_statement ../../gcc/gcc/cp/parser.c:10916 0x91cdc0 cp_parser_statement_seq_opt ../../gcc/gcc/cp/parser.c:11255 0x91ce97 cp_parser_compound_statement ../../gcc/gcc/cp/parser.c:11209 0x933610 cp_parser_function_body ../../gcc/gcc/cp/parser.c:21750 0x933610 cp_parser_ctor_initializer_opt_and_function_body ../../gcc/gcc/cp/parser.c:21787 0x933ec0 cp_parser_function_definition_after_declarator ../../gcc/gcc/cp/parser.c:26688 0x934bd7 cp_parser_function_definition_from_specifiers_and_declarator ../../gcc/gcc/cp/parser.c:26604 Please submit a full bug report, [etc.]