1// Origin: PR c++/43704 2// { dg-do compile } 3 4template<typename T2, typename T3> 5struct if_ 6{ 7 typedef T2 type; 8}; 9 10template<class I1> 11struct iterator_restrict_traits 12{ 13 struct iterator_category {}; 14}; 15 16template<class T> 17struct matrix 18{ 19 struct ci {struct ic {};}; 20 class i {}; 21}; 22 23template<class M, class TRI> 24struct triangular_adaptor 25{ 26 typedef typename if_<typename M::ci,typename M::i>::type ty1; 27 class iterator2 : iterator_restrict_traits<typename ty1::ic>::iterator_category 28 { 29 }; 30}; 31 32template<class M> 33struct banded_adaptor 34{ 35 typedef typename if_<typename M::ci,typename M::i>::type ty1; 36 class iterator1 : iterator_restrict_traits<typename ty1::ic>::iterator_category 37 { 38 }; 39}; 40 41template<class T> 42struct singular_decomposition 43{ 44 banded_adaptor<matrix<double> >::iterator1 it1; 45}; 46 47