This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
g++ 2.96 fails to enforce an access restriction to an eliminated copy ctor
- To: gcc bug reports <gcc-bugs at gcc dot gnu dot org>
- Subject: g++ 2.96 fails to enforce an access restriction to an eliminated copy ctor
- From: Martin Sebor <sebor at roguewave dot com>
- Date: Sat, 22 Jul 2000 16:01:24 -0600
- Organization: Rogue Wave Software, Inc.
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 ();
}