summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/lookup/template2.C
blob: 0e8921261e89515477ddf5ddea5735301293c332 (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
// { dg-do compile }

// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 24 Mar 2003 <nathan@codesourcery.com>

// PR 10199. Lookup problems

class X {
public:
  template<int d>
  int bar ();
};

template<int x>
int fooo ();

template<class T>
void bar (T& g)
{
  int kk = fooo<17>();  // OK
  X x;
  int k = x.bar<17>();  // Not OK
}

int main ()
{
  X x;
  int k=x.bar<17>();    // OK
  int n;
  bar(n);
}