summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Dionne <ldionne@apple.com>2019-11-14 08:54:23 -0500
committerLouis Dionne <ldionne@apple.com>2019-11-14 08:55:19 -0500
commit8b77a3a0f4ef8c2cda3a0437fe54e2c2ecef1b17 (patch)
tree6fbb269c420373635ce5159cfc0e575f074b0e1f
parentf9dd03b135d7c40733bc1eaccde7c690f00be9e2 (diff)
downloadbcm5719-llvm-8b77a3a0f4ef8c2cda3a0437fe54e2c2ecef1b17.tar.gz
bcm5719-llvm-8b77a3a0f4ef8c2cda3a0437fe54e2c2ecef1b17.zip
[libc++] [P1612] Add missing feature-test macro __cpp_lib_endian.
Thanks to Marek Kurdej for the patch. Differential Revision: https://reviews.llvm.org/D70221
-rw-r--r--libcxx/docs/FeatureTestMacroTable.rst4
-rw-r--r--libcxx/include/version2
-rw-r--r--libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.pass.cpp20
-rw-r--r--libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp20
-rwxr-xr-xlibcxx/utils/generate_feature_test_macro_components.py6
-rw-r--r--libcxx/www/cxx2a_status.html2
6 files changed, 52 insertions, 2 deletions
diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst
index 2200a998aa4..3dd00fabf62 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -20,7 +20,7 @@ Status
.. table:: Current Status
:name: feature-status-table
:widths: auto
-
+
================================================= =================
Macro Name Value
================================================= =================
@@ -184,6 +184,8 @@ Status
------------------------------------------------- -----------------
``__cpp_lib_destroying_delete`` ``201806L``
------------------------------------------------- -----------------
+ ``__cpp_lib_endian`` ``201907L``
+ ------------------------------------------------- -----------------
``__cpp_lib_erase_if`` ``201811L``
------------------------------------------------- -----------------
``__cpp_lib_generic_unordered_lookup`` *unimplemented*
diff --git a/libcxx/include/version b/libcxx/include/version
index fe9cfed876b..2abc71e0f38 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -43,6 +43,7 @@ __cpp_lib_constexpr_misc 201811L <array> <functio
__cpp_lib_constexpr_swap_algorithms 201806L <algorithm>
__cpp_lib_destroying_delete 201806L <new>
__cpp_lib_enable_shared_from_this 201603L <memory>
+__cpp_lib_endian 201907L <bit>
__cpp_lib_erase_if 201811L <string> <deque> <forward_list>
<list> <vector> <map>
<set> <unordered_map> <unordered_set>
@@ -223,6 +224,7 @@ __cpp_lib_void_t 201411L <type_traits>
# if _LIBCPP_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L
# define __cpp_lib_destroying_delete 201806L
# endif
+# define __cpp_lib_endian 201907L
# define __cpp_lib_erase_if 201811L
// # define __cpp_lib_generic_unordered_lookup 201811L
# define __cpp_lib_interpolate 201902L
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.pass.cpp
index 3e42d06fbe8..4f99d8d86a7 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/bit.version.pass.cpp
@@ -15,6 +15,7 @@
/* Constant Value
__cpp_lib_bit_cast 201806L [C++2a]
+ __cpp_lib_endian 201907L [C++2a]
*/
#include <bit>
@@ -26,18 +27,30 @@
# error "__cpp_lib_bit_cast should not be defined before c++2a"
# endif
+# ifdef __cpp_lib_endian
+# error "__cpp_lib_endian should not be defined before c++2a"
+# endif
+
#elif TEST_STD_VER == 14
# ifdef __cpp_lib_bit_cast
# error "__cpp_lib_bit_cast should not be defined before c++2a"
# endif
+# ifdef __cpp_lib_endian
+# error "__cpp_lib_endian should not be defined before c++2a"
+# endif
+
#elif TEST_STD_VER == 17
# ifdef __cpp_lib_bit_cast
# error "__cpp_lib_bit_cast should not be defined before c++2a"
# endif
+# ifdef __cpp_lib_endian
+# error "__cpp_lib_endian should not be defined before c++2a"
+# endif
+
#elif TEST_STD_VER > 17
# if !defined(_LIBCPP_VERSION)
@@ -53,6 +66,13 @@
# endif
# endif
+# ifndef __cpp_lib_endian
+# error "__cpp_lib_endian should be defined in c++2a"
+# endif
+# if __cpp_lib_endian != 201907L
+# error "__cpp_lib_endian should have the value 201907L in c++2a"
+# endif
+
#endif // TEST_STD_VER > 17
int main(int, char**) { return 0; }
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp
index 3503051afad..e721b73ed06 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp
@@ -37,6 +37,7 @@
__cpp_lib_constexpr_swap_algorithms 201806L [C++2a]
__cpp_lib_destroying_delete 201806L [C++2a]
__cpp_lib_enable_shared_from_this 201603L [C++17]
+ __cpp_lib_endian 201907L [C++2a]
__cpp_lib_erase_if 201811L [C++2a]
__cpp_lib_exchange_function 201304L [C++14]
__cpp_lib_execution 201603L [C++17]
@@ -197,6 +198,10 @@
# error "__cpp_lib_enable_shared_from_this should not be defined before c++17"
# endif
+# ifdef __cpp_lib_endian
+# error "__cpp_lib_endian should not be defined before c++2a"
+# endif
+
# ifdef __cpp_lib_erase_if
# error "__cpp_lib_erase_if should not be defined before c++2a"
# endif
@@ -537,6 +542,10 @@
# error "__cpp_lib_enable_shared_from_this should not be defined before c++17"
# endif
+# ifdef __cpp_lib_endian
+# error "__cpp_lib_endian should not be defined before c++2a"
+# endif
+
# ifdef __cpp_lib_erase_if
# error "__cpp_lib_erase_if should not be defined before c++2a"
# endif
@@ -994,6 +1003,10 @@
# error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++17"
# endif
+# ifdef __cpp_lib_endian
+# error "__cpp_lib_endian should not be defined before c++2a"
+# endif
+
# ifdef __cpp_lib_erase_if
# error "__cpp_lib_erase_if should not be defined before c++2a"
# endif
@@ -1682,6 +1695,13 @@
# error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++2a"
# endif
+# ifndef __cpp_lib_endian
+# error "__cpp_lib_endian should be defined in c++2a"
+# endif
+# if __cpp_lib_endian != 201907L
+# error "__cpp_lib_endian should have the value 201907L in c++2a"
+# endif
+
# ifndef __cpp_lib_erase_if
# error "__cpp_lib_erase_if should be defined in c++2a"
# endif
diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py
index b1721938c60..a6191a50899 100755
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -580,6 +580,12 @@ feature_test_macros = sorted([ add_version_header(x) for x in [
},
"headers": ["numeric"],
},
+ {"name": "__cpp_lib_endian",
+ "values": {
+ "c++2a": int(201907),
+ },
+ "headers": ["bit"],
+ },
]], key=lambda tc: tc["name"])
def get_std_dialects():
diff --git a/libcxx/www/cxx2a_status.html b/libcxx/www/cxx2a_status.html
index 995e1614b38..cf2e397d0ca 100644
--- a/libcxx/www/cxx2a_status.html
+++ b/libcxx/www/cxx2a_status.html
@@ -181,7 +181,7 @@
<tr><td><a href="https://wg21.link/P1502">P1502</a></td><td>LWG</td><td>Standard library header units for C++20</td><td>Cologne</td><td></td><td></td></tr>
<tr><td><a href="https://wg21.link/P1522">P1522</a></td><td>LWG</td><td>Iterator Difference Type and Integer Overflow</td><td>Cologne</td><td></td><td></td></tr>
<tr><td><a href="https://wg21.link/P1523">P1523</a></td><td>LWG</td><td>Views and Size Types</td><td>Cologne</td><td></td><td></td></tr>
- <tr><td><a href="https://wg21.link/P1612">P1612</a></td><td>LWG</td><td>Relocate Endian’s Specification</td><td>Cologne</td><td></td><td></td></tr>
+ <tr><td><a href="https://wg21.link/P1612">P1612</a></td><td>LWG</td><td>Relocate Endian’s Specification</td><td>Cologne</td><td>Complete</td><td>10.0</td></tr>
<tr><td><a href="https://wg21.link/P1614">P1614</a></td><td>LWG</td><td>The Mothership has Landed</td><td>Cologne</td><td></td><td></td></tr>
<tr><td><a href="https://wg21.link/P1638">P1638</a></td><td>LWG</td><td>basic_istream_view::iterator should not be copyable</td><td>Cologne</td><td></td><td></td></tr>
<tr><td><a href="https://wg21.link/P1643">P1643</a></td><td>LWG</td><td>Add wait/notify to atomic_ref</td><td>Cologne</td><td></td><td></td></tr>
OpenPOWER on IntegriCloud