[clang-tools-extra] r369666 - Fixed Missing Expected error handling

Shaurya Gupta via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 22 09:42:42 PDT 2019


Author: sureyeaah
Date: Thu Aug 22 09:42:42 2019
New Revision: 369666

URL: http://llvm.org/viewvc/llvm-project?rev=369666&view=rev
Log:
Fixed Missing Expected error handling

Modified:
    clang-tools-extra/trunk/clangd/unittests/TweakTesting.cpp

Modified: clang-tools-extra/trunk/clangd/unittests/TweakTesting.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/TweakTesting.cpp?rev=369666&r1=369665&r2=369666&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/TweakTesting.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/TweakTesting.cpp Thu Aug 22 09:42:42 2019
@@ -89,8 +89,10 @@ std::string TweakTest::apply(llvm::Strin
   Tweak::Selection S(AST, Selection.first, Selection.second);
 
   auto T = prepareTweak(TweakID, S);
-  if (!T)
+  if (!T) {
+    llvm::toString(T.takeError());
     return "unavailable";
+  }
   llvm::Expected<Tweak::Effect> Result = (*T)->apply(S);
   if (!Result)
     return "fail: " + llvm::toString(Result.takeError());




More information about the cfe-commits mailing list