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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [template/] [memfriend16.C] - Blame information for rev 801

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

Line No. Rev Author Line
1 693 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
  template  struct B1
11
  {
12
  };
13
  template  struct B2
14
  {
15
    void f();
16
  };
17
};
18
 
19
class C {
20
  int i;        // { dg-error "private" }
21
  template template  friend struct A::B1;
22
};
23
 
24
template 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 "required" }
34
}

powered by: WebSVN 2.1.0

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