[clang-tools-extra] [clangd] fix wrong resouce-dir (PR #203332)

Aleksandr Platonov via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 18 06:09:48 PDT 2026


================
@@ -341,8 +360,13 @@ void CommandMangler::operator()(tooling::CompileCommand &Command,
   });
 
   std::vector<std::string> ToAppend;
-  if (ResourceDir && !HasExact("-resource-dir") && !HasPrefix("-resource-dir="))
-    ToAppend.push_back(("-resource-dir=" + *ResourceDir));
+  if (!HasExact("-resource-dir") && !HasPrefix("-resource-dir=")) {
+    if (ResourceDir) {
+      ToAppend.push_back(("-resource-dir=" + *ResourceDir));
+    } else {
+      elog("No valid -resource-dir option");
+    }
+  }
----------------
ArcsinX wrote:

I think we should not change `CommandMangler::operator()`. This calls quite often and will spam a user with not very informative message.

https://github.com/llvm/llvm-project/pull/203332


More information about the cfe-commits mailing list