Skip to content

Commit 90a2082

Browse files
committed
undo __libcpp_is_constant_evaluated to fix
‘constexpr’ constructor does not have empty body
1 parent e0eb0f2 commit 90a2082

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

libcxx/include/__utility/no_destroy.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#define _LIBCPP___UTILITY_NO_DESTROY_H
1111

1212
#include <__config>
13-
#include <__memory/construct_at.h>
1413
#include <__type_traits/is_constant_evaluated.h>
1514
#include <__utility/forward.h>
1615
#include <new>
@@ -31,12 +30,7 @@ struct __uninitialized_tag {};
3130
// initialization using __emplace.
3231
template <class _Tp>
3332
struct __no_destroy {
34-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __no_destroy(__uninitialized_tag) {
35-
if (__libcpp_is_constant_evaluated()) {
36-
for (size_t __i = 0; __i != sizeof(__obj_); ++__i)
37-
std::__construct_at(__obj_ + __i);
38-
}
39-
}
33+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __no_destroy(__uninitialized_tag) : __obj_() { }
4034

4135
template <class... _Args>
4236
_LIBCPP_HIDE_FROM_ABI explicit __no_destroy(_Args&&... __args) {

0 commit comments

Comments
 (0)