blob: 7fc480f3ea0cc76e2e2c07dab3652a3c7bfd7257 [file] [log] [blame]
// PR c++/34488
// { dg-do compile }
// { dg-additional-options "-Wno-return-type" }
struct A
{
A ();
~A ();
A (const A &);
};
struct B
{
friend A::A ();
friend A::~A ();
friend A::A (const A &);
};
struct C
{
friend int C ();
friend int ~C (); // { dg-error "return type|in friend decl" }
friend int C (const C &);
};
struct D
{
friend int D () {}
friend int ~D () {} // { dg-error "return type|in friend decl" }
friend int D (const D &) {}
};
struct E
{
friend A::A () {} // { dg-error "cannot define member" }
friend A::~A () {} // { dg-error "cannot define member" }
friend A::A (const A &) {} // { dg-error "cannot define member" }
};