diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2014-10-07 21:42:12 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2014-10-07 21:42:12 +0000 |
| commit | a2a481e0e3a2a7c59a990b17cb82b3ddea1bceae (patch) | |
| tree | 2fc141cf7aa352df89f4efc2da49fb4f94f6c843 /libcxx/test | |
| parent | 1f0227a4520f444f8f55a7d32607df3953f6be88 (diff) | |
| download | bcm5719-llvm-a2a481e0e3a2a7c59a990b17cb82b3ddea1bceae.tar.gz bcm5719-llvm-a2a481e0e3a2a7c59a990b17cb82b3ddea1bceae.zip | |
Fix for PR 19616: 'tuple_cat of nested tuples fails in noexcept specification'. Thanks to Louis Dionne for the fix.
llvm-svn: 219243
Diffstat (limited to 'libcxx/test')
| -rw-r--r-- | libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp | 15 | ||||
| -rw-r--r-- | libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp | 14 |
2 files changed, 28 insertions, 1 deletions
diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp index 9d3f8298757..fe0b5673bc4 100644 --- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp +++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_constructible.pass.cpp @@ -76,15 +76,28 @@ struct C void operator=(C&); // not const }; +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +struct Tuple { + Tuple(Empty&&) noexcept {} +}; +#endif + int main() { test_is_nothrow_constructible<int> (); test_is_nothrow_constructible<int, const int&> (); test_is_nothrow_constructible<Empty> (); test_is_nothrow_constructible<Empty, const Empty&> (); - +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + test_is_nothrow_constructible<Tuple &&, Empty> (); // See bug #19616. +#endif + test_is_not_nothrow_constructible<A, int> (); test_is_not_nothrow_constructible<A, int, double> (); test_is_not_nothrow_constructible<A> (); test_is_not_nothrow_constructible<C> (); +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + static_assert(!std::is_constructible<Tuple&, Empty>::value, ""); + test_is_not_nothrow_constructible<Tuple &, Empty> (); // See bug #19616. +#endif } diff --git a/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp b/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp index b47842d419c..3fca5738929 100644 --- a/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp +++ b/libcxx/test/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp @@ -213,4 +213,18 @@ int main() assert(std::get<3>(t3) == 4); assert(std::get<4>(t3) == 5); } + { + // See bug #19616. + auto t1 = std::tuple_cat( + std::make_tuple(std::make_tuple(1)), + std::make_tuple() + ); + assert(t1 == std::make_tuple(std::make_tuple(1))); + + auto t2 = std::tuple_cat( + std::make_tuple(std::make_tuple(1)), + std::make_tuple(std::make_tuple(2)) + ); + assert(t2 == std::make_tuple(std::make_tuple(1), std::make_tuple(2))); + } } |

