aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/lookup/two-stage1.C
blob: db7117656a9a866f0c2e3764f00c171fb9f490ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* PR c++/2437 */
/* { dg-do run } */

// Test of two-stage name lookup.

int g(double) { return 0; }
 
template <class T> struct X
{
  int f() { return g(2); } // should call g(double)
};
 
inline int g(int) { return 1; }
 
int main()
{
  return X<int>().f(); // should call g(double), but used to call g(int)
}