[all-commits] [llvm/llvm-project] 7e1b62: [NFC][Clang] Fix static analyzer tool remark about...

smanna12 via All-commits all-commits at lists.llvm.org
Mon Apr 17 19:25:22 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7e1b62bd9ca8ab34444c3307e19abecdd482210f
      https://github.com/llvm/llvm-project/commit/7e1b62bd9ca8ab34444c3307e19abecdd482210f
  Author: Manna, Soumi <soumi.manna at intel.com>
  Date:   2023-04-17 (Mon, 17 Apr 2023)

  Changed paths:
    M clang/lib/Analysis/UnsafeBufferUsage.cpp

  Log Message:
  -----------
  [NFC][Clang] Fix static analyzer tool remark about missing user-defined assignment operator

Reported by Coverity:

Copy without assign
This class has a user-defined copy constructor but no user-defined assignment operator. If the copy constructor is necessary to manage owned resources then a corresponding assignment operator is usually required. If an object of this type is assigned memory leaks and/or use-after-free errors may occur. Note that a compiler-generated assignment operator will perform only a bit-wise copy for any fields that do not have their own assignment operators defined.

Class has user-written copy constructor but no user-written assignment operator

copy_without_assign: Class <unnamed>::DeclUseTracker has a user-written copy constructor <unnamed>::DeclUseTracker::DeclUseTracker(<unnamed>::DeclUseTracker const &) =delete but no corresponding user-written assignment operator.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D148189




More information about the All-commits mailing list