From b0e63d94835956810fa056dbb06ea3741a6862ed Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Mon, 15 Jan 2018 15:02:01 +0000 Subject: [PATCH] PR libstdc++/83830 Define std::has_unique_object_representations_v PR libstdc++/83830 * include/std/type_traits (has_unique_object_representations_v): Add variable template. * testsuite/20_util/has_unique_object_representations/value.cc: Check variable template. From-SVN: r256701 --- libstdc++-v3/ChangeLog | 8 ++++++++ libstdc++-v3/include/std/type_traits | 4 ++++ .../has_unique_object_representations/value.cc | 14 ++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 92d96c46fb7..572fbc68a08 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2018-01-15 Jonathan Wakely + + PR libstdc++/83830 + * include/std/type_traits (has_unique_object_representations_v): Add + variable template. + * testsuite/20_util/has_unique_object_representations/value.cc: Check + variable template. + 2018-01-15 Ville Voutilainen Make optional conditionally diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index 43ea68e6c6b..711d6c50dd1 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -2903,6 +2903,10 @@ template remove_cv_t> )> { }; + + template + inline constexpr bool has_unique_object_representations_v + = has_unique_object_representations<_Tp>::value; #endif #undef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP diff --git a/libstdc++-v3/testsuite/20_util/has_unique_object_representations/value.cc b/libstdc++-v3/testsuite/20_util/has_unique_object_representations/value.cc index c2a5873ee69..7ac97cf0ba4 100644 --- a/libstdc++-v3/testsuite/20_util/has_unique_object_representations/value.cc +++ b/libstdc++-v3/testsuite/20_util/has_unique_object_representations/value.cc @@ -108,3 +108,17 @@ void test01() static_assert(test_category(false), ""); } + +void +test02() +{ + using std::has_unique_object_representations; + using std::has_unique_object_representations_v; + + static_assert(has_unique_object_representations_v + == has_unique_object_representations::value); + static_assert(has_unique_object_representations_v + == has_unique_object_representations::value); + static_assert(has_unique_object_representations_v + == has_unique_object_representations::value); +} -- 2.30.2