This is an archive of the discontinued LLVM Phabricator instance.

[Support] Require llvm::Error passed to formatv() to be wrapped in fmt_consume()
ClosedPublic

Authored by sammccall on Jul 11 2018, 1:20 AM.

Details

Summary

Someone must be responsible for handling an Error. When formatv takes
ownership of an Error, the formatv_object destructor must take care of this.

Passing an error by value to formatv() is not considered explicit enough to mark
the error as handled (see D49013), so we require callers to use a format adapter
to confirm this intent.

Diff Detail