https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84791
Bug ID: 84791 Summary: ICE with broken OpenMP reduction clause Product: gcc Version: 8.0 Status: UNCONFIRMED Keywords: error-recovery, ice-on-invalid-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 invalid code snippet (compiled with "-fopenmp") triggers an ICE since GCC 4.9.0 (when OpenMP 4.0 was implemented): ============================================== typedef int I; template<int> void foo() { I i; #pragma omp parallel reduction (I::I: i) ; } template void foo<0>(); ============================================== bug.cc: In function 'void foo()': bug.cc:6:35: error: 'I' is not a class, namespace, or enumeration #pragma omp parallel reduction (I::I: i) ^ bug.cc: In instantiation of 'void foo() [with int <anonymous> = 0]': bug.cc:10:22: required from here bug.cc:6:11: internal compiler error: in tsubst_omp_clauses, at cp/pt.c:15664 #pragma omp parallel reduction (I::I: i) ^~~ 0x643d33 tsubst_omp_clauses ../../gcc/gcc/cp/pt.c:15664 0x96d9ba tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc/gcc/cp/pt.c:16654 0x96d4e4 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc/gcc/cp/pt.c:16190 0x96aecf tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc/gcc/cp/pt.c:16471 0x96a168 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool) ../../gcc/gcc/cp/pt.c:16175 0x96a168 instantiate_decl(tree_node*, bool, bool) ../../gcc/gcc/cp/pt.c:23540 0x98eb4b instantiate_pending_templates(int) ../../gcc/gcc/cp/pt.c:23656 0x8b632b c_parse_final_cleanups() ../../gcc/gcc/cp/decl2.c:4721 Please submit a full bug report, [etc.]