[PATCH] D93981: Fix some compiler warnings

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 6 12:35:13 PST 2021


dexonsmith added a comment.

In D93981#2481315 <https://reviews.llvm.org/D93981#2481315>, @sanjoy.google wrote:

> In D93981#2476868 <https://reviews.llvm.org/D93981#2476868>, @mehdi_amini wrote:
>
>> For `Wpessimizing-move` : is this a clang or gcc warning? I remember that they would give opposite interpretation in this case.
>
> Wow, I'd have expected this to be decided by the C++ standard.  This is from GCC I believe.

You might check what Clang would do here, but I think dropping `std::move` in these cases is correct since the return type matches the declared variable type. (Maybe some version of one of the compilers implemented the warning backwards...)



================
Comment at: llvm/unittests/Support/CrashRecoveryTest.cpp:112-115
+  if (!Triple(sys::getProcessTriple()).isOSWindows()) {
     EXPECT_EQ(std::string::npos, Str.find("#1"));
+  }
 }
----------------
This is unfortunate. Can/should we fix `EXPECT_EQ` instead to use `do{...}while(0)` correctly?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93981



More information about the llvm-commits mailing list