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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [template/] [friend4.C] - Blame information for rev 149

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

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do compile }
2
 
3
// Copyright (C) 2002 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 18 Dec 2001 
5
 
6
// PR 109, dependent member friends
7
 
8
struct B
9
{
10
  static int foo ();
11
  struct N
12
  {
13
    static int bar ();
14
  };
15
};
16
 
17
 
18
template 
19
class A
20
{
21
  friend int T::foo ();
22
  friend int T::N::bar ();
23
 
24
  private:
25
  static int m;
26
};
27
 
28
template 
29
class C
30
{
31
  friend struct T::N;
32
 
33
  private:
34
  static int m;
35
};
36
 
37
 
38
int B::foo ()
39
{
40
  return A::m;
41
}
42
 
43
int B::N::bar ()
44
{
45
  return A::m + C::m;
46
}

powered by: WebSVN 2.1.0

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