aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@redhat.com>2010-09-06 18:44:23 +0000
committerDodji Seketeli <dodji@gcc.gnu.org>2010-09-06 20:44:23 +0200
commite6c2fc5dace4a6b80f65378578f4425515d7243b (patch)
tree4632c0080a473a464c988e9d9cf35edb808bb6dc /gcc/testsuite
parent3c7ac37eea95be3f08fca1573116ca494158728f (diff)
downloadgcc-e6c2fc5dace4a6b80f65378578f4425515d7243b.zip
gcc-e6c2fc5dace4a6b80f65378578f4425515d7243b.tar.gz
gcc-e6c2fc5dace4a6b80f65378578f4425515d7243b.tar.bz2
Patch PR c++/45200
Fix PR c++/45200, c++/45293, c++/45558 gcc/cp/Changelog: PR c++/45200 PR c++/45293 PR c++/45558 * tree.c (strip_typedefs): Strip typedefs from the context of TYPENAME_TYPEs. gcc/testsuite/ChangeLog: PR c++/45200 PR c++/45293 PR c++/45558 * g++.dg/template/typedef34.C: New test. * g++.dg/template/typedef35.C: New test. From-SVN: r163929
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog8
-rw-r--r--gcc/testsuite/g++.dg/template/typedef34.C37
-rw-r--r--gcc/testsuite/g++.dg/template/typedef35.C41
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);