diff options
author | Kazu Hirata <kazu@google.com> | 2022-06-25 22:26:24 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-06-25 22:26:24 -0700 |
commit | 97afce08cbbb1390cf8ddab8bf398f3ff5b39676 (patch) | |
tree | 5dbd790ef58e24345eb2f5a56dff401ddea175d0 /clang/unittests/Tooling/RefactoringTest.cpp | |
parent | 0a0effdd5b654ed90f3c3cfae5d9d9dd0a0db8de (diff) | |
download | llvm-97afce08cbbb1390cf8ddab8bf398f3ff5b39676.zip llvm-97afce08cbbb1390cf8ddab8bf398f3ff5b39676.tar.gz llvm-97afce08cbbb1390cf8ddab8bf398f3ff5b39676.tar.bz2 |
[clang] Don't use Optional::hasValue (NFC)
This patch replaces Optional::hasValue with the implicit cast to bool
in conditionals only.
Diffstat (limited to 'clang/unittests/Tooling/RefactoringTest.cpp')
-rw-r--r-- | clang/unittests/Tooling/RefactoringTest.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/unittests/Tooling/RefactoringTest.cpp b/clang/unittests/Tooling/RefactoringTest.cpp index c71a724..f0edff6 100644 --- a/clang/unittests/Tooling/RefactoringTest.cpp +++ b/clang/unittests/Tooling/RefactoringTest.cpp @@ -118,18 +118,18 @@ static bool checkReplacementError(llvm::Error &&Error, OS << "Unexpected error code: " << int(RE.get()) << "\n"; if (ExpectedExisting != RE.getExistingReplacement()) { OS << "Expected Existing != Actual Existing.\n"; - if (ExpectedExisting.hasValue()) + if (ExpectedExisting) OS << "Expected existing replacement: " << ExpectedExisting->toString() << "\n"; - if (RE.getExistingReplacement().hasValue()) + if (RE.getExistingReplacement()) OS << "Actual existing replacement: " << RE.getExistingReplacement()->toString() << "\n"; } if (ExpectedNew != RE.getNewReplacement()) { OS << "Expected New != Actual New.\n"; - if (ExpectedNew.hasValue()) + if (ExpectedNew) OS << "Expected new replacement: " << ExpectedNew->toString() << "\n"; - if (RE.getNewReplacement().hasValue()) + if (RE.getNewReplacement()) OS << "Actual new replacement: " << RE.getNewReplacement()->toString() << "\n"; } |