[clang] [Clang] Prevent Copying of LateParsedClass Instances (PR #109428)

via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 20 07:19:12 PDT 2024


https://github.com/smanna12 updated https://github.com/llvm/llvm-project/pull/109428

>From d792de91f9a01b927a274c83f0d2553ac06aa3cb Mon Sep 17 00:00:00 2001
From: "Manna, Soumi" <soumi.manna at intel.com>
Date: Fri, 20 Sep 2024 07:07:46 -0700
Subject: [PATCH 1/2] [Clang] Prevent Copying of LateParsedClass Instances

---
 clang/include/clang/Parse/Parser.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/clang/include/clang/Parse/Parser.h b/clang/include/clang/Parse/Parser.h
index 47f72135c97cff..79b08032bd1621 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -1355,6 +1355,10 @@ class Parser : public CodeCompletionHandler {
     void ParseLexedAttributes() override;
     void ParseLexedPragmas() override;
 
+    // Delete copy constructor and copy assignment operator.
+    LateParsedClass(const LateParsedClass&) = delete;
+    LateParsedClass& operator=(const LateParsedClass&) = delete;
+
   private:
     Parser *Self;
     ParsingClass *Class;

>From f939bcfb28aa051482581e26703501430b84fdf7 Mon Sep 17 00:00:00 2001
From: "Manna, Soumi" <soumi.manna at intel.com>
Date: Fri, 20 Sep 2024 07:18:28 -0700
Subject: [PATCH 2/2] Fix formats

---
 clang/include/clang/Parse/Parser.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/include/clang/Parse/Parser.h b/clang/include/clang/Parse/Parser.h
index 79b08032bd1621..eb8a851da7e04e 100644
--- a/clang/include/clang/Parse/Parser.h
+++ b/clang/include/clang/Parse/Parser.h
@@ -1356,8 +1356,8 @@ class Parser : public CodeCompletionHandler {
     void ParseLexedPragmas() override;
 
     // Delete copy constructor and copy assignment operator.
-    LateParsedClass(const LateParsedClass&) = delete;
-    LateParsedClass& operator=(const LateParsedClass&) = delete;
+    LateParsedClass(const LateParsedClass &) = delete;
+    LateParsedClass &operator=(const LateParsedClass &) = delete;
 
   private:
     Parser *Self;



More information about the cfe-commits mailing list