From: Jonathan Wakely Date: Mon, 15 Jan 2018 15:02:01 +0000 (+0000) Subject: PR libstdc++/83830 Define std::has_unique_object_representations_v X-Git-Tag: basepoints/gcc-9~1875 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0e63d94835956810fa056dbb06ea3741a6862ed;p=thirdparty%2Fgcc.git 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 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 92d96c46fb74..572fbc68a081 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 43ea68e6c6b3..711d6c50dd14 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 c2a5873ee692..7ac97cf0ba42 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); +}