aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/template/call6.C
blob: b79d624a484f28feb24e8bb59c8357f51b367036 (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
// PR c++/38577
// { dg-do compile }

struct A
{
  static A *bar ();
};

struct B : public A
{
  static void baz ();
};

template <class T>
void foo ()
{
  (static_cast<B *> (A::bar ()))->baz ();
}

void
bar ()
{
  foo<int> ();
}