http://bugzilla.novell.com/show_bug.cgi?id=964466
http://bugzilla.novell.com/show_bug.cgi?id=964466#c4
Richard Biener changed:
What |Removed |Added
----------------------------------------------------------------------------
Flags|needinfo?(rguenther@suse.co |
|m) |
--- Comment #4 from Richard Biener ---
The issue here is the choice of the language standard - c++98 declares global
new
with throw (std::bad_alloc) while c++04 and up do not have an exception
specifier.
Now, GCC 6 defaults to -std=gnu++14 while GCC 5 and below default to
-std=gnu++98.
So you have the choice to either fix the standard to a particular version
during
compile (likely the known-to-work -std=gnu++98) or simply avoid re-declaring
new. Thus, do
#include <new>
void *p;
void* operator new(std::size_t s)
{
return p;
}
this way you simply inherit the correct exception specification as provided
by the declaration in <new>.
--
You are receiving this mail because:
You are on the CC list for the bug.