OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.oliva/] [partord1.C] - Blame information for rev 699

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do assemble  }
2
 
3
// Copyright (C) 1999 Free Software Foundation
4
 
5
// by Alexandre Oliva 
6
 
7
template  void foo(T);
8
template  void foo(T*);
9
 
10
template  class bar {
11
 private:
12
  int i; // { dg-error "" } this variable
13
  friend void foo(T);
14
};
15
 
16
template  void foo(T) {
17
  bar().i; // ok, I'm a friend
18
}
19
template  void foo(T*) {
20
  bar().i; // { dg-error "" } not a friend
21
}
22
 
23
int main() {
24
  int j = 0;
25
  foo(j); // calls foo(int), ok
26
  foo(&j); // calls foo(int*)
27
  foo(&j); // calls foo(int*), ok
28
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.