diff options
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/typedef34.C | 37 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/typedef35.C | 41 |
3 files changed, 86 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f989ce7..4805390 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2010-09-06 Dodji Seketeli <dodji@redhat.com> + + PR c++/45200 + PR c++/45293 + PR c++/45558 + * g++.dg/template/typedef34.C: New test. + * g++.dg/template/typedef35.C: New test. + 2010-09-06 Uros Bizjak <ubizjak@gmail.com> PR target/22152 diff --git a/gcc/testsuite/g++.dg/template/typedef34.C b/gcc/testsuite/g++.dg/template/typedef34.C new file mode 100644 index 0000000..a82e155 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/typedef34.C @@ -0,0 +1,37 @@ +// Origin PR c++/45200 +// { dg-do compile } + +template<typename T> +struct remove_reference +{ + typedef T type; +}; + +template<typename TestType> +struct forward_as_lref +{ +}; + +template<typename Seq, typename N> +struct apply1 +{ + typedef typename remove_reference<Seq>::type seq; + typedef forward_as_lref<typename seq::seq_type> type; //#0 +}; + +template<typename Seq> +struct apply +{ + typedef forward_as_lref<typename remove_reference<Seq>::type::seq_type> type; //#1 +}; + +struct reverse_view +{ + typedef int seq_type; +}; + +int +main() +{ + apply<reverse_view >::type a2; +} diff --git a/gcc/testsuite/g++.dg/template/typedef35.C b/gcc/testsuite/g++.dg/template/typedef35.C new file mode 100644 index 0000000..2dddf09 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/typedef35.C @@ -0,0 +1,41 @@ +// Origin c++/45558 +// { dg-do compile } + +template <typename S, typename T> +struct C +{ + template <typename U> + struct B + { + template <typename W> + struct E + { + explicit E(const W &x) : w(x) {} + const W &w; + }; + }; +}; + +struct F; +template <typename X> +struct D +{ + D() {} +}; + +const D<F> g; +template <typename S, typename T> +struct A +{ + template <typename U> + struct B : C<S, T>::template B<U> + { + typedef typename C<S, T>::template B<U> V; + static const D<typename V::template E<D<F> > > a; + }; +}; + +template <typename S, typename T> +template <typename U> +const D<typename C<S, T>::template B<U>::template E<D<F> > > +A<S, T>::B<U>::a = typename C<S, T>::template B<U>::template E<D<F> >(g); |