You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// BOOST_ENABLE_ASSERT_DEBUG_HANDLER is defined for the whole project
#include<stdexcept>// std::logic_error
#include<iostream>// std::cerr
First, implementing ignore_abort in namespace std is forbidden by N4842 16.5.4.2.1 [namespace.std]/1: "Unless otherwise specified, the behavior of a C++ program is undefined if it adds declarations or definitions to namespace std or to a namespace within namespace std."
Second, macroizing abort is extremely forbidden by 16.5.4.3.2 [macro.names]/1: "A translation unit that includes a standard library header shall not #define or #undef names declared in any standard library header."
This code is non-conformant and fails to compile with the current development version of Visual Studio:
stacktrace/example/assert_handler.cpp
Lines 27 to 34 in 211d291
First, implementing
ignore_abort
innamespace std
is forbidden by N4842 16.5.4.2.1 [namespace.std]/1: "Unless otherwise specified, the behavior of a C++ program is undefined if it adds declarations or definitions to namespacestd
or to a namespace within namespacestd
."Second, macroizing
abort
is extremely forbidden by 16.5.4.3.2 [macro.names]/1: "A translation unit that includes a standard library header shall not#define
or#undef
names declared in any standard library header."Third, this is failing to compile for the current development version of MSVC's STL because including
<iostream>
drags in<istream>
,<ostream>
,<ios>
, internal<xlocnum>
, and finally<cmath>
where our implementation oflerp()
contains a call to::abort()
which is broken by the macroizedabort
: https://github.com/microsoft/STL/blob/94c9f9965b4e39bab9fdec6f71f1fad320e96d8b/stl/inc/cmath#L1379-L1380The
assert_handler.cpp
example should be changed to follow the Standard's requirements.The text was updated successfully, but these errors were encountered: