Manna created this revision. Manna added a reviewer: tahonermann. Herald added subscribers: steakhal, arphaman. Herald added a reviewer: NoQ. Herald added a project: All. Manna requested review of this revision. Herald added a project: clang.
This patch adds missing assignment operator to the class which has user-defined copy/move constructor. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D150411 Files: clang/include/clang/AST/ASTContext.h clang/include/clang/Analysis/Analyses/Consumed.h clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h clang/include/clang/Analysis/Analyses/ThreadSafetyUtil.h clang/include/clang/Analysis/Support/BumpVector.h clang/include/clang/Rewrite/Core/RewriteRope.h clang/include/clang/Sema/Lookup.h clang/include/clang/Sema/Sema.h clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h clang/lib/CodeGen/CGDebugInfo.h clang/lib/CodeGen/EHScopeStack.h clang/lib/Sema/SemaAccess.cpp clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
Index: clang/utils/TableGen/ClangDiagnosticsEmitter.cpp =================================================================== --- clang/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ clang/utils/TableGen/ClangDiagnosticsEmitter.cpp @@ -654,6 +654,9 @@ O.Root = nullptr; } + DiagText(const DiagText &) = delete; + DiagText &operator=(const DiagText &) = delete; + ~DiagText() { for (Piece *P : AllocatedPieces) delete P; Index: clang/lib/Sema/SemaAccess.cpp =================================================================== --- clang/lib/Sema/SemaAccess.cpp +++ clang/lib/Sema/SemaAccess.cpp @@ -199,6 +199,13 @@ : Target(S.Target), Has(S.Has) { S.Target = nullptr; } + + SavedInstanceContext &operator=(SavedInstanceContext &&S) { + Target = S.Target; + Has = S.Has; + return *this; + } + ~SavedInstanceContext() { if (Target) Target->HasInstanceContext = Has; Index: clang/lib/CodeGen/EHScopeStack.h =================================================================== --- clang/lib/CodeGen/EHScopeStack.h +++ clang/lib/CodeGen/EHScopeStack.h @@ -147,7 +147,9 @@ public: Cleanup(const Cleanup &) = default; + Cleanup &operator=(const Cleanup &) = delete; Cleanup(Cleanup &&) {} + Cleanup &operator=(Cleanup &&) = delete; Cleanup() = default; virtual bool isRedundantBeforeReturn() { return false; } Index: clang/lib/CodeGen/CGDebugInfo.h =================================================================== --- clang/lib/CodeGen/CGDebugInfo.h +++ clang/lib/CodeGen/CGDebugInfo.h @@ -829,7 +829,12 @@ ApplyDebugLocation(ApplyDebugLocation &&Other) : CGF(Other.CGF) { Other.CGF = nullptr; } - ApplyDebugLocation &operator=(ApplyDebugLocation &&) = default; + + ApplyDebugLocation &operator=(ApplyDebugLocation &&Other) { + CGF = Other.CGF; + Other.CGF = nullptr; + return *this; + } ~ApplyDebugLocation(); Index: clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h =================================================================== --- clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h +++ clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h @@ -670,7 +670,9 @@ public: SymbolVisitor() = default; SymbolVisitor(const SymbolVisitor &) = default; + SymbolVisitor &operator=(const SymbolVisitor &) = delete; SymbolVisitor(SymbolVisitor &&) {} + SymbolVisitor &operator=(SymbolVisitor &&) = delete; /// A visitor method invoked by ProgramStateManager::scanReachableSymbols. /// Index: clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h =================================================================== --- clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h +++ clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h @@ -50,7 +50,9 @@ public: BugReporterVisitor() = default; BugReporterVisitor(const BugReporterVisitor &) = default; + BugReporterVisitor &operator=(const BugReporterVisitor &) = delete; BugReporterVisitor(BugReporterVisitor &&) {} + BugReporterVisitor &operator=(BugReporterVisitor &&) = delete; virtual ~BugReporterVisitor(); /// Return a diagnostic piece which should be associated with the Index: clang/include/clang/Sema/Sema.h =================================================================== --- clang/include/clang/Sema/Sema.h +++ clang/include/clang/Sema/Sema.h @@ -1786,7 +1786,9 @@ SemaDiagnosticBuilder(Kind K, SourceLocation Loc, unsigned DiagID, const FunctionDecl *Fn, Sema &S); SemaDiagnosticBuilder(SemaDiagnosticBuilder &&D); + SemaDiagnosticBuilder &operator=(SemaDiagnosticBuilder &&D) = delete; SemaDiagnosticBuilder(const SemaDiagnosticBuilder &) = default; + SemaDiagnosticBuilder &operator=(const SemaDiagnosticBuilder &) = delete; ~SemaDiagnosticBuilder(); bool isImmediate() const { return ImmediateDiag.has_value(); } Index: clang/include/clang/Sema/Lookup.h =================================================================== --- clang/include/clang/Sema/Lookup.h +++ clang/include/clang/Sema/Lookup.h @@ -657,6 +657,9 @@ F.CalledDone = true; } + Filter(const Filter &) = delete; + Filter &operator=(const Filter &) = delete; + ~Filter() { assert(CalledDone && "LookupResult::Filter destroyed without done() call"); Index: clang/include/clang/Rewrite/Core/RewriteRope.h =================================================================== --- clang/include/clang/Rewrite/Core/RewriteRope.h +++ clang/include/clang/Rewrite/Core/RewriteRope.h @@ -181,6 +181,9 @@ RewriteRope() = default; RewriteRope(const RewriteRope &RHS) : Chunks(RHS.Chunks) {} + RewriteRope(const RewriteRope &) = delete; + RewriteRope &operator=(const RewriteRope &) = delete; + using iterator = RopePieceBTree::iterator; using const_iterator = RopePieceBTree::iterator; Index: clang/include/clang/Analysis/Support/BumpVector.h =================================================================== --- clang/include/clang/Analysis/Support/BumpVector.h +++ clang/include/clang/Analysis/Support/BumpVector.h @@ -42,6 +42,13 @@ Other.Alloc.setPointer(nullptr); } + BumpVectorContext &operator=(BumpVectorContext &&Other) { + Alloc = Other.Alloc; + Other.Alloc.setInt(false); + Other.Alloc.setPointer(nullptr); + return *this; + } + /// Construct a new BumpVectorContext that reuses an existing /// BumpPtrAllocator. This BumpPtrAllocator is not destroyed when the /// BumpVectorContext object is destroyed. Index: clang/include/clang/Analysis/Analyses/ThreadSafetyUtil.h =================================================================== --- clang/include/clang/Analysis/Analyses/ThreadSafetyUtil.h +++ clang/include/clang/Analysis/Analyses/ThreadSafetyUtil.h @@ -240,6 +240,10 @@ VectorData() = default; VectorData(const VectorData &VD) : Vect(VD.Vect) {} + VectorData &operator=(const VectorData &VD) { + Vect = VD.Vect; + return *this; + } }; public: Index: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h =================================================================== --- clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h +++ clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h @@ -565,6 +565,11 @@ public: LiteralT(T Dat) : Literal(ValueType::getValueType<T>()), Val(Dat) {} LiteralT(const LiteralT<T> &L) : Literal(L), Val(L.Val) {} + LiteralT &operator=(const LiteralT<T> &L) { + Literal::operator=(L); + Val = L.Val; + return *this; + } T value() const { return Val;} T& value() { return Val; } Index: clang/include/clang/Analysis/Analyses/Consumed.h =================================================================== --- clang/include/clang/Analysis/Analyses/Consumed.h +++ clang/include/clang/Analysis/Analyses/Consumed.h @@ -155,6 +155,13 @@ ConsumedStateMap(const ConsumedStateMap &Other) : Reachable(Other.Reachable), From(Other.From), VarMap(Other.VarMap) {} + ConsumedStateMap &operator=(const ConsumedStateMap &Other) { + Reachable = Other.Reachable; + From = Other.From; + VarMap = Other.VarMap; + return *this; + } + /// 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, Index: clang/include/clang/AST/ASTContext.h =================================================================== --- clang/include/clang/AST/ASTContext.h +++ clang/include/clang/AST/ASTContext.h @@ -3212,6 +3212,11 @@ ObjCEncOptions() : Bits(0) {} ObjCEncOptions(const ObjCEncOptions &RHS) : Bits(RHS.Bits) {} + ObjCEncOptions &operator=(const ObjCEncOptions &RHS) { + Bits = RHS.Bits; + return *this; + } + #define OPT_LIST(V) \ V(ExpandPointedToStructures, 0) \ V(ExpandStructures, 1) \
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits