Skip to content

Commit a7eb8c6

Browse files
committed
simplify/fix placement new macro
1 parent 87b5629 commit a7eb8c6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

libcxx/include/__algorithm/stable_sort.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ _LIBCPP_PUSH_MACROS
3636

3737
_LIBCPP_BEGIN_NAMESPACE_STD
3838

39-
// Workaround for "constexpr placement new" bug in gcc (fixed in 14.2).
40-
// See https://github.com/llvm/llvm-project/pull/110320#discussion_r1788557715.
41-
#if (_LIBCPP_STD_VER >= 20) || \
42-
(!defined(__clang__) && defined(__GNUC__) && (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 <= 140100))
39+
// Making placement new available in constexpr contexts. This is necessary to work around a "constexpr placement new"
40+
// bug in gcc (fixed in 14.2). See https://github.com/llvm/llvm-project/pull/110320#discussion_r1788557715.
41+
#if _LIBCPP_STD_VER >= 20
4342
# define _LIBCPP_MOVING_PLACEMENT_NEW(__ptr, __type, __move_func, __iter) std::construct_at(__ptr, __move_func(__iter))
4443
#else
4544
# define _LIBCPP_MOVING_PLACEMENT_NEW(__ptr, __type, __move_func, __iter) \

0 commit comments

Comments
 (0)