summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/lookup/template3.C
blob: e5f6f18edc7d3885bb20a5ac1a6b23f68d531839 (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
32
33
34
35
// Origin PR c++/47957
// { dg-do compile }

struct S
{
  int m;

  S()
    : m(0)
  {
  }
};

struct Base
{
  typedef S T;
};

template<class T>
struct Derived : public Base
{
  int
  foo()
  {
    T a; // This is Base::T, not the template parameter.
    return a.m;
  }
};

int
main()
{
  Derived<char> d;
  return d.foo();
}