[llvm] Set ObjectFile's assignment operator to also be deleted like its copy constructor (PR #93072)

Thomas Fransham via llvm-commits llvm-commits at lists.llvm.org
Wed May 22 10:18:54 PDT 2024


https://github.com/fsfod created https://github.com/llvm/llvm-project/pull/93072

Reapply https://github.com/llvm/llvm-project/pull/92942, this time double checking it compiles. @vgvassilev, @compnerd.

>From b7f471a50b53b5fe4e87a7c3285a3534b566a02c Mon Sep 17 00:00:00 2001
From: Thomas Fransham <tfransham at gmail.com>
Date: Tue, 21 May 2024 17:29:31 +0100
Subject: [PATCH] Set ObjectFile's assignment operator to also be deleted like
 its copy ctor

This will also fix a warning when ObjectFile is dllexport'ed on Windows.
---
 llvm/include/llvm/Object/ObjectFile.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/llvm/include/llvm/Object/ObjectFile.h b/llvm/include/llvm/Object/ObjectFile.h
index 8c868c7643edc..f49763e31a9c7 100644
--- a/llvm/include/llvm/Object/ObjectFile.h
+++ b/llvm/include/llvm/Object/ObjectFile.h
@@ -302,6 +302,7 @@ class ObjectFile : public SymbolicFile {
 public:
   ObjectFile() = delete;
   ObjectFile(const ObjectFile &other) = delete;
+  ObjectFile &operator=(const ObjectFile &other) = delete;
 
   uint64_t getCommonSymbolSize(DataRefImpl Symb) const {
     Expected<uint32_t> SymbolFlagsOrErr = getSymbolFlags(Symb);



More information about the llvm-commits mailing list