summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/pr48660.C
blob: 37b61741ada94b55ebfefbb1b91f3dde3c8b0b60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
template<int N> struct val { char a[N]; };

class Base
{
public:
  virtual val<1> get1() const = 0;
  virtual val<2> get2() const = 0;
  virtual val<3> get3() const = 0;
  virtual val<4> get4() const = 0;
};

class Derived : public virtual Base
{
public:
  virtual val<1> get1() const { return foo->get1(); }
  virtual val<2> get2() const { return foo->get2(); }
  virtual val<3> get3() const { return foo->get3(); }
  virtual val<4> get4() const { return foo->get4(); }
  Base *foo;
};

Base* make() { return new Derived; }