aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Testing/Support/SupportHelpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Testing/Support/SupportHelpers.h')
-rw-r--r--include/llvm/Testing/Support/SupportHelpers.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/llvm/Testing/Support/SupportHelpers.h b/include/llvm/Testing/Support/SupportHelpers.h
index c4dd414b80dbc..d7f0c7142b2ca 100644
--- a/include/llvm/Testing/Support/SupportHelpers.h
+++ b/include/llvm/Testing/Support/SupportHelpers.h
@@ -22,7 +22,10 @@ struct ErrorHolder {
};
template <typename T> struct ExpectedHolder : public ErrorHolder {
- Optional<T *> Value;
+ ExpectedHolder(ErrorHolder Err, Expected<T> &Exp)
+ : ErrorHolder(std::move(Err)), Exp(Exp) {}
+
+ Expected<T> &Exp;
};
inline void PrintTo(const ErrorHolder &Err, std::ostream *Out) {
@@ -35,8 +38,7 @@ inline void PrintTo(const ErrorHolder &Err, std::ostream *Out) {
template <typename T>
void PrintTo(const ExpectedHolder<T> &Item, std::ostream *Out) {
if (Item.Success) {
- *Out << "succeeded with value \"" << ::testing::PrintToString(**Item.Value)
- << "\"";
+ *Out << "succeeded with value " << ::testing::PrintToString(*Item.Exp);
} else {
PrintTo(static_cast<const ErrorHolder &>(Item), Out);
}