Skip to content

RWC workaround: Use __builtin_trap for ancient Clang #5458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stl/inc/type_traits
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ constexpr bool is_enum_v = __is_enum(_Ty);

#if _HAS_CXX23
#if defined(__clang__) && !defined(__EDG__) \
&& __clang_major__ >= 16 // TRANSITION, DevCom-10870354, Real World Code relying on ancient Clang
&& __clang_major__ >= 16 // TRANSITION, DevCom-10870354 (MSVC, EDG), VSO-2397560 (RWC relying on ancient Clang)
_EXPORT_STD template <class _Ty>
constexpr bool is_scoped_enum_v = __is_scoped_enum(_Ty);

Expand Down
2 changes: 2 additions & 0 deletions stl/inc/yvals.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ _EMIT_STL_ERROR(STL1008, "_STL_CALL_ABORT_INSTEAD_OF_INVALID_PARAMETER has been
#ifndef _MSVC_STL_DOOM_FUNCTION
#ifdef _MSVC_STL_USE_ABORT_AS_DOOM_FUNCTION // The user wants to use abort():
#define _MSVC_STL_DOOM_FUNCTION(mesg) _CSTD abort()
#elif defined(__clang__) && __clang_major__ < 19 // TRANSITION, VSO-2397560, Real World Code relying on ancient Clang
#define _MSVC_STL_DOOM_FUNCTION(mesg) __builtin_trap()
#elif defined(__clang__) // Use the Clang intrinsic:
#define _MSVC_STL_DOOM_FUNCTION(mesg) __builtin_verbose_trap("MSVC STL error", mesg)
#elif defined(_M_CEE) // TRANSITION, VSO-2457624 (/clr silent bad codegen for __fastfail); /clr:pure lacks __fastfail
Expand Down