diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -3210,7 +3210,6 @@ public: ObjCEncOptions() : Bits(0) {} - ObjCEncOptions(const ObjCEncOptions &RHS) : Bits(RHS.Bits) {} #define OPT_LIST(V) \ V(ExpandPointedToStructures, 0) \ diff --git a/clang/include/clang/Analysis/Analyses/Consumed.h b/clang/include/clang/Analysis/Analyses/Consumed.h --- a/clang/include/clang/Analysis/Analyses/Consumed.h +++ b/clang/include/clang/Analysis/Analyses/Consumed.h @@ -155,6 +155,10 @@ 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, diff --git a/clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h b/clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h --- a/clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h +++ b/clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h @@ -488,6 +488,10 @@ 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 @@ -566,6 +570,10 @@ LiteralT(T Dat) : Literal(ValueType::getValueType()), Val(Dat) {} LiteralT(const LiteralT &L) : Literal(L), Val(L.Val) {} + // The copy assignment operator is defined as deleted pending further + // motivation. + LiteralT &operator=(const LiteralT &) = delete; + T value() const { return Val;} T& value() { return Val; } diff --git a/clang/include/clang/Analysis/Analyses/ThreadSafetyUtil.h b/clang/include/clang/Analysis/Analyses/ThreadSafetyUtil.h --- a/clang/include/clang/Analysis/Analyses/ThreadSafetyUtil.h +++ b/clang/include/clang/Analysis/Analyses/ThreadSafetyUtil.h @@ -240,6 +240,10 @@ 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: diff --git a/clang/include/clang/Analysis/Support/BumpVector.h b/clang/include/clang/Analysis/Support/BumpVector.h --- a/clang/include/clang/Analysis/Support/BumpVector.h +++ b/clang/include/clang/Analysis/Support/BumpVector.h @@ -42,6 +42,15 @@ 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. diff --git a/clang/include/clang/Rewrite/Core/RewriteRope.h b/clang/include/clang/Rewrite/Core/RewriteRope.h --- a/clang/include/clang/Rewrite/Core/RewriteRope.h +++ b/clang/include/clang/Rewrite/Core/RewriteRope.h @@ -181,6 +181,10 @@ RewriteRope() = default; RewriteRope(const RewriteRope &RHS) : Chunks(RHS.Chunks) {} + // The copy assignment operator is defined as deleted pending further + // motivation. + RewriteRope &operator=(const RewriteRope &) = delete; + using iterator = RopePieceBTree::iterator; using const_iterator = RopePieceBTree::iterator; diff --git a/clang/include/clang/Sema/Lookup.h b/clang/include/clang/Sema/Lookup.h --- a/clang/include/clang/Sema/Lookup.h +++ b/clang/include/clang/Sema/Lookup.h @@ -657,6 +657,15 @@ F.CalledDone = true; } + // The move assignment operator is defined as deleted pending + // further motivation. + Filter &operator=(Filter &&) = delete; + + // The copy constrcutor and copy assignment operator is defined as deleted + // pending further motivation. + Filter(const Filter &) = delete; + Filter &operator=(const Filter &) = delete; + ~Filter() { assert(CalledDone && "LookupResult::Filter destroyed without done() call"); diff --git a/clang/include/clang/Sema/ParsedAttr.h b/clang/include/clang/Sema/ParsedAttr.h --- a/clang/include/clang/Sema/ParsedAttr.h +++ b/clang/include/clang/Sema/ParsedAttr.h @@ -696,6 +696,8 @@ AttributePool(AttributeFactory &factory) : Factory(factory) {} AttributePool(const AttributePool &) = delete; + // The copy assignment operator is defined as deleted pending further + // motivation. AttributePool &operator=(const AttributePool &) = delete; ~AttributePool() { Factory.reclaimPool(*this); } @@ -703,6 +705,10 @@ /// Move the given pool's allocations to this pool. AttributePool(AttributePool &&pool) = default; + // The move assignment operator is defined as deleted pending further + // motivation. + AttributePool &operator=(AttributePool &&pool) = delete; + AttributeFactory &getFactory() const { return Factory; } void clear() { diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h --- a/clang/include/clang/Sema/Sema.h +++ b/clang/include/clang/Sema/Sema.h @@ -1787,6 +1787,12 @@ const FunctionDecl *Fn, Sema &S); SemaDiagnosticBuilder(SemaDiagnosticBuilder &&D); SemaDiagnosticBuilder(const SemaDiagnosticBuilder &) = default; + + // The copy and move assignment operator is defined as deleted pending + // further motivation. + SemaDiagnosticBuilder &operator=(const SemaDiagnosticBuilder &) = delete; + SemaDiagnosticBuilder &operator=(SemaDiagnosticBuilder &&) = delete; + ~SemaDiagnosticBuilder(); bool isImmediate() const { return ImmediateDiag.has_value(); } diff --git a/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h b/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h --- a/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h +++ b/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitors.h @@ -51,6 +51,12 @@ BugReporterVisitor() = default; BugReporterVisitor(const BugReporterVisitor &) = default; BugReporterVisitor(BugReporterVisitor &&) {} + + // The copy and move assignment operator is defined as deleted pending further + // motivation. + BugReporterVisitor &operator=(const BugReporterVisitor &) = delete; + BugReporterVisitor &operator=(BugReporterVisitor &&) = delete; + virtual ~BugReporterVisitor(); /// Return a diagnostic piece which should be associated with the diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h --- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h +++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h @@ -672,6 +672,11 @@ SymbolVisitor(const SymbolVisitor &) = default; SymbolVisitor(SymbolVisitor &&) {} + // The copy and move assignment operator is defined as deleted pending further + // motivation. + SymbolVisitor &operator=(const SymbolVisitor &) = delete; + SymbolVisitor &operator=(SymbolVisitor &&) = delete; + /// A visitor method invoked by ProgramStateManager::scanReachableSymbols. /// /// The method returns \c true if symbols should continue be scanned and \c diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h --- a/clang/lib/CodeGen/CGDebugInfo.h +++ b/clang/lib/CodeGen/CGDebugInfo.h @@ -829,7 +829,13 @@ ApplyDebugLocation(ApplyDebugLocation &&Other) : CGF(Other.CGF) { Other.CGF = nullptr; } - ApplyDebugLocation &operator=(ApplyDebugLocation &&) = default; + + // Define copy assignment operator. + ApplyDebugLocation &operator=(ApplyDebugLocation &&Other) { + CGF = Other.CGF; + Other.CGF = nullptr; + return *this; + } ~ApplyDebugLocation(); diff --git a/clang/lib/CodeGen/EHScopeStack.h b/clang/lib/CodeGen/EHScopeStack.h --- a/clang/lib/CodeGen/EHScopeStack.h +++ b/clang/lib/CodeGen/EHScopeStack.h @@ -148,6 +148,12 @@ public: Cleanup(const Cleanup &) = default; Cleanup(Cleanup &&) {} + + // The copy and move assignment operator is defined as deleted pending + // further motivation. + Cleanup &operator=(const Cleanup &) = delete; + Cleanup &operator=(Cleanup &&) = delete; + Cleanup() = default; virtual bool isRedundantBeforeReturn() { return false; } diff --git a/clang/lib/Sema/SemaAccess.cpp b/clang/lib/Sema/SemaAccess.cpp --- a/clang/lib/Sema/SemaAccess.cpp +++ b/clang/lib/Sema/SemaAccess.cpp @@ -199,6 +199,16 @@ : Target(S.Target), Has(S.Has) { S.Target = nullptr; } + + // The move assignment operator is defined as deleted pending further + // motivation. + SavedInstanceContext &operator=(SavedInstanceContext &&) = delete; + + // The copy constrcutor and copy assignment operator is defined as deleted + // pending further motivation. + SavedInstanceContext(const SavedInstanceContext &) = delete; + SavedInstanceContext &operator=(const SavedInstanceContext &) = delete; + ~SavedInstanceContext() { if (Target) Target->HasInstanceContext = Has; diff --git a/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp b/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp --- a/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp +++ b/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp @@ -653,6 +653,14 @@ Root(O.Root) { O.Root = nullptr; } + // The move assignment operator is defined as deleted pending further + // motivation. + DiagText &operator=(DiagText &&) = delete; + + // The copy constrcutor and copy assignment operator is defined as deleted + // pending further motivation. + DiagText(const DiagText &) = delete; + DiagText &operator=(const DiagText &) = delete; ~DiagText() { for (Piece *P : AllocatedPieces)