summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libcxx/include/type_traits4
-rw-r--r--libcxx/test/utilities/meta/meta.hel/integral_constant.pass.cpp5
2 files changed, 9 insertions, 0 deletions
diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits
index 450b5928eff..dd84abf2023 100644
--- a/libcxx/include/type_traits
+++ b/libcxx/include/type_traits
@@ -236,6 +236,10 @@ struct _LIBCPP_TYPE_VIS integral_constant
typedef integral_constant type;
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR operator value_type() const {return value;}
+#if _LIBCPP_STD_VER > 11
+ _LIBCPP_INLINE_VISIBILITY
+ constexpr value_type operator ()() const {return value;}
+#endif
};
template <class _Tp, _Tp __v>
diff --git a/libcxx/test/utilities/meta/meta.hel/integral_constant.pass.cpp b/libcxx/test/utilities/meta/meta.hel/integral_constant.pass.cpp
index 7f9e2769070..92d13c55e58 100644
--- a/libcxx/test/utilities/meta/meta.hel/integral_constant.pass.cpp
+++ b/libcxx/test/utilities/meta/meta.hel/integral_constant.pass.cpp
@@ -26,6 +26,11 @@ int main()
assert(_5() == 5);
#endif
+#if _LIBCPP_STD_VER > 11
+ static_assert ( _5{}() == 5, "" );
+ static_assert ( std::true_type{}(), "" );
+#endif
+
static_assert(std::false_type::value == false, "");
static_assert((std::is_same<std::false_type::value_type, bool>::value), "");
static_assert((std::is_same<std::false_type::type, std::false_type>::value), "");
OpenPOWER on IntegriCloud