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

            Bug ID: 64105
           Summary: ICE: in strip_typedefs, at cp/tree.c:1326
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mattipee at yahoo dot co.uk

Created attachment 34132
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34132&action=edit
simple source file to reproduce

Wasn't expecting this to compile with --std=c++11, but got an ICE (fine with
--std=c++14). Source attached.

From "g++ -v":
  - Target: x86_64-unknown-linux-gnu
  - Configured with: ./configure --enable-languages=c++ --disable-multilib
  - Thread model: posix
  - gcc version 4.9.2 (GCC) 

Happens on both:
  - Linux Mint, 64bit, 3.13.0-24-generic
  - CentOS 5.2, 32bit, 2.6.18-308.el5



user@host ~/crash $ g++ --std=c++11 -Wall -Wextra crash.cpp 
crash.cpp: In function ‘int main()’:
crash.cpp:18:10: warning: use of ‘auto’ in lambda parameter declaration only
available with -std=c++1y or -std=gnu++1y
   X::f([](auto... xs){});
          ^
In file included from crash.cpp:1:0:
/usr/local/include/c++/4.9.2/functional: In substitution of ‘template<class
_Functor, class> std::function<_Res(_ArgTypes ...)>::function(_Functor) [with
_Functor = main()::<lambda(auto:1 ...)>; <template-parameter-1-2> =
<missing>]’:
crash.cpp:10:8:   required from ‘static void X::f(T) [with T =
main()::<lambda(auto:1 ...)>]’
crash.cpp:18:24:   required from here
/usr/local/include/c++/4.9.2/functional:2225:9: internal compiler error: in
strip_typedefs, at cp/tree.c:1326
         typename = _Requires<_Callable<_Functor>, void>>
         ^
0x612ef7 strip_typedefs(tree_node*)
    ../.././gcc/cp/tree.c:1326
0x55961c canonicalize_type_argument
    ../.././gcc/cp/pt.c:6355
0x574986 type_unification_real
    ../.././gcc/cp/pt.c:16591
0x577b05 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, bool, bool)
    ../.././gcc/cp/pt.c:15933
0x534f01 add_template_candidate_real
    ../.././gcc/cp/call.c:2998
0x532854 add_template_candidate
    ../.././gcc/cp/call.c:3095
0x532854 add_candidates
    ../.././gcc/cp/call.c:5169
0x532bea build_user_type_conversion_1
    ../.././gcc/cp/call.c:3563
0x5335be implicit_conversion
    ../.././gcc/cp/call.c:1807
0x5348e2 add_function_candidate
    ../.././gcc/cp/call.c:2055
0x5327f7 add_candidates
    ../.././gcc/cp/call.c:5179
0x538759 build_new_method_call_1
    ../.././gcc/cp/call.c:7807
0x538759 build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
    ../.././gcc/cp/call.c:7998
0x5faaf8 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
    ../.././gcc/cp/semantics.c:2318
0x562a44 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
    ../.././gcc/cp/pt.c:14868
0x5660ac tsubst_expr
    ../.././gcc/cp/pt.c:14055
0x56517c tsubst_expr
    ../.././gcc/cp/pt.c:13457
0x565fad tsubst_expr
    ../.././gcc/cp/pt.c:13648
0x564d62 instantiate_decl(tree_node*, int, bool)
    ../.././gcc/cp/pt.c:19971
0x57b98b instantiate_pending_templates(int)
    ../.././gcc/cp/pt.c:20087
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.
user@host ~/crash $

Reply via email to