Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.old-deja / g++.oliva / partord1.C
blob555931725d2896ff027d44e091eeb7b744c37c8e
1 // { dg-do assemble  }
3 // Copyright (C) 1999 Free Software Foundation
5 // by Alexandre Oliva <oliva@dcc.unicamp.br>
7 template <typename T> void foo(T);
8 template <typename T> void foo(T*);
10 template <typename T> class bar {
11  private:
12   int i; // { dg-error "" } this variable
13   friend void foo<T>(T);
16 template <typename T> void foo(T) {
17   bar<T>().i = 0; // ok, I'm a friend
19 template <typename T> void foo(T*) {
20   bar<T*>().i = 1; // { dg-error "" } not a friend
23 int main() {
24   int j = 0;
25   foo(j); // calls foo<int>(int), ok
26   foo(&j); // calls foo<int>(int*)
27   foo<int*>(&j); // calls foo<int*>(int*), ok