]> granicus.if.org Git - clang/commitdiff
Mark unimplemented copy constructors and copy assignment operators with LLVM_DELETED_...
authorCraig Topper <craig.topper@gmail.com>
Tue, 18 Sep 2012 04:52:05 +0000 (04:52 +0000)
committerCraig Topper <craig.topper@gmail.com>
Tue, 18 Sep 2012 04:52:05 +0000 (04:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164102 91177308-0d34-0410-b5e6-96231b3b80d8

14 files changed:
include/clang/AST/Decl.h
include/clang/AST/DeclTemplate.h
include/clang/AST/DeclarationName.h
include/clang/AST/NestedNameSpecifier.h
include/clang/AST/UnresolvedSet.h
include/clang/Basic/IdentifierTable.h
include/clang/Basic/SourceManager.h
include/clang/Lex/HeaderSearch.h
include/clang/Sema/AttributeList.h
include/clang/Sema/Overload.h
include/clang/Sema/Sema.h
include/clang/Sema/Template.h
include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h
include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h

index 4d0cde8a432e7b97c986aed03f954cb299821b71..48a081659382e4c68108caa81024e56f46c40c59 100644 (file)
@@ -578,8 +578,8 @@ struct QualifierInfo {
 
 private:
   // Copy constructor and copy assignment are disabled.
-  QualifierInfo(const QualifierInfo&);
-  QualifierInfo& operator=(const QualifierInfo&);
+  QualifierInfo(const QualifierInfo&) LLVM_DELETED_FUNCTION;
+  QualifierInfo& operator=(const QualifierInfo&) LLVM_DELETED_FUNCTION;
 };
 
 /// \brief Represents a ValueDecl that came out of a declarator.
index 3cff5b07c4a87e0217f5a90bc64c0fa38d74fd1e..0daa60b22013a8a316472e490117171a18d0141e 100644 (file)
@@ -149,8 +149,8 @@ class TemplateArgumentList {
   /// argument list.
   unsigned NumArguments;
 
-  TemplateArgumentList(const TemplateArgumentList &Other); // DO NOT IMPL
-  void operator=(const TemplateArgumentList &Other); // DO NOT IMPL
+  TemplateArgumentList(const TemplateArgumentList &Other) LLVM_DELETED_FUNCTION;
+  void operator=(const TemplateArgumentList &Other) LLVM_DELETED_FUNCTION;
 
   TemplateArgumentList(const TemplateArgument *Args, unsigned NumArgs,
                        bool Owned)
index 61465254067950f5d1e4a4bc4b66446efd6b12d9..d991c73612c2e1f520b20481a80151d37bbd1254 100644 (file)
@@ -334,8 +334,8 @@ class DeclarationNameTable {
   CXXOperatorIdName *CXXOperatorNames; // Operator names
   void *CXXLiteralOperatorNames; // Actually a CXXOperatorIdName*
 
-  DeclarationNameTable(const DeclarationNameTable&);            // NONCOPYABLE
-  DeclarationNameTable& operator=(const DeclarationNameTable&); // NONCOPYABLE
+  DeclarationNameTable(const DeclarationNameTable&) LLVM_DELETED_FUNCTION;
+  void operator=(const DeclarationNameTable&) LLVM_DELETED_FUNCTION;
 
 public:
   DeclarationNameTable(const ASTContext &C);
index a5aec1fdda6b9079192d0b4c0e6431bcb91bcb75..bf9e1cbc764b9950072dcf8bca5fee4b2ede2059 100644 (file)
@@ -97,8 +97,7 @@ private:
       Specifier(Other.Specifier) {
   }
 
-  NestedNameSpecifier &operator=(const NestedNameSpecifier &); // do not
-                                                               // implement
+  void operator=(const NestedNameSpecifier &) LLVM_DELETED_FUNCTION;
 
   /// \brief Either find or insert the given nested name specifier
   /// mockup in the given context.
index 0918dc44aa7377d2c6a567f00982a68a2799b0eb..9f11ee5fe3e20246a1a16f773199730ae8c3d100 100644 (file)
@@ -94,7 +94,7 @@ class UnresolvedSetImpl {
 private:
   template <unsigned N> friend class UnresolvedSet;
   UnresolvedSetImpl() {}
-  UnresolvedSetImpl(const UnresolvedSetImpl &) {}
+  UnresolvedSetImpl(const UnresolvedSetImpl &) LLVM_DELETED_FUNCTION;
 
 public:
   // We don't currently support assignment through this iterator, so we might
index d77c870ec559bf3d52ca7ff878747f244af92a2c..e0f4510f262db2c33b5c4db47a19c7576dcb785d 100644 (file)
@@ -75,8 +75,8 @@ class IdentifierInfo {
   void *FETokenInfo;               // Managed by the language front-end.
   llvm::StringMapEntry<IdentifierInfo*> *Entry;
 
-  IdentifierInfo(const IdentifierInfo&);  // NONCOPYABLE.
-  void operator=(const IdentifierInfo&);  // NONASSIGNABLE.
+  IdentifierInfo(const IdentifierInfo&) LLVM_DELETED_FUNCTION;
+  void operator=(const IdentifierInfo&) LLVM_DELETED_FUNCTION;
 
   friend class IdentifierTable;
   
index 32268d789d14fb9db5f297c367e2ee7310d14c6e..ed19535a6259db2c49046535f9a3f41c2a1c9a90 100644 (file)
@@ -221,7 +221,7 @@ namespace SrcMgr {
 
   private:
     // Disable assignments.
-    ContentCache &operator=(const ContentCache& RHS);
+    ContentCache &operator=(const ContentCache& RHS) LLVM_DELETED_FUNCTION;
   };
 
   /// \brief Information about a FileID, basically just the logical file
@@ -647,8 +647,8 @@ class SourceManager : public RefCountedBase<SourceManager> {
   mutable llvm::DenseMap<FileID, MacroArgsMap *> MacroArgsCacheMap;
 
   // SourceManager doesn't support copy construction.
-  explicit SourceManager(const SourceManager&);
-  void operator=(const SourceManager&);
+  explicit SourceManager(const SourceManager&) LLVM_DELETED_FUNCTION;
+  void operator=(const SourceManager&) LLVM_DELETED_FUNCTION;
 public:
   SourceManager(DiagnosticsEngine &Diag, FileManager &FileMgr,
                 bool UserFilesAreVolatile = false);
index 8e9491fdc33919ec758f689c15eafb86a98dd6f6..2b5ebc263639d4b25f06a20194da2d94012753b6 100644 (file)
@@ -207,10 +207,9 @@ class HeaderSearch {
   unsigned NumFrameworkLookups, NumSubFrameworkLookups;
 
   // HeaderSearch doesn't support default or copy construction.
-  explicit HeaderSearch();
-  explicit HeaderSearch(const HeaderSearch&);
-  void operator=(const HeaderSearch&);
-  
+  HeaderSearch(const HeaderSearch&) LLVM_DELETED_FUNCTION;
+  void operator=(const HeaderSearch&) LLVM_DELETED_FUNCTION;
+
   friend class DirectoryLookup;
   
 public:
index bf358862b09eb61551874e004593a77a06fc361c..2e8b0c03f7703b9490be72dd17d32bf9f07c9977 100644 (file)
@@ -140,10 +140,10 @@ private:
     return *reinterpret_cast<const TypeTagForDatatypeData *>(this + 1);
   }
 
-  AttributeList(const AttributeList &); // DO NOT IMPLEMENT
-  void operator=(const AttributeList &); // DO NOT IMPLEMENT
-  void operator delete(void *); // DO NOT IMPLEMENT
-  ~AttributeList(); // DO NOT IMPLEMENT
+  AttributeList(const AttributeList &) LLVM_DELETED_FUNCTION;
+  void operator=(const AttributeList &) LLVM_DELETED_FUNCTION;
+  void operator delete(void *) LLVM_DELETED_FUNCTION;
+  ~AttributeList() LLVM_DELETED_FUNCTION;
 
   size_t allocated_size() const;
 
index d2fc285c9e29ae9cad73ba664bf4a37ba5786a69..85ef77af93346593ef931ed9b17e3dc67264e59f 100644 (file)
@@ -748,9 +748,9 @@ namespace clang {
     unsigned NumInlineSequences;
     char InlineSpace[16 * sizeof(ImplicitConversionSequence)];
 
-    OverloadCandidateSet(const OverloadCandidateSet &);
-    OverloadCandidateSet &operator=(const OverloadCandidateSet &);
-    
+    OverloadCandidateSet(const OverloadCandidateSet &) LLVM_DELETED_FUNCTION;
+    void operator=(const OverloadCandidateSet &) LLVM_DELETED_FUNCTION;
+
   public:
     OverloadCandidateSet(SourceLocation Loc) : Loc(Loc), NumInlineSequences(0){}
     ~OverloadCandidateSet() { clear(); }
index 2cd4688ce587591d22bbb0cbfc1f11074d319e26..9a8eb310af27efb0a4df4f6e38d47490bdf5c786 100644 (file)
@@ -5717,10 +5717,10 @@ public:
     bool CheckInstantiationDepth(SourceLocation PointOfInstantiation,
                                  SourceRange InstantiationRange);
 
-    InstantiatingTemplate(const InstantiatingTemplate&); // not implemented
+    InstantiatingTemplate(const InstantiatingTemplate&) LLVM_DELETED_FUNCTION;
 
     InstantiatingTemplate&
-    operator=(const InstantiatingTemplate&); // not implemented
+    operator=(const InstantiatingTemplate&) LLVM_DELETED_FUNCTION;
   };
 
   void PrintInstantiationStack();
index 273374dfd8b04b9c4433ed27ddd99362eb0e9f84..bbccd259678a5ac660b3d58263e28f0509887c37 100644 (file)
@@ -239,8 +239,9 @@ namespace clang {
     unsigned NumArgsInPartiallySubstitutedPack;
 
     // This class is non-copyable
-    LocalInstantiationScope(const LocalInstantiationScope &);
-    LocalInstantiationScope &operator=(const LocalInstantiationScope &);
+    LocalInstantiationScope(
+      const LocalInstantiationScope &) LLVM_DELETED_FUNCTION;
+    void operator=(const LocalInstantiationScope &) LLVM_DELETED_FUNCTION;
 
   public:
     LocalInstantiationScope(Sema &SemaRef, bool CombineWithOuterScope = false)
index 9d3b85e10d00044443ceea2e7d8921d10a1c7054..43b39bf8f94ae904effc9a6d774076a35e7f5530 100644 (file)
@@ -322,10 +322,9 @@ private:
   const DisplayHint Hint;
   std::vector<SourceRange> ranges;
 
-  // Do not implement:
-  PathDiagnosticPiece();
-  PathDiagnosticPiece(const PathDiagnosticPiece &P);
-  PathDiagnosticPiece& operator=(const PathDiagnosticPiece &P);
+  PathDiagnosticPiece() LLVM_DELETED_FUNCTION;
+  PathDiagnosticPiece(const PathDiagnosticPiece &P) LLVM_DELETED_FUNCTION;
+  void operator=(const PathDiagnosticPiece &P) LLVM_DELETED_FUNCTION;
 
 protected:
   PathDiagnosticPiece(StringRef s, Kind k, DisplayHint hint = Below);
index f23f4046a70d0d12f6e7d10f72d41e1b1e954e7d..acb88a62f2c4f78e2eab42f165b4b5a02fd3ab0e 100644 (file)
@@ -75,7 +75,7 @@ public:
   typedef llvm::ImmutableMap<void*, void*>                 GenericDataMap;
 
 private:
-  void operator=(const ProgramState& R) const; // Do not implement.
+  void operator=(const ProgramState& R) LLVM_DELETED_FUNCTION;
 
   friend class ProgramStateManager;
   friend class ExplodedGraph;