[PATCH] D89131: [clangd] Validate optional fields more strictly.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 12 02:05:34 PDT 2020


hokein added inline comments.


================
Comment at: clang-tools-extra/clangd/Protocol.cpp:800
+  return O && O.map("applied", R.applied) &&
+         O.mapOptional("failureReason", R.failureReason);
 }
----------------
R.failureReason's type is `llvm::Optional<std::string>`, I think we should probably use the `O.map` (the overload one for llvm::Optional)?


================
Comment at: clang-tools-extra/clangd/Protocol.cpp:1130
+         O.mapOptional("compilationDatabasePath",
+                       Opts.compilationDatabasePath) &&
+         O.mapOptional("fallbackFlags", Opts.fallbackFlags) &&
----------------
And this one.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89131/new/

https://reviews.llvm.org/D89131



More information about the cfe-commits mailing list