[Bug c++/25637] New: [3.4/4.0/4.1/4.2 regression] Member definition in wrong scope accepted
reichelt at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Jan 2 13:45:00 GMT 2006
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
More information about the Gcc-bugs
mailing list