public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: Help with namespaces bug GCC 3.0.3....
       [not found] <616BE6A276E3714788D2AC35C40CD18D5DD1FC@whale.softwire.co.uk>
@ 2002-04-22 10:48 ` Rupert Wood
  0 siblings, 0 replies; 2+ messages in thread
From: Rupert Wood @ 2002-04-22 10:48 UTC (permalink / raw)
  To: 'Thomas J Amato'; +Cc: gcc-help

Thomas J Amato wrote:

> I was wondering if someone could tell me why this code 
> fragment fails to compile under 3.0.3 (Solaris 2.7).

I can't reproduce this. Compiling the header on its own:

   g++ -Wall -c -x c++ new.hxx

parses the file OK without warnings using v2.95.3 (and development
v3.1+) on Solaris 2.8 (sparc-sun-solaris2.8) and using v3.0.3 on HP/UX
11.00 (hppa1.1-hp-hpux11.00). I can't imagine that it's anything Solaris
2.7 specific. Are you sure that the including code is OK?

Sorry that's not much help!
Rup.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Help with namespaces bug GCC 3.0.3....
@ 2002-04-22  6:36 Thomas J Amato
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas J Amato @ 2002-04-22  6:36 UTC (permalink / raw)
  To: gcc-help

                                                                                    
                    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

<<new.hxx>>
#ifndef NEW_HXX
#define NEW_HXX

#include <new>

  // 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






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-04-22 13:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <616BE6A276E3714788D2AC35C40CD18D5DD1FC@whale.softwire.co.uk>
2002-04-22 10:48 ` Help with namespaces bug GCC 3.0.3 Rupert Wood
2002-04-22  6:36 Thomas J Amato

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).