diff options
author | Louis Dionne <ldionne@apple.com> | 2019-09-26 14:51:10 +0000 |
---|---|---|
committer | Louis Dionne <ldionne@apple.com> | 2019-09-26 14:51:10 +0000 |
commit | e16f2cb6789286dbfa4a184cef25b91dfb499206 (patch) | |
tree | f67676d1b91559354b68e3e9860e0ee4aae2705f /libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp | |
parent | 1822087facdfaeac69dcd14690866a4d872e3fdb (diff) | |
download | bcm5719-llvm-e16f2cb6789286dbfa4a184cef25b91dfb499206.tar.gz bcm5719-llvm-e16f2cb6789286dbfa4a184cef25b91dfb499206.zip |
[libc++] Take 2: Implement LWG 2510
Summary:
LWG2510 makes tag types like allocator_arg_t explicitly default
constructible instead of implicitly default constructible. It also
makes the constructors for std::pair and std::tuple conditionally
explicit based on the explicit-ness of the default constructibility
for the pair/tuple's elements.
This was previously committed as r372777 and reverted in r372832 due to
the commit breaking LLVM's build in C++14 mode. This issue has now been
addressed.
Reviewers: mclow.lists
Subscribers: christof, jkorous, dexonsmith, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D65161
llvm-svn: 372983
Diffstat (limited to 'libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp')
-rw-r--r-- | libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp index 46fd35ad4dd..c5b650d79a1 100644 --- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp +++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp @@ -10,7 +10,7 @@ // template <class... Types> class tuple; -// constexpr tuple(); +// explicit(see-below) constexpr tuple(); // UNSUPPORTED: c++98, c++03 @@ -107,6 +107,11 @@ int main(int, char**) IllFormedDefault v(0); std::tuple<IllFormedDefault> t(v); } + { + struct Base { }; + struct Derived : Base { protected: Derived() = default; }; + static_assert(!std::is_default_constructible<std::tuple<Derived, int> >::value, ""); + } - return 0; + return 0; } |