This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17804] New: Class declaration and definition in different namespaces


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]