[lldb] Move definition of SBSaveCoreOptions dtor out of header (#102539)
authorAlex Langford <alangford@apple.com>
Fri, 9 Aug 2024 19:50:42 +0000 (12:50 -0700)
committerTobias Hieta <tobias@hieta.se>
Sat, 10 Aug 2024 10:18:52 +0000 (12:18 +0200)
This class is technically not usable in its current state. When you use
it in a simple C++ project, your compiler will complain about an
incomplete definition of SaveCoreOptions. Normally this isn't a problem,
other classes in the SBAPI do this. The difference is that
SBSaveCoreOptions has a default destructor in the header, so the
compiler will attempt to generate the code for the destructor with an
incomplete definition of the impl type.

All methods for every class, including constructors and destructors,
must have a separate implementation not in a header.

(cherry picked from commit 101cf540e698529d3dd899d00111bcb654a3c12b)

lldb/include/lldb/API/SBSaveCoreOptions.h
lldb/source/API/SBSaveCoreOptions.cpp

index e77496bd3a4a0dc80f85eaa9fb2e5cf1f8cb5e18..75506fd752e762131b191056413df541dad7c79c 100644 (file)
@@ -17,7 +17,7 @@ class LLDB_API SBSaveCoreOptions {
 public:
   SBSaveCoreOptions();
   SBSaveCoreOptions(const lldb::SBSaveCoreOptions &rhs);
-  ~SBSaveCoreOptions() = default;
+  ~SBSaveCoreOptions();
 
   const SBSaveCoreOptions &operator=(const lldb::SBSaveCoreOptions &rhs);
 
index 6c3f74596203d69b7bcb5926cb34671eaaf8cad0..19ca83f932bcf14c429c1415bed6d8bcc9cf2c64 100644 (file)
@@ -29,6 +29,8 @@ SBSaveCoreOptions::SBSaveCoreOptions(const SBSaveCoreOptions &rhs) {
   m_opaque_up = clone(rhs.m_opaque_up);
 }
 
+SBSaveCoreOptions::~SBSaveCoreOptions() = default;
+
 const SBSaveCoreOptions &
 SBSaveCoreOptions::operator=(const SBSaveCoreOptions &rhs) {
   LLDB_INSTRUMENT_VA(this, rhs);