On Wed, 2020-07-01 at 18:29 +0100, Jonathan Wakely wrote: > On 30/06/20 17:43 +0100, Jonathan Wakely wrote: > > gcc/testsuite/ChangeLog: > > > > * g++.dg/analyzer/pr94028.C: Make operator new non-throwing so > > that the compiler doesn't implicitly mark it as returning > > non-null. > > > > Fixes these: > > > > FAIL: g++.dg/analyzer/pr94028.C -std=c++98 (test for excess > > errors) > > FAIL: g++.dg/analyzer/pr94028.C -std=c++14 (test for excess > > errors) > > FAIL: g++.dg/analyzer/pr94028.C -std=c++17 (test for excess > > errors) > > FAIL: g++.dg/analyzer/pr94028.C -std=c++2a (test for excess > > errors) > > Updated to add PR 96014 to the commit log. > > OK for master?
Sorry for not responding to this earlier. My knowledge of C++ exceptions is a little rusty; I found the addition of "throw()" to mark the decl as non-throwing to be confusing. Looking in my copy of Stroustrup 4th edition (C++11) p367 it says this is an empty exception specification, and is equivalent to "noexcept", and Stroustrup recommends using the latter instead. Did you use this syntax for backwards compat with C++98, or is "noexcept" available in the earlier C++ dialects? Thanks Dave