https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66647
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-valid-code Status|UNCONFIRMED |NEW Last reconfirmed| |2015-06-24 Known to work| |4.9.2 Ever confirmed|0 |1 Known to fail| |5.0, 6.0 --- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> --- markus@x4 tmp % cat testcase.ii template <typename _Tp> struct A { static constexpr _Tp value = 1; }; template <typename> class B { public: template <typename> struct rebind { }; }; template <typename _Alloc, typename _Tp> class C { template <typename _Alloc2, typename _Tp2> static A<int> _S_chk (typename _Alloc2::template rebind<_Tp2> *); public: using __type = decltype (_S_chk<_Alloc, _Tp> (0)); }; template <typename _Alloc, typename _Tp, int = C<_Alloc, _Tp>::__type::value> struct D; template <typename _Alloc, typename _Tp> struct D<_Alloc, _Tp, 1> { typedef typename _Alloc::template rebind<_Tp> __type; }; template <typename _Alloc> struct F { template <typename _Tp> using rebind_alloc = typename D<_Alloc, _Tp>::__type; }; template <typename _Alloc> struct __alloc_traits { template <typename> struct rebind { typedef typename F<_Alloc>::template rebind_alloc<int> other; }; }; template <typename _Alloc> struct G { typename __alloc_traits<_Alloc>::template rebind<int>::other _Tp_alloc_type; }; template <typename _Tp, typename _Alloc = B<_Tp> > class vector : G<_Alloc> { }; template <int> using tfuncptr = void(); template <int d> struct H { vector<tfuncptr<d> > funcs; }; markus@x4 tmp % g++ -std=c++11 testcase.ii testcase.ii: In instantiation of ‘struct B<void()>::rebind<int>’: testcase.ii:41:64: required from ‘struct G<B<tfuncptr<d> > >’ testcase.ii:43:58: required from ‘class vector<tfuncptr<d> >’ testcase.ii:50:24: required from here testcase.ii:8:30: internal compiler error: in instantiate_class_template_1, at cp/pt.c:9267 template <typename> struct rebind ^ 0x662f01 instantiate_class_template_1 ../../gcc/gcc/cp/pt.c:9266 0x662f01 instantiate_class_template(tree_node*) ../../gcc/gcc/cp/pt.c:9730 0x70763b complete_type(tree_node*) ../../gcc/gcc/cp/typeck.c:139 0x6629b9 instantiate_class_template_1 ../../gcc/gcc/cp/pt.c:9503 0x6629b9 instantiate_class_template(tree_node*) ../../gcc/gcc/cp/pt.c:9730 0x70763b complete_type(tree_node*) ../../gcc/gcc/cp/typeck.c:139 0x70782f complete_type_or_maybe_complain(tree_node*, tree_node*, int) ../../gcc/gcc/cp/typeck.c:151 0x5faf79 xref_basetypes(tree_node*, tree_node*) ../../gcc/gcc/cp/decl.c:12474 0x662246 instantiate_class_template_1 ../../gcc/gcc/cp/pt.c:9328 0x662246 instantiate_class_template(tree_node*) ../../gcc/gcc/cp/pt.c:9730 0x70763b complete_type(tree_node*) ../../gcc/gcc/cp/typeck.c:139 0x609350 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*, decl_context, int, tree_node**) ../../gcc/gcc/cp/decl.c:10782 0x6ac556 grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*, bool, tree_node*, tree_node*) ../../gcc/gcc/cp/decl2.c:876 0x6fb20b cp_parser_member_declaration ../../gcc/gcc/cp/parser.c:21123 0x6d6e0d cp_parser_member_specification_opt ../../gcc/gcc/cp/parser.c:20675 0x6d6e0d cp_parser_class_specifier_1 ../../gcc/gcc/cp/parser.c:19867 0x6d6e0d cp_parser_class_specifier ../../gcc/gcc/cp/parser.c:20103 0x6d6e0d cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:14732 0x6ea87e cp_parser_decl_specifier_seq ../../gcc/gcc/cp/parser.c:11958 0x6f9e98 cp_parser_single_declaration ../../gcc/gcc/cp/parser.c:23771 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.