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/] [memfriend17.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
// Origin: Giovanni Bajo 
4
 
5
// PR c++/13495: Nested class as template friend.
6
 
7
template
8
class A{
9
public:
10
    class B
11
    {
12
        void func1(void);
13
        void func2(void);
14
    };
15
};
16
 
17
template
18
class F1
19
{
20
    friend class A::B;
21
    enum { foo = 0 };   // { dg-error "private" }
22
};
23
 
24
template
25
class F2
26
{
27
    template
28
    friend class A::B;
29
    enum { foo = 0 };
30
};
31
 
32
template 
33
void A::B::func1(void)
34
{
35
    (void)F1::foo;
36
    (void)F2::foo;
37
}
38
 
39
template 
40
void A::B::func2(void)
41
{
42
    (void)F1::foo;      // { dg-error "context" }
43
    (void)F2::foo;
44
}
45
 
46
template class A;       // { dg-error "instantiated" }

powered by: WebSVN 2.1.0

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