http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60228

            Bug ID: 60228
           Summary: ICE using lambda in #pragma omp declare reduction
           Product: gcc
           Version: 4.9.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

The following valid code snippet (compiled with "-std=c++11 -fopenmp")
triggers an ICE on trunk:

=======================================================
template<typename T> struct A
{
  #pragma omp declare reduction (x : T : omp_out += omp_in + [](){ return 0;
}()) initializer (omp_priv = 0)
};
=======================================================

bug.cc:3:108: internal compiler error: in cp_check_omp_declare_reduction, at
cp/semantics.c:4944
   #pragma omp declare reduction (x : T : omp_out += omp_in + [](){ return 0;
}()) initializer (omp_priv = 0)
                                                                               
                            ^
0x7328eb cp_check_omp_declare_reduction(tree_node*)
        ../../gcc/gcc/cp/semantics.c:4944
0x6cfd7c cp_parser_late_parsing_for_member
        ../../gcc/gcc/cp/parser.c:23459
0x6a9edc cp_parser_class_specifier_1
        ../../gcc/gcc/cp/parser.c:19406
0x6a9edc cp_parser_class_specifier
        ../../gcc/gcc/cp/parser.c:19437
0x6a9edc cp_parser_type_specifier
        ../../gcc/gcc/cp/parser.c:14302
0x6c2ba0 cp_parser_decl_specifier_seq
        ../../gcc/gcc/cp/parser.c:11547
0x6c8883 cp_parser_single_declaration
        ../../gcc/gcc/cp/parser.c:23039
0x6c8d64 cp_parser_template_declaration_after_export
        ../../gcc/gcc/cp/parser.c:22915
0x6d4119 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:10947
0x6d2c08 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10869
0x6d44aa cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4014
0x6d44aa c_parse_file()
        ../../gcc/gcc/cp/parser.c:31536
0x7f3813 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1060
Please submit a full bug report, [etc.]

Reply via email to