Message ID | 20240608150818.457672-1-jwakely@redhat.com |
---|---|
State | New |
Headers | show |
Series | [committed,v2,libstdc++] Add constexpr specifier to function __atomic_impl::__clear_padding | expand |
diff --git a/libstdc++-v3/include/bits/atomic_base.h b/libstdc++-v3/include/bits/atomic_base.h index 062f1549740..20901b7fc06 100644 --- a/libstdc++-v3/include/bits/atomic_base.h +++ b/libstdc++-v3/include/bits/atomic_base.h @@ -968,7 +968,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } template<typename _Tp> - _GLIBCXX_ALWAYS_INLINE _Tp* + _GLIBCXX_ALWAYS_INLINE _GLIBCXX14_CONSTEXPR _Tp* __clear_padding(_Tp& __val) noexcept { auto* __ptr = std::__addressof(__val); diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_float/constinit.cc b/libstdc++-v3/testsuite/29_atomics/atomic_float/constinit.cc new file mode 100644 index 00000000000..6b3f4f76b4c --- /dev/null +++ b/libstdc++-v3/testsuite/29_atomics/atomic_float/constinit.cc @@ -0,0 +1,3 @@ +// { dg-do compile { target c++20 } } +#include <atomic> +constinit std::atomic<float> a(0.0f);