[all-commits] [llvm/llvm-project] 317e92: [libc++] Enable `explicit` conversion operators, e...

Quuxplusone via All-commits all-commits at lists.llvm.org
Tue Jun 22 10:37:20 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 317e92a3e82f88f111e04132195d9daa6b97f1ab
      https://github.com/llvm/llvm-project/commit/317e92a3e82f88f111e04132195d9daa6b97f1ab
  Author: Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
  Date:   2021-06-22 (Tue, 22 Jun 2021)

  Changed paths:
    M libcxx/include/__config
    M libcxx/include/__functional_03
    M libcxx/include/__memory/shared_ptr.h
    M libcxx/include/__memory/unique_ptr.h
    M libcxx/include/__mutex_base
    M libcxx/include/exception
    M libcxx/include/functional
    M libcxx/include/ios
    M libcxx/include/istream
    M libcxx/include/ostream
    M libcxx/include/system_error
    R libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.compile.fail.cpp
    M libcxx/test/std/diagnostics/syserr/syserr.errcode/syserr.errcode.observers/bool.pass.cpp
    M libcxx/test/std/input.output/iostreams.base/ios/iostate.flags/bool.pass.cpp
    M libcxx/test/std/language.support/support.exception/propagation/exception_ptr.pass.cpp
    M libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.obs/op_bool.pass.cpp
    M libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.obs/op_bool.pass.cpp
    M libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.cap/operator_bool.pass.cpp
    M libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/op_bool.pass.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list