This revision was automatically updated to reflect the committed changes.
Closed by commit rGb4fbc4bdbf58: [NFC][Clang][Coverity] Fix Static Code
Analysis Concerns with copy without… (authored by Manna).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150411/new/
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/ParsedAttr.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
@@ -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)
Index: clang/lib/Sema/SemaAccess.cpp
===================================================================
--- clang/lib/Sema/SemaAccess.cpp
+++ 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;
Index: clang/lib/CodeGen/EHScopeStack.h
===================================================================
--- clang/lib/CodeGen/EHScopeStack.h
+++ 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; }
Index: clang/lib/CodeGen/CGDebugInfo.h
===================================================================
--- clang/lib/CodeGen/CGDebugInfo.h
+++ 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();
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
@@ -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
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
@@ -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
Index: clang/include/clang/Sema/Sema.h
===================================================================
--- clang/include/clang/Sema/Sema.h
+++ 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(); }
Index: clang/include/clang/Sema/ParsedAttr.h
===================================================================
--- clang/include/clang/Sema/ParsedAttr.h
+++ 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() {
Index: clang/include/clang/Sema/Lookup.h
===================================================================
--- clang/include/clang/Sema/Lookup.h
+++ 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");
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,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;
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,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.
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) {}
+
+ // The copy assignment operator is defined as deleted pending further
+ // motivation.
+ VectorData &operator=(const VectorData &) = delete;
};
public:
Index: clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h
===================================================================
--- clang/include/clang/Analysis/Analyses/ThreadSafetyTIL.h
+++ 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 <class V>
@@ -566,6 +570,10 @@
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; }
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,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,
Index: clang/include/clang/AST/ASTContext.h
===================================================================
--- clang/include/clang/AST/ASTContext.h
+++ 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) \
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits