summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/init6.C
blob: 143746642fcb1df1e85dff50f28dd9d8100d6f35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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*>();
}