Skip to content

Commit a8d70c1

Browse files
bluetarpmediaNeil Henderson
and
Neil Henderson
authored
[CI] Fix clang-18 C++23 build of cppfront (#1187)
* Move the ctor to out-of-line for `parameter_declaration_node` The `declaration_node` definition for the `unique_ptr` member is not yet visible if the ctor is written inline. * Add out-of-line dtor for `declaration_node` * Add out-of-line dtor for `parameter_declaration_node` --------- Co-authored-by: Neil Henderson <[email protected]>
1 parent c1925d7 commit a8d70c1

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

source/parse.h

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,7 +2274,13 @@ struct parameter_declaration_node
22742274

22752275
std::unique_ptr<declaration_node> declaration;
22762276

2277-
parameter_declaration_node(parameter_declaration_list_node const* my) : my_list{my} { }
2277+
// Out-of-line definition of the ctor is necessary due to the forward-declared
2278+
// type(s) used in a std::unique_ptr as a member
2279+
parameter_declaration_node(parameter_declaration_list_node const* my);
2280+
2281+
// Out-of-line definition of the dtor is necessary due to the forward-declared
2282+
// type(s) used in a std::unique_ptr as a member
2283+
~parameter_declaration_node();
22782284

22792285
// API
22802286
//
@@ -2860,6 +2866,10 @@ struct declaration_node
28602866
: parent_declaration{parent}
28612867
{ }
28622868

2869+
// Out-of-line definition of the dtor is necessary due to the forward-declared
2870+
// type(s) used in a std::unique_ptr as a member
2871+
~declaration_node();
2872+
28632873
// API
28642874
//
28652875

@@ -4513,7 +4523,13 @@ struct translation_unit_node
45134523
}
45144524
};
45154525

4516-
// Definitions of out-of-line dtors for nodes with unique_ptr members of forward-declared types
4526+
// Definitions of out-of-line ctors & dtors for nodes with unique_ptr members of forward-declared types
4527+
4528+
parameter_declaration_node::parameter_declaration_node(parameter_declaration_list_node const* my)
4529+
: my_list{my}
4530+
{ }
4531+
4532+
parameter_declaration_node::~parameter_declaration_node() = default;
45174533

45184534
type_id_node::~type_id_node() = default;
45194535

@@ -4537,6 +4553,8 @@ inspect_expression_node::~inspect_expression_node() = default;
45374553

45384554
statement_node::~statement_node() = default;
45394555

4556+
declaration_node::~declaration_node() = default;
4557+
45404558

45414559
//-----------------------------------------------------------------------
45424560
//

0 commit comments

Comments
 (0)