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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [tc1/] [dr161.C] - Blame information for rev 821

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
// Origin: Giovanni Bajo 
3
// DR161: Access to protected nested type
4
 
5
namespace N1 {
6
  struct A
7
  {
8
  protected:
9
    typedef int type;
10
  };
11
 
12
  struct B : public A
13
  {
14
    void test(void)
15
    {
16
      A::type t;
17
    }
18
 
19
    friend void ftest(void)
20
    {
21
      A::type t;
22
    }
23
  };
24
}
25
 
26
 
27
namespace N2 {
28
  template 
29
  struct A
30
  {
31
  protected:
32
    typedef int type;
33
  };
34
 
35
  template 
36
  struct B : public A
37
  {
38
    void test(B b)
39
    {
40
      typename A::type t;
41
    }
42
 
43
    friend void ftest(B b)
44
    {
45
      typename A::type t;
46
    }
47
  };
48
 
49
  template struct B;
50
}

powered by: WebSVN 2.1.0

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