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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [template/] [memfriend15.C] - Blame information for rev 315

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

Line No. Rev Author Line
1 301 jeremybenn
// { dg-do compile }
2
 
3
// Copyright (C) 2004 Free Software Foundation
4
// Contributed by Kriang Lerdsuwanakij 
5
 
6
// Nested class of class template as friend
7
 
8
template struct A
9
{
10
  struct B1
11
  {
12
  };
13
  struct B2
14
  {
15
    void f();
16
  };
17
};
18
 
19
class C {
20
  int i;        // { dg-error "private" }
21
  template friend struct A::B1;
22
};
23
 
24
template void A::B2::f()
25
{
26
  C c;
27
  c.i = 0;      // { dg-error "context" }
28
}
29
 
30
int main()
31
{
32
  A::B2 b1;
33
  b1.f();       // { dg-message "instantiated" }
34
}

powered by: WebSVN 2.1.0

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