firewave added a comment.

Another false positive:

  #include <unordered_map>
  
  void evaluateLibraryFunction()
  {
        std::unordered_map<int, const void*> m;
  
        auto f = [m]() {};
  }



  input.cpp:7:12: warning: Parameter 'm' is copied on last use, consider moving 
it instead. [performance-unnecessary-copy-on-last-use]
          auto f = [m]() {};
                    ^
                    std::move( )

This is suggested regardless of the C++ standard defined (unfortunately I 
didn't get a `-Wc++14-extensions` warning out of clang-tidy).

Also the fix-it will result in invalid code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137205

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to