[clang-tools-extra] r318780 - [clangd] Satisfy GCC: 'changes meaning of Error'

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 21 09:02:25 PST 2017


Author: sammccall
Date: Tue Nov 21 09:02:24 2017
New Revision: 318780

URL: http://llvm.org/viewvc/llvm-project?rev=318780&view=rev
Log:
[clangd] Satisfy GCC: 'changes meaning of Error'

Modified:
    clang-tools-extra/trunk/clangd/JSONExpr.cpp

Modified: clang-tools-extra/trunk/clangd/JSONExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/JSONExpr.cpp?rev=318780&r1=318779&r2=318780&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/JSONExpr.cpp (original)
+++ clang-tools-extra/trunk/clangd/JSONExpr.cpp Tue Nov 21 09:02:24 2017
@@ -94,8 +94,8 @@ public:
   }
 
   Error takeError() {
-    assert(Error);
-    return std::move(*Error);
+    assert(Err);
+    return std::move(*Err);
   }
 
 private:
@@ -104,7 +104,7 @@ private:
       ++P;
   }
 
-  // On invalid syntax, parseX() functions return false and and set Error.
+  // On invalid syntax, parseX() functions return false and and set Err.
   bool parseNumber(char First, double &Out);
   bool parseString(std::string &Out);
   bool parseUnicode(std::string &Out);
@@ -119,7 +119,7 @@ private:
   }
   static void encodeUtf8(uint32_t Rune, std::string &Out);
 
-  Optional<Error> Error;
+  Optional<Error> Err;
   const char *Start, *P, *End;
 };
 
@@ -365,7 +365,7 @@ bool Parser::parseError(const char *Msg)
       StartOfLine = X + 1;
     }
   }
-  Error.emplace(
+  Err.emplace(
       llvm::make_unique<ParseError>(Msg, Line, P - StartOfLine, P - Start));
   return false;
 }




More information about the cfe-commits mailing list