================
@@ -830,6 +830,16 @@ bool OverlayCDB::setCompileCommand(PathRef File,
   return true;
 }
 
+std::unique_ptr<ProjectModules>
+OverlayCDB::getProjectModules(PathRef File) const {
+  auto MDB = DelegatingCDB::getProjectModules(File);
+  MDB->setCommandMangler([&Mangler = Mangler](tooling::CompileCommand &Command,
+                                              PathRef CommandPath) {
+    Mangler(Command, CommandPath);
+  });
+  return std::move(MDB);
----------------
mikaelholmen wrote:

Hi @petr-polezhaev 

I see that clang (18.1.8) complains on this move:
```
12:29:43 
../llvm-project/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp:840:10: 
error: moving a local object in a return statement prevents copy elision 
[-Werror,-Wpessimizing-move]
12:29:43   840 |   return std::move(MDB);
12:29:43       |          ^
12:29:43 
../llvm-project/clang-tools-extra/clangd/GlobalCompilationDatabase.cpp:840:10: 
note: remove std::move call here
12:29:43   840 |   return std::move(MDB);
12:29:43       |          ^~~~~~~~~~   ~
12:29:43 1 error generated.
```

https://github.com/llvm/llvm-project/pull/122606
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to