[PATCH] D40904: [Testing/Support] Make matchers work with Expected<T&>

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 6 08:41:30 PST 2017


labath created this revision.
Herald added a subscriber: mgorny.

This did not work because the ExpectedHolder was trying to hold the
value in an Optional<T*>. Instead of trying to mimic the behavior of
Expected and try to make ExpectedHolder work with references and
non-references, I simply store the reference to the Expected object in
the holder.

I also add a bunch of tests for these matchers, which have helped me
flesh out some problems in my initial implementation of this patch, and
uncovered the fact that we are not consistent in quoting our values in
the matcher output (which I also fix).


https://reviews.llvm.org/D40904

Files:
  include/llvm/Testing/Support/Error.h
  include/llvm/Testing/Support/SupportHelpers.h
  unittests/Support/CMakeLists.txt
  unittests/Support/ErrorTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40904.125739.patch
Type: text/x-patch
Size: 4949 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171206/d81d95e4/attachment.bin>


More information about the llvm-commits mailing list