[PATCH] D49013: [Support] Allow formatv() to consume llvm::Error by-value without crashing.

Sam McCall via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 10 07:03:24 PDT 2018


sammccall added a comment.

An alternate approach in https://reviews.llvm.org/D49129: give `Error` an overloaded `operator<<` that has the same consume semantics at `toString` when passed rvalues.

This makes `formatv`, `to_string`, `toString` all do basically the same thing (which is the only sensible thing to do when passed an rvalue).

It does require minor changes to `formatv` and `to_string` to make them propagate the right kind of reference, but these seem reasonable.

Overall I think I like that approach better than this one (more consistent, Error handling lives in Error.h). WDYT?


Repository:
  rL LLVM

https://reviews.llvm.org/D49013





More information about the llvm-commits mailing list