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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.other/] [friend4.C] - Blame information for rev 749

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 699 jeremybenn
// { dg-do assemble  }
2
 
3
// by Alexandre Oliva 
4
 
5
// I'm not 100% sure this program is correct, but g++ shouldn't just
6
// crash.
7
 
8
// The idea is to give privileged access to bar only to
9
// specializations foo, for all B.
10
 
11
template  void foo();
12
template  class bar {
13
  int i; // { dg-error "" } private
14
  template  friend void foo(); // { dg-error "" } bogus declaration
15
};
16
template  void foo() {
17
  bar baz; baz.i = 1;   // { dg-error "" } foo cannot access bar::i
18
  bar buz; buz.i = 1; // { dg-error "" } foo cannot access bar::i
19
}
20
int main() {
21
  foo();
22
  foo();
23
}

powered by: WebSVN 2.1.0

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