This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13700] New: Member function definition in non-enclosing scope
- From: "grigory dot zagorodnev at intel dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jan 2004 16:15:09 -0000
- Subject: [Bug c++/13700] New: Member function definition in non-enclosing scope
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The C++ Standard says that "a member function definition that appears outside
of the class definition shall appear in a namespace scope enclosing the class
definition" [9.3/2]
At the same time g++ compiler allows successful compilation of the code listed
below. That seems to be a standard violation.
struct C {
void foo();
};
namespace B {
void C::foo(){};
}
Note: namespace B has no definition of C, so C::foo may not be defined in it.
--
Summary: Member function definition in non-enclosing scope
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: grigory dot zagorodnev at intel dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13700