File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ struct __uninitialized_tag {};
30
30
// initialization using __emplace.
31
31
template <class _Tp >
32
32
struct __no_destroy {
33
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __no_destroy (__uninitialized_tag) {}
33
+ _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __no_destroy (__uninitialized_tag) : __obj_() {}
34
34
35
35
template <class ... _Args>
36
36
_LIBCPP_HIDE_FROM_ABI explicit __no_destroy (_Args&&... __args) {
@@ -46,7 +46,7 @@ struct __no_destroy {
46
46
_LIBCPP_HIDE_FROM_ABI _Tp const & __get () const { return *reinterpret_cast <const _Tp*>(__obj_); }
47
47
48
48
private:
49
- _ALIGNAS_TYPE (_Tp) char __obj_[sizeof (_Tp)] = {} ;
49
+ _ALIGNAS_TYPE (_Tp) char __obj_[sizeof (_Tp)];
50
50
};
51
51
52
52
_LIBCPP_END_NAMESPACE_STD
Original file line number Diff line number Diff line change @@ -26,3 +26,8 @@ int main(int, char**) {
26
26
27
27
return 0 ;
28
28
}
29
+ #if TEST_STD_VER > 17
30
+ // Test constexpr-constructibility.
31
+ constinit std::__no_destroy<int > nd_int_const (std::__uninitialized_tag{});
32
+ #endif
33
+
You can’t perform that action at this time.
0 commit comments