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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc4/] [gcc/] [testsuite/] [g++.old-deja/] [g++.oliva/] [partord1.C] - Diff between revs 305 and 519

Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 519
// { dg-do assemble  }
// { dg-do assemble  }
// Copyright (C) 1999 Free Software Foundation
// Copyright (C) 1999 Free Software Foundation
// by Alexandre Oliva 
// by Alexandre Oliva 
template  void foo(T);
template  void foo(T);
template  void foo(T*);
template  void foo(T*);
template  class bar {
template  class bar {
 private:
 private:
  int i; // { dg-error "" } this variable
  int i; // { dg-error "" } this variable
  friend void foo(T);
  friend void foo(T);
};
};
template  void foo(T) {
template  void foo(T) {
  bar().i = 0; // ok, I'm a friend
  bar().i = 0; // ok, I'm a friend
}
}
template  void foo(T*) {
template  void foo(T*) {
  bar().i = 1; // { dg-error "" } not a friend
  bar().i = 1; // { dg-error "" } not a friend
}
}
int main() {
int main() {
  int j = 0;
  int j = 0;
  foo(j); // calls foo(int), ok
  foo(j); // calls foo(int), ok
  foo(&j); // calls foo(int*)
  foo(&j); // calls foo(int*)
  foo(&j); // calls foo(int*), ok
  foo(&j); // calls foo(int*), ok
}
}
 
 

powered by: WebSVN 2.1.0

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