[PATCH] D34744: [DWARF] - Simplify HandleExpectedError implementation in DWARFDebugInfoTest

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 08:16:38 PDT 2017


grimar added a comment.

In https://reviews.llvm.org/D34744#793819, @dblaikie wrote:

> I don't quite follow your description - this looks like it would print error messages, if the llvm::Error has a textual message (which not all do). I would expect the behavior should perhaps flip the other way - fix it so it does print a message even if the llvm::Error doesn't have a textual message itself? (I think llvm::Error has a more general tool for textual repreesntation, rather than just the message? Not sure)


What I was mean that

  if (!ErrorMsg.empty()) {
    ::testing::AssertionFailure() << "error: " << ErrorMsg;
    return true;
  }

creates temporarily object AssertionResult and calls operator<<. That does not print any messages. Object is destroyed after call and all messages
it contains inside after << are dying with it silently. And at first look it seems that method should assert, but this object never used. 
So I believe code is equal to what I wrote in this patch.


https://reviews.llvm.org/D34744





More information about the llvm-commits mailing list