http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57325
Bug ID: 57325 Summary: [4.7/4.8/4.9 Regression] ICE in strip_typedefs, at cp/tree.c:1306 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ppluzhnikov at google dot com Google reference: b/9018720 Compiles fine with with gcc-4.6 and Clang. ICE's with 4.7, 4.8, 4.9 (current trunk @r199023): g++ -c test.ii test.ii: In instantiation of ‘void TestJets(JetsT*) [with JetsT = SimpleJets<double>]’: test.ii:37:17: required from here test.ii:25:27: internal compiler error: in strip_typedefs, at cp/tree.c:1306 scoped_ptr < JetT[] > a; ^ 0x6b1af0 strip_typedefs(tree_node*) ../../gcc/cp/tree.c:1306 0x55736c canonicalize_type_argument ../../gcc/cp/pt.c:6151 0x57f12d coerce_template_parms ../../gcc/cp/pt.c:6722 0x587878 lookup_template_class_1 ../../gcc/cp/pt.c:7286 0x587878 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*, int, int) ../../gcc/cp/pt.c:7583 0x58ced1 tsubst_aggr_type ../../gcc/cp/pt.c:9844 0x5805b5 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/cp/pt.c:11183 0x591021 tsubst_decl ../../gcc/cp/pt.c:10655 0x580cf4 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/cp/pt.c:11104 0x576a9f tsubst_expr ../../gcc/cp/pt.c:12934 0x57605b tsubst_expr ../../gcc/cp/pt.c:12883 0x576e34 tsubst_expr ../../gcc/cp/pt.c:13073 0x574a0b instantiate_decl(tree_node*, int, bool) ../../gcc/cp/pt.c:19108 0x5aff5f instantiate_pending_templates(int) ../../gcc/cp/pt.c:19207 0x5eaef9 cp_write_global_declarations() ../../gcc/cp/decl2.c:4037 Please submit a full bug report, test.ii: class valarray { int _M_data; }; template < typename > struct SimpleJet { valarray partials; }; template < class C > struct scoped_ptr_impl { scoped_ptr_impl (C *):data_ () { } struct Data { C ptr; }; Data data_; }; template < class, class = int >struct scoped_ptr; template < class C, class D > struct scoped_ptr <C[], D > { scoped_ptr ():impl_ (0) { } scoped_ptr_impl < C > impl_; }; template < typename JetsT > void TestJets (JetsT *) { typedef typename JetsT::JetType JetT; scoped_ptr < JetT[] > a; } template < typename T > struct SimpleJets { typedef SimpleJet < T > JetType; scoped_ptr < SimpleJet < T >[] > vars_; }; void fn () { SimpleJets < double >b; TestJets (&b); }