Commit b4fbc4bd authored by Manna, Soumi's avatar Manna, Soumi
Browse files

[NFC][Clang][Coverity] Fix Static Code Analysis Concerns with copy without assign

This patch adds copy/move assignment operator to the class which has user-defined copy/move constructor.

Reviewed By: tahonermann, NoQ, aaronpuchert

Differential Revision: https://reviews.llvm.org/D150411
parent 8f061ede
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -3210,7 +3210,6 @@ private:

  public:
    ObjCEncOptions() : Bits(0) {}
    ObjCEncOptions(const ObjCEncOptions &RHS) : Bits(RHS.Bits) {}

#define OPT_LIST(V)                                                            \
  V(ExpandPointedToStructures, 0)                                              \
+4 −0
Original line number Diff line number Diff line
@@ -155,6 +155,10 @@ namespace consumed {
    ConsumedStateMap(const ConsumedStateMap &Other)
        : Reachable(Other.Reachable), From(Other.From), VarMap(Other.VarMap) {}

    // The copy assignment operator is defined as deleted pending further
    // motivation.
    ConsumedStateMap &operator=(const ConsumedStateMap &) = delete;

    /// Warn if any of the parameters being tracked are not in the state
    /// they were declared to be in upon return from a function.
    void checkParamsForReturnTypestate(SourceLocation BlameLoc,
+8 −0
Original line number Diff line number Diff line
@@ -488,6 +488,10 @@ public:
  Undefined(const Stmt *S = nullptr) : SExpr(COP_Undefined), Cstmt(S) {}
  Undefined(const Undefined &U) : SExpr(U), Cstmt(U.Cstmt) {}

  // The copy assignment operator is defined as deleted pending further
  // motivation.
  Undefined &operator=(const Undefined &) = delete;

  static bool classof(const SExpr *E) { return E->opcode() == COP_Undefined; }

  template <class V>
@@ -566,6 +570,10 @@ public:
  LiteralT(T Dat) : Literal(ValueType::getValueType<T>()), Val(Dat) {}
  LiteralT(const LiteralT<T> &L) : Literal(L), Val(L.Val) {}

  // The copy assignment operator is defined as deleted pending further
  // motivation.
  LiteralT &operator=(const LiteralT<T> &) = delete;

  T value() const { return Val;}
  T& value() { return Val; }

+4 −0
Original line number Diff line number Diff line
@@ -240,6 +240,10 @@ class CopyOnWriteVector {

    VectorData() = default;
    VectorData(const VectorData &VD) : Vect(VD.Vect) {}

    // The copy assignment operator is defined as deleted pending further
    // motivation.
    VectorData &operator=(const VectorData &) = delete;
  };

public:
+9 −0
Original line number Diff line number Diff line
@@ -42,6 +42,15 @@ public:
    Other.Alloc.setPointer(nullptr);
  }

  // The move assignment operator is defined as deleted pending further
  // motivation.
  BumpVectorContext &operator=(BumpVectorContext &&) = delete;

  // The copy constrcutor and copy assignment operator is defined as deleted
  // pending further motivation.
  BumpVectorContext(const BumpVectorContext &) = delete;
  BumpVectorContext &operator=(const BumpVectorContext &) = delete;

  /// Construct a new BumpVectorContext that reuses an existing
  /// BumpPtrAllocator.  This BumpPtrAllocator is not destroyed when the
  /// BumpVectorContext object is destroyed.
Loading