[Bug c++/66585] Internal compiler error when initialize field with lambda

trippels at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jun 18 10:32:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66585

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-06-18
                 CC|                            |trippels at gcc dot gnu.org
      Known to work|                            |4.9.2
     Ever confirmed|0                           |1
      Known to fail|                            |5.0, 6.0

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
markus@x4 tmp % cat bug.ii
class A {
  template <typename, typename> using _Requires = int;

public:
  template <typename _Functor, typename = _Requires<_Functor, void>>
  A(_Functor);
};
template <class T> class B {
  A f = [](T) {};
};

B<int> a;

markus@x4 tmp % g++ -c --std=c++11 bug.ii
bug.ii: In instantiation of ‘B<T>::<lambda(T)> [with T = int]’:
bug.ii:9:10:   required from ‘struct B<int>::<lambda(int)>’
bug.ii:12:8:   required from here
bug.ii:9:13: internal compiler error: Segmentation fault
   A f = [](T) {};
             ^
0xccc84f crash_signal
        ../../gcc/gcc/toplev.c:369
0x62adea contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
        ../../gcc/gcc/tree.h:2971
0x62adea instantiate_decl(tree_node*, int, bool)
        ../../gcc/gcc/cp/pt.c:20496
0x66a9fc instantiate_class_template_1
        ../../gcc/gcc/cp/pt.c:9647
0x66a9fc instantiate_class_template(tree_node*)
        ../../gcc/gcc/cp/pt.c:9715
0x707c2b complete_type(tree_node*)
        ../../gcc/gcc/cp/typeck.c:140
0x6445bf tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/gcc/cp/pt.c:15743
0x731c98 get_nsdmi(tree_node*, bool)
        ../../gcc/gcc/cp/init.c:558
0x740fca walk_field_subobs
        ../../gcc/gcc/cp/method.c:1213
0x741ae4 synthesized_method_walk
        ../../gcc/gcc/cp/method.c:1539
0x745c3a get_defaulted_eh_spec(tree_node*)
        ../../gcc/gcc/cp/method.c:1570
0x6530eb maybe_instantiate_noexcept(tree_node*)
        ../../gcc/gcc/cp/pt.c:20111
0x6adeda mark_used(tree_node*, int)
        ../../gcc/gcc/cp/decl2.c:4991
0x5c6a80 build_over_call
        ../../gcc/gcc/cp/call.c:7496
0x5d1a8e build_new_method_call_1
        ../../gcc/gcc/cp/call.c:8212
0x5d1a8e build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
        ../../gcc/gcc/cp/call.c:8282
0x5d2a49 build_special_member_call(tree_node*, tree_node*, vec<tree_node*,
va_gc, vl_embed>**, tree_node*, int, int)
        ../../gcc/gcc/cp/call.c:7822
0x736338 expand_default_init
        ../../gcc/gcc/cp/init.c:1728
0x736338 expand_aggr_init_1
        ../../gcc/gcc/cp/init.c:1829
0x737034 build_aggr_init(tree_node*, tree_node*, int, int)
        ../../gcc/gcc/cp/init.c:1578
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


More information about the Gcc-bugs mailing list