diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2013-10-05 18:46:37 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2013-10-05 18:46:37 +0000 |
commit | de9320aa2b1fa3a77ba656d227310e24e974ff3f (patch) | |
tree | 85024bedfcedb80e587be808e142834bbc64da5d /libcxx/test/utilities/tuple | |
parent | 80bd135e7a8bdcaf20513ebe6629f246d0cc920a (diff) | |
download | bcm5719-llvm-de9320aa2b1fa3a77ba656d227310e24e974ff3f.tar.gz bcm5719-llvm-de9320aa2b1fa3a77ba656d227310e24e974ff3f.zip |
Implement LWG issue 2275 'forward_as_tuple should be constexpr'
llvm-svn: 192038
Diffstat (limited to 'libcxx/test/utilities/tuple')
-rw-r--r-- | libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp index 148850ee0d6..5e84ff8e882 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp @@ -51,6 +51,15 @@ test2a(const Tuple& t) assert(std::get<1>(t) == 'a'); } +#if _LIBCPP_STD_VER > 11 +template <class Tuple> +constexpr int +test3(const Tuple& t) +{ + return std::tuple_size<Tuple>::value; +} +#endif + int main() { { @@ -67,5 +76,8 @@ int main() double i = 2.5; char c = 'a'; test2a(std::forward_as_tuple(i, c)); +#if _LIBCPP_STD_VER > 11 + static_assert ( test3 (std::forward_as_tuple(i, c)) == 2, "" ); +#endif } } |