PATCH: add a c'tor to ErrorOr that allows us to perform two user defined conversions

Nick Lewycky via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 3 18:58:27 PST 2016


The attached patch changes ErrorOr to make this code:

  ErrorOr<string> test() { return "literal"; }

work. Without this patch it fails because it would require two user-defined
conversions in a row. Please review!

I'm not sure whether it's correct to describe this as "perfect forwarding"?

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160203/3d4a5ab8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: erroror-implicitcast-1.patch
Type: text/x-patch
Size: 1353 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160203/3d4a5ab8/attachment.bin>


More information about the llvm-commits mailing list