From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7058 invoked by alias); 22 Apr 2002 13:24:52 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 7000 invoked from network); 22 Apr 2002 13:24:38 -0000 Received: from unknown (HELO dfw-gate1.raytheon.com) (199.46.199.230) by sources.redhat.com with SMTP; 22 Apr 2002 13:24:38 -0000 Received: from ds02c00.directory.ray.com (ds02c00.directory.ray.com [147.25.138.118]) by dfw-gate1.raytheon.com (8.11.0.Beta3/8.11.0.Beta3) with ESMTP id g3MDOYW21510 for ; Mon, 22 Apr 2002 08:24:35 -0500 (CDT) Received: from ds02c00.directory.ray.com (root@localhost) by ds02c00.directory.ray.com (8.12.1/8.12.1) with ESMTP id g3MDO0nX021828 for ; Mon, 22 Apr 2002 08:24:31 -0500 (CDT) Received: from ad2-mta02.and.us.ray.com (ad2-mta02.and.us.ray.com [138.127.59.160]) by ds02c00.directory.ray.com (8.12.1/8.12.1) with ESMTP id g3MDNhMe021673 for ; Mon, 22 Apr 2002 08:23:51 -0500 (CDT) Subject: Help with namespaces bug GCC 3.0.3.... To: gcc-help@gcc.gnu.org Message-ID: From: "Thomas J Amato" Date: Mon, 22 Apr 2002 06:36:00 -0000 MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-SW-Source: 2002-04/txt/msg00236.txt.bz2 Thomas J Amato To: gcc-help@gcc.gnu.org cc: 04/22/02 Subject: Possible bug in GCC 3.0.3???? 07:17 AM Hi, I was wondering if someone could tell me why this code fragment fails to compile under 3.0.3 (Solaris 2.7). Should putting the forward declaration in the namespace work under gcc, or is this a bug (or not part of the standard)? Is there a workaround for this? Any help would be great. Thanks, Tom <> #ifndef NEW_HXX #define NEW_HXX #include // Forward declaration. namespace Arch { class Allocator; } void* operator new(size_t, Arch::Allocator *const) throw(std::bad_alloc); void* operator new(size_t, Arch::Allocator *const, const std::nothrow_t&) throw(); void* operator new[](size_t, Arch::Allocator *const) throw(std::bad_alloc); void* operator new[](size_t, Arch::Allocator *const, const std::nothrow_t&) throw(); void operator delete(void*, Arch::Allocator *const) throw(); void operator delete(void*, Arch::Allocator *const, const std::nothrow_t&) throw(); void operator delete[](void*, Arch::Allocator *const) throw(); void operator delete[](void*, Arch::Allocator *const, const std::nothrow_t&) throw(); #endif // NEW_HXX new.hxx:21: type specifier omitted for parameter new.hxx:21: parse error before `*' token new.hxx:21: `operator new' takes type `size_t' (`unsigned int') as first parameter new.hxx:22: type specifier omitted for parameter new.hxx:22: parse error before `*' token new.hxx:22: `operator new' takes type `size_t' (`unsigned int') as first parameter new.hxx:22: declaration of `void* operator new(unsigned int, ...) throw ()' throws different exceptions new.hxx:21: than previous declaration `void* operator new(unsigned int, ...) throw (std::bad_alloc)' new.hxx:23: type specifier omitted for parameter new.hxx:23: parse error before `*' token new.hxx:23: `operator new' takes type `size_t' (`unsigned int') as first parameter new.hxx:24: type specifier omitted for parameter new.hxx:24: parse error before `*' token new.hxx:24: `operator new' takes type `size_t' (`unsigned int') as first parameter