[PATCH] D105014: added some example code for llvm::Expected<T>

Christian Kühnel via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 30 01:25:54 PDT 2021


kuhnel marked 4 inline comments as done.
kuhnel added inline comments.


================
Comment at: llvm/include/llvm/Support/Error.h:462
+///
+///  Unit-testing a function returning an 'Expceted<T>':
+///   @code{.cpp}
----------------
sammccall wrote:
> This seems too intrusive/unusual to put inline to me.
> And the main thing that is non-obvious is *why* you have to structure your assertions in an unusual way, and that's not explained here.
> 
> Consider instead just briefly referencing the EXPECT_THAT_EXPECTED etc macros in llvm/Testing/Support/Error.h which are designed to simplify this a bit.
Makes sense.

However  EXPECT_THAT_EXPECTED could also use some better documentation :(


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105014/new/

https://reviews.llvm.org/D105014



More information about the cfe-commits mailing list