aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/overload10.C
blob: cd18382b79fa93524650845db4be1a65360b338f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// PRMS Id: 4257 (second bug)
// Bug: g++ fails to recognize multiple previous instantiations of a function
// template.
// Build don't link:
// Special g++ Options: -fguiding-decls

template <class T>
class A {
  int i;

  friend int foo (A<T>&);
};

template <class T> int foo (A<T>& a) { return a.i; }

A<int> a;
A<char> dummy;

void bar ()
{
  foo (a);			// gets bogus error - two foo(A<int>&)'s
}