https://github.com/shafik created 
https://github.com/llvm/llvm-project/pull/154671

Static analysis flagged these classes as having implemented the destructor but 
not applying rule of three. This could lead to accidental misuse and so it 
makes sense to apply it.

>From 41d7218a6586834bbbb482ea6c8e60546af95c0a Mon Sep 17 00:00:00 2001
From: Shafik Yaghmour <shafik.yaghm...@intel.com>
Date: Wed, 20 Aug 2025 22:28:33 -0700
Subject: [PATCH] [Clang][Codegen][NFC] Apply rule of three to some classes

Static analysis flagged these classes as having implemented the destructor but
not applying rule of three. This could lead to accidental misuse and so it makes
sense to apply it.
---
 clang/lib/CodeGen/CGDebugInfo.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/clang/lib/CodeGen/CGDebugInfo.h b/clang/lib/CodeGen/CGDebugInfo.h
index 497d3a6ab17b1..ff9c3cd2d1136 100644
--- a/clang/lib/CodeGen/CGDebugInfo.h
+++ b/clang/lib/CodeGen/CGDebugInfo.h
@@ -977,6 +977,8 @@ class ApplyInlineDebugLocation {
   ApplyInlineDebugLocation(CodeGenFunction &CGF, GlobalDecl InlinedFn);
   /// Restore everything back to the original state.
   ~ApplyInlineDebugLocation();
+  ApplyInlineDebugLocation(const ApplyInlineDebugLocation &) = delete;
+  ApplyInlineDebugLocation &operator=(ApplyInlineDebugLocation &) = delete;
 };
 
 class SanitizerDebugLocation {
@@ -988,6 +990,8 @@ class SanitizerDebugLocation {
                          ArrayRef<SanitizerKind::SanitizerOrdinal> Ordinals,
                          SanitizerHandler Handler);
   ~SanitizerDebugLocation();
+  SanitizerDebugLocation(const SanitizerDebugLocation &) = delete;
+  SanitizerDebugLocation &operator=(SanitizerDebugLocation &) = delete;
 };
 
 } // namespace CodeGen

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to