[all-commits] [llvm/llvm-project] 179282: Optional: Deprecated value()

Fangrui Song via All-commits all-commits at lists.llvm.org
Sat Dec 17 14:43:16 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1792821c8308755593c114c3b7ae8ce33bdb08e9
      https://github.com/llvm/llvm-project/commit/1792821c8308755593c114c3b7ae8ce33bdb08e9
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-12-17 (Sat, 17 Dec 2022)

  Changed paths:
    M llvm/include/llvm/ADT/Optional.h

  Log Message:
  -----------
  Optional: Deprecated value()

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716/19

value() is a 15.0.0 API for std::optional migration.
std::optional::value() has undesired exception checking semantics and is
unavailable in older Xcode (see
_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS). Deprecate value() to prevent
new in-tree uses which may accidentally cause build breakage for older
Xcode when contributors perform std::optional migrating.

Some downtream MLIR projects such as tensorflow/mlir-hlo, stablehlo use
value(), so we do not remove it now.




More information about the All-commits mailing list