This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

g++ 2.96 fails to enforce an access restriction to an eliminated copy ctor


Hi,

the program below should produce a diagnostic since the private copy
ctor, A::A(const A&), is inaccessible in the context of main. The
diagnostic is required even if the ctor has been eliminated (12.2, p1).

Regards
Martin


class A
{
    A (const A&);
};

struct B {
    A foo ();
};


int main ()
{
    const A &a = B().foo ();
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]