http://bugzilla.suse.com/show_bug.cgi?id=964466
http://bugzilla.suse.com/show_bug.cgi?id=964466#c3
Michal Kubeček changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |rguenther@suse.com
Flags| |needinfo?(rguenther@suse.co
| |m)
--- Comment #3 from Michal Kubeček ---
I have a problem... consider these two files:
-------------------------------------------------------------
#include <new>
void* p;
void* operator new(std::size_t s) throw (std::bad_alloc);
void* operator new(std::size_t s) throw (std::bad_alloc)
{
return p;
}
-------------------------------------------------------------
#include <new>
void* p;
void* operator new(std::size_t s) throw (std::bad_alloc);
void* operator new(std::size_t s)
{
return p;
}
-------------------------------------------------------------
First version fails to compile with gcc6 with error
"error: declaration of ... has a different exception specifier"
and the only way to compile it I could come with was to change it to the
second version (i.e. drop the throw specification from definition of the
overloaded operator).
However, second version fails to compile with gcc 4.8 or gcc5 (Factory).
These are, on the other hand, happy with the first. Is there a way to
overload operator new which would compile both with gcc6 and with older
versions?
--
You are receiving this mail because:
You are on the CC list for the bug.