Author: Shafik Yaghmour
Date: 2025-12-18T12:31:01-08:00
New Revision: cf5aeed7bafcabed1856284bcc4f27fcc9b54aba

URL: 
https://github.com/llvm/llvm-project/commit/cf5aeed7bafcabed1856284bcc4f27fcc9b54aba
DIFF: 
https://github.com/llvm/llvm-project/commit/cf5aeed7bafcabed1856284bcc4f27fcc9b54aba.diff

LOG: [NFC][Sema][Clang] Apply Rule of Three ForgetPartiallySubstitutedPackRAII 
and TemporaryBase (#172775)

Static analysis flagged both classes as having a user defined destructor
but not also defining copy ctor and copy assignment. They are not needed
to defining them as deleted.

Added: 
    

Modified: 
    clang/lib/Sema/TreeTransform.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index f4d64097ea4c4..bc923c80b7132 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -139,6 +139,10 @@ class TreeTransform {
     ~ForgetPartiallySubstitutedPackRAII() {
       Self.RememberPartiallySubstitutedPack(Old);
     }
+    ForgetPartiallySubstitutedPackRAII(
+        const ForgetPartiallySubstitutedPackRAII &) = delete;
+    ForgetPartiallySubstitutedPackRAII &
+    operator=(const ForgetPartiallySubstitutedPackRAII &) = delete;
   };
 
 protected:
@@ -233,6 +237,8 @@ class TreeTransform {
     ~TemporaryBase() {
       Self.getDerived().setBase(OldLocation, OldEntity);
     }
+    TemporaryBase(const TemporaryBase &) = delete;
+    TemporaryBase &operator=(const TemporaryBase &) = delete;
   };
 
   /// Determine whether the given type \p T has already been


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to