aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/template/init6.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/template/init6.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/template/init6.C31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/template/init6.C b/gcc-4.9/gcc/testsuite/g++.dg/template/init6.C
new file mode 100644
index 000000000..143746642
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/template/init6.C
@@ -0,0 +1,31 @@
+// PR c++/25836
+
+template <class T>
+class Iter {};
+
+template <class T>
+class SubIter : public Iter<T> {
+ void insert(T);
+};
+
+class GraphBase {
+public:
+ class Node;
+};
+
+template<class T>
+class Graph : public GraphBase {
+ class Inner {
+ Iter<typename Graph<T>::Node*> *get();
+ };
+};
+
+template<class T>
+Iter<typename Graph<T>::Node*> *Graph<T>::Inner::get() {
+ SubIter<typename Graph<T>::Node*> *iter;
+ iter->insert(0);
+}
+
+int main() {
+ Iter<Graph<int>::Node*> *n2_iter = new SubIter<Graph<int>::Node*>();
+}