works with 4.7.2, fails with 4.7 20130215 and trunk 20130217. $ g++ -c Platform.ii ./openvdb/tree/TreeIterator.h:433:40: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate.
Created attachment 29494 [details] preprocessed source
Confirmed. ./openvdb/tree/TreeIterator.h:433:40: internal compiler error: tree check: accessed elt 4 of tree_vec with 3 elts in tsubst, at cp/pt.c:11228 0xf2f8a4 tree_vec_elt_check_failed(int, int, char const*, int, char const*) /space/rguenther/src/svn/trunk/gcc/tree.c:9131 0x5afeb9 tree_vec_elt_check(tree_node*, int, char const*, int, char const*) /space/rguenther/src/svn/trunk/gcc/tree.h:3869 0x657334 tsubst(tree_node*, tree_node*, int, tree_node*) /space/rguenther/src/svn/trunk/gcc/cp/pt.c:11228 0x65cd34 tsubst_copy /space/rguenther/src/svn/trunk/gcc/cp/pt.c:12463
Started with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189298 Reducing.
Created attachment 29505 [details] pr56395.ii Somewhat reduced testcase (after 9 hours of delta, still > 20KB).
Created attachment 29508 [details] pr56395.ii Some more reduced testcase, still almost 9KB. Boost testcases are really hard to reduce :(.
A little bit further reduced: template < typename T > struct I { typedef T type; }; template < typename T > struct F { typedef T type; }; template < typename ChildType > struct H { typedef ChildType ChildNodeType; template < typename RootNodeT > struct A { typedef RootNodeT NodeType; typedef typename F < NodeType >::type NonConstNodeType; }; typedef A < H > ChildOnCIter; }; template < bool > struct C; template <> struct C <false > { template < typename Sequence > struct G { typedef typename Sequence::tag type; }; }; template < typename Sequence > struct O:C < 0 >::G < Sequence > { }; template < typename > struct W; template < typename Sequence > struct P:W < typename O < Sequence >::type >::template X < Sequence > { }; template < typename > struct L; template < typename Sequence, typename T > struct Q:L < typename O < Sequence >::type > ::template X < Sequence, T > { }; template <> struct W <int > { template < typename Vector > struct X:I < Vector > { }; }; template < typename Base > struct R:Base { }; template < typename = int > struct V; template <> struct V <> { typedef int tag; }; struct S:R < V <> > { }; template < typename HeadT, int > struct J { typedef typename J < typename HeadT::ChildNodeType, 1 >::Type SubtreeT; typedef typename Q < SubtreeT, HeadT >::type Type; }; template < typename HeadT > struct J <HeadT, 0 > { typedef S Type; }; template < typename > struct IterTraits { template < typename OtherNodeT > struct K { typedef OtherNodeT Type; }; }; template < typename PrevItemT, typename NodeVecT, int > struct B { typedef typename PrevItemT::IterT PrevIterT; typedef typename P < NodeVecT >::type _NodeT; typedef typename IterTraits < PrevIterT >::template K < _NodeT >::Type IterT; IterTraits < IterT > ITraits; }; template < typename PrevItemT, typename NodeVecT > struct B <PrevItemT, NodeVecT, 0 > { typedef typename PrevItemT::IterT PrevIterT; typedef typename P < NodeVecT >::type _NodeT; typedef typename IterTraits < PrevIterT >::template K < _NodeT >::Type IterT; IterTraits < IterT > ITraits; }; template < typename RootChildOnIterT > struct N { typedef RootChildOnIterT RootIterT; typedef typename RootIterT::NonConstNodeType NCRootNodeT; typedef typename J < NCRootNodeT, 0 >::Type InvTreeT; struct M { typedef RootIterT IterT; }; B < M, InvTreeT, 0 > mIterList; }; template < typename T > struct D { N < typename T::ChildOnCIter > LeafCIter; }; D < H < int > >a;
Still more reduced: template<typename T>struct I { typedef T type; }; struct H { typedef int ChildOnCIter; }; template<bool>struct C; template<>struct C<false> { template<typename Sequence>struct G { typedef typename Sequence::tag type; }; }; template<typename Sequence>struct O : C<0>::G<Sequence> {}; template<typename>struct W; template<typename Sequence>struct P : W <typename O <Sequence>::type>::template X<Sequence> {}; template<>struct W<int> { template<typename Vector>struct X : I<Vector> {}; }; template<typename Base>struct R : Base {}; template<typename = int>struct V; template<>struct V<> { typedef int tag; }; struct S : R<V<> > {}; template<typename>struct IterTraits { template<typename OtherNodeT>struct K { typedef OtherNodeT Type; }; }; template<typename PrevItemT, typename NodeVecT, int>struct B { typedef typename PrevItemT::IterT PrevIterT; typedef typename P<NodeVecT>::type _NodeT; typedef typename IterTraits<PrevIterT>::template K< _NodeT>::Type IterT; IterTraits<IterT>ITraits; }; template<typename PrevItemT, typename NodeVecT>struct B<PrevItemT, NodeVecT,0> { typedef typename PrevItemT::IterT PrevIterT; typedef typename P<NodeVecT>::type _NodeT; typedef typename IterTraits<PrevIterT>::template K< _NodeT>::Type IterT; IterTraits<IterT> ITraits; }; template<typename RootChildOnIterT>struct N { typedef RootChildOnIterT RootIterT; struct M { typedef RootIterT IterT; }; B<M, S, 0>mIterList; }; template<typename T>struct D { N<typename T::ChildOnCIter>LeafCIter; }; D<H> a;
Author: jason Date: Fri Feb 22 22:23:56 2013 New Revision: 196228 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196228 Log: PR c++/56395 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template args. Added: trunk/gcc/testsuite/g++.dg/template/typename19.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/tree.c
Author: jason Date: Fri Feb 22 22:26:08 2013 New Revision: 196232 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196232 Log: PR c++/56395 * tree.c (strip_typedefs): Strip typedefs from TYPENAME_TYPE template args. Added: branches/gcc-4_7-branch/gcc/testsuite/g++.dg/template/typename19.C Modified: branches/gcc-4_7-branch/gcc/cp/ChangeLog branches/gcc-4_7-branch/gcc/cp/tree.c
Fixed.