This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25637] New: [3.4/4.0/4.1/4.2 regression] Member definition in wrong scope accepted
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Jan 2006 13:45:23 -0000
- Subject: [Bug c++/25637] New: [3.4/4.0/4.1/4.2 regression] Member definition in wrong scope accepted
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following two invalid code snippets are accepted by the C++ frontend
(the members of A cannot be defined in B):
===============================================
struct A { void foo(); };
struct B { friend void A::foo() {} };
===============================================
===============================================
struct A { A(); };
struct B { friend A::A() {} };
===============================================
Since the second code snippet was rejected in GCC 3.2.x and 3.3.x
(although with a bogus error message) this is regression.
--
Summary: [3.4/4.0/4.1/4.2 regression] Member definition in wrong
scope accepted
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: accepts-invalid, monitored
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25637