1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 // template <class T> constexpr T* launder(T* p) noexcept;
13 // UNSUPPORTED: c++03, c++11, c++14
17 #include <type_traits>
20 constexpr float gf
= 8.f
;
22 int main(int, char**) {
23 static_assert(std::launder(&gi
) == &gi
, "" );
24 static_assert(std::launder(&gf
) == &gf
, "" );
28 static_assert(std::is_same
<decltype(i
), decltype(std::launder(i
))>::value
, "");
29 static_assert(std::is_same
<decltype(f
), decltype(std::launder(f
))>::value
, "");
31 assert(std::launder(i
) == i
);
32 assert(std::launder(f
) == f
);