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/] [friend23.C] - Blame information for rev 154

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: Alexandre Tolmos 
4
 
5
// PR c++/11876: Friend of its own class diagnostics
6
 
7
template 
8
class A
9
{
10
        friend class A;
11
        friend class A;
12
protected:
13
        T _data;
14
        inline A() : _data(0) {}
15
        template 
16
        inline A(const A& r) : _data(r._data) {}
17
};
18
 
19
class B : public A
20
{
21
public:
22
        inline B() {}
23
        inline B(const B& r) : A(r) {}
24
};
25
 
26
class C : public A
27
{
28
public:
29
        inline C() {}
30
        inline C(const B& r) : A(r) {}
31
};
32
 
33
int main(int, char*[])
34
{
35
        B b1, b2(b1);
36
        C c(b1);
37
        return 0;
38
}

powered by: WebSVN 2.1.0

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