This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17804] New: Class declaration and definition in different namespaces
- From: "peter dot klotz at aon dot at" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Oct 2004 10:57:02 -0000
- Subject: [Bug c++/17804] New: Class declaration and definition in different namespaces
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In the following example class A is declared in namespace N1 but defined in
namespace N1::N2. The code compiles with gcc 3.3.1 (cygwin 1.5.10) and gcc 3.4.1
(Fedora Core 3 Test1) but I think it should be rejected.
Neither Comeau C++ 4.3.3 nor Microsoft C++ 13.10 compile this code snippet.
----------------------------
namespace N1 {
class A
{
public:
void f();
};
}
namespace N1 { namespace N2 {
void A::f() {}
} }
int main()
{
N1::A().f();
return 0;
}
----------------------------
--
Summary: Class declaration and definition in different namespaces
Product: gcc
Version: 3.4.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: peter dot klotz at aon dot at
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17804