[Bug c++/17804] New: Class declaration and definition in different namespaces
peter dot klotz at aon dot at
gcc-bugzilla@gcc.gnu.org
Sun Oct 3 10:57:00 GMT 2004
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
More information about the Gcc-bugs
mailing list