On 03/12/20 19:25 +0000, Jonathan Wakely wrote:
Thanks to Jakub's addition of the built-in, we can add this to the
library now. The compiler tests for the built-in are quite extensive,
including verifying the constraints, so this only adds minimal tests to
the library testsuite.
This doesn't add a new _GLIBCXX_HAVE_BUILTIN_BIT_CAST because using
__has_builtin(__builtin_bit_cast) works for GCC and versions of Clang
that provide the built-in.
libstdc++-v3/ChangeLog:
PR libstdc++/93121
* include/std/bit (__cpp_lib_bit_cast, bit_cast): Define.
* include/std/version (__cpp_lib_bit_cast): Define.
* testsuite/26_numerics/bit/bit.cast/bit_cast.cc: New test.
* testsuite/26_numerics/bit/bit.cast/version.cc: New test.
This fixes some typos in the new tests.
Tested x86_64-linux. Committed to trunk.
commit 656131e06aa76ba3cb50305c07cf5c8ee79fce44
Author: Jonathan Wakely <jwak...@redhat.com>
Date: Thu Dec 3 19:30:02 2020
libstdc++: Fix typos in #error strings
libstdc++-v3/ChangeLog:
* testsuite/26_numerics/bit/bit.cast/bit_cast.cc: Remove stray
word from copy&paste.
* testsuite/26_numerics/bit/bit.cast/version.cc: Likewise.
diff --git a/libstdc++-v3/testsuite/26_numerics/bit/bit.cast/bit_cast.cc b/libstdc++-v3/testsuite/26_numerics/bit/bit.cast/bit_cast.cc
index b451f152b47..138ceb1c4d6 100644
--- a/libstdc++-v3/testsuite/26_numerics/bit/bit.cast/bit_cast.cc
+++ b/libstdc++-v3/testsuite/26_numerics/bit/bit.cast/bit_cast.cc
@@ -21,9 +21,9 @@
#include <bit>
#ifndef __cpp_lib_bit_cast
-# error "Feature-test macro for bit_cast wait missing in <bit>"
+# error "Feature-test macro for bit_cast missing in <bit>"
#elif __cpp_lib_bit_cast != 201806L
-# error "Feature-test macro for bit_cast wait has wrong value in <bit>"
+# error "Feature-test macro for bit_cast has wrong value in <bit>"
#endif
#include <cstdint>
diff --git a/libstdc++-v3/testsuite/26_numerics/bit/bit.cast/version.cc b/libstdc++-v3/testsuite/26_numerics/bit/bit.cast/version.cc
index 688d44bbb89..82e97543481 100644
--- a/libstdc++-v3/testsuite/26_numerics/bit/bit.cast/version.cc
+++ b/libstdc++-v3/testsuite/26_numerics/bit/bit.cast/version.cc
@@ -21,7 +21,7 @@
#include <version>
#ifndef __cpp_lib_bit_cast
-# error "Feature-test macro for bit_cast wait missing in <version>"
+# error "Feature-test macro for bit_cast missing in <version>"
#elif __cpp_lib_bit_cast != 201806L
-# error "Feature-test macro for bit_cast wait has wrong value in <version>"
+# error "Feature-test macro for bit_cast has wrong value in <version>"
#endif