Skip to content

Commit

Permalink
Merge pull request #248 from chaoticgd/rule_of_five
Browse files Browse the repository at this point in the history
Make it possible to use the Symbol class without including ast.h
  • Loading branch information
chaoticgd authored Oct 21, 2024
2 parents 7aa679d + b4be0af commit 8aaba77
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ccc/symbol_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,11 @@ CCC_FOR_EACH_SYMBOL_TYPE_DO_X

// *****************************************************************************

Symbol::Symbol() = default;
Symbol::Symbol(Symbol&& rhs) = default;
Symbol::~Symbol() = default;
Symbol& Symbol::operator=(Symbol&& rhs) = default;

void Symbol::set_type(std::unique_ptr<ast::Node> type)
{
m_type = std::move(type);
Expand Down
7 changes: 7 additions & 0 deletions src/ccc/symbol_database.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ class Symbol {
template <typename SymbolType>
friend class SymbolList;
public:
Symbol();
Symbol(const Symbol& rhs) = delete;
Symbol(Symbol&& rhs);
~Symbol();
Symbol& operator=(const Symbol& rhs) = delete;
Symbol& operator=(Symbol&& rhs);

const std::string& name() const { return m_name; }
RawSymbolHandle raw_handle() const { return m_handle; }
SymbolSourceHandle source() const { return m_source; }
Expand Down

0 comments on commit 8aaba77

Please sign in to comment.