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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [template/] [friend23.C] - Diff between revs 149 and 154

Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
// { dg-do compile }
// { dg-do compile }
// Origin: Alexandre Tolmos 
// Origin: Alexandre Tolmos 
// PR c++/11876: Friend of its own class diagnostics
// PR c++/11876: Friend of its own class diagnostics
template 
template 
class A
class A
{
{
        friend class A;
        friend class A;
        friend class A;
        friend class A;
protected:
protected:
        T _data;
        T _data;
        inline A() : _data(0) {}
        inline A() : _data(0) {}
        template 
        template 
        inline A(const A& r) : _data(r._data) {}
        inline A(const A& r) : _data(r._data) {}
};
};
class B : public A
class B : public A
{
{
public:
public:
        inline B() {}
        inline B() {}
        inline B(const B& r) : A(r) {}
        inline B(const B& r) : A(r) {}
};
};
class C : public A
class C : public A
{
{
public:
public:
        inline C() {}
        inline C() {}
        inline C(const B& r) : A(r) {}
        inline C(const B& r) : A(r) {}
};
};
int main(int, char*[])
int main(int, char*[])
{
{
        B b1, b2(b1);
        B b1, b2(b1);
        C c(b1);
        C c(b1);
        return 0;
        return 0;
}
}
 
 

powered by: WebSVN 2.1.0

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