[libc++] Enable `explicit` conversion operators, even in C++03 mode.
authorArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Tue, 15 Jun 2021 16:57:54 +0000 (12:57 -0400)
committerArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Tue, 22 Jun 2021 17:35:59 +0000 (13:35 -0400)
commit317e92a3e82f88f111e04132195d9daa6b97f1ab
tree3c95760cc0ab843471baff351d218edd56d9ec83
parent2e120920acd2241658f87a995c3a685603e992f3
[libc++] Enable `explicit` conversion operators, even in C++03 mode.

C++03 didn't support `explicit` conversion operators;
but Clang's C++03 mode does, as an extension, so we can use it.
This lets us make the conversion explicit in `std::function` (even in '03),
and remove some silly metaprogramming in `std::basic_ios`.

Drive-by improvements to the tests for these operators, in addition
to making sure all these tests also run in `c++03` mode.

Differential Revision: https://reviews.llvm.org/D104682
19 files changed:
libcxx/include/__config
libcxx/include/__functional_03
libcxx/include/__memory/shared_ptr.h
libcxx/include/__memory/unique_ptr.h
libcxx/include/__mutex_base
libcxx/include/exception
libcxx/include/functional
libcxx/include/ios
libcxx/include/istream
libcxx/include/ostream
libcxx/include/system_error
libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.compile.fail.cpp [deleted file]
libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.pass.cpp
libcxx/test/std/input.output/iostreams.base/ios/iostate.flags/bool.pass.cpp
libcxx/test/std/language.support/support.exception/propagation/exception_ptr.pass.cpp
libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp
libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.obs/op_bool.pass.cpp
libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.cap/operator_bool.pass.cpp
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/op_bool.pass.cpp