[PATCH] D48966: [Support] Make Error and formatv_object_base printable with formatv().

Sam McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 5 05:46:58 PDT 2018


sammccall created this revision.
sammccall added a reviewer: bkramer.
Herald added subscribers: llvm-commits, mgorny.

Error's new operator<< is the first way to print an error without consuming it.

This has the surprising effect that llvm::toString(E) consumes the error while
the newly-compiling llvm::to_string(E) does not.
IMO we should consider deprecating or renaming the former, having toString mark
the error as handled seems subtle enough to need a more explicit name.


Repository:
  rL LLVM

https://reviews.llvm.org/D48966

Files:
  include/llvm/Support/Error.h
  include/llvm/Support/FormatProviders.h
  include/llvm/Support/FormatVariadic.h
  lib/Support/CMakeLists.txt
  lib/Support/FormatProviders.cpp
  unittests/Support/FormatVariadicTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48966.154213.patch
Type: text/x-patch
Size: 3760 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180705/8f4601e4/attachment.bin>


More information about the llvm-commits mailing list