summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/template/dependent-expr8.C
blob: 20014d6e70bd19a61c5c195ca5723206e4850606 (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
// Origin PR c++/48574
// { dg-options "-std=c++0x" }
// { dg-do compile }

struct A
{
  virtual int foo();
};

void baz (int);

template <typename T>
void
bar(T x)
{
  A &b = *x;
  baz (b.foo ());
}

void
foo()
{
  A a;
  bar(&a);
}