Skip to content

Commit

Permalink
[lldb] Move definition of SBSaveCoreOptions dtor out of header (llvm#…
Browse files Browse the repository at this point in the history
…102539)

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 101cf54)
  • Loading branch information
bulbazord authored and llvmbot committed Aug 9, 2024
1 parent d033ae1 commit deb61f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lldb/include/lldb/API/SBSaveCoreOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions lldb/source/API/SBSaveCoreOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit deb61f3

Please sign in to comment.