@@ -145,6 +145,9 @@ struct primary_expression_node
145
145
// Cache to work around <https://github.com/llvm/llvm-project/issues/73336>.
146
146
bool expression_list_is_fold_expression = false ;
147
147
148
+ // Out-of-line definition of the dtor is necessary due to the forward-declared
149
+ // type(s) used in a std::unique_ptr as a member
150
+ ~primary_expression_node ();
148
151
149
152
// API
150
153
//
@@ -238,6 +241,10 @@ struct prefix_expression_node
238
241
std::vector<token const *> ops;
239
242
std::unique_ptr<postfix_expression_node> expr;
240
243
244
+ // Out-of-line definition of the dtor is necessary due to the forward-declared
245
+ // type(s) used in a std::unique_ptr as a member
246
+ ~prefix_expression_node ();
247
+
241
248
// API
242
249
//
243
250
auto is_fold_expression () const
@@ -297,6 +304,10 @@ struct binary_expression_node
297
304
298
305
binary_expression_node ();
299
306
307
+ // Out-of-line definition of the dtor is necessary due to the forward-declared
308
+ // type(s) used as Term in a std::unique_ptr as a member
309
+ ~binary_expression_node ();
310
+
300
311
struct term
301
312
{
302
313
token const * op;
@@ -1090,6 +1101,18 @@ struct template_argument
1090
1101
std::unique_ptr<type_id_node>
1091
1102
> arg;
1092
1103
1104
+ // The type needs to be movable
1105
+ // The copy ctor+operator are implicitly deleted due to the std::unique_ptr member
1106
+ // Because a forward-declared type is used in a std::unique_ptr as a member an out-of-line dtor is necessary
1107
+ // Because of the OOL dtor together with the fact that the copy ctor+operator are deleted
1108
+ // the move ctor+operator need to be explicitly defaulted
1109
+ // As a result the default constructor also needs to be explicitly defaulted
1110
+ template_argument () = default ;
1111
+ template_argument (template_argument&&) = default ;
1112
+ template_argument& operator =(template_argument&&) = default ;
1113
+
1114
+ ~template_argument ();
1115
+
1093
1116
auto to_string () const
1094
1117
-> std::string;
1095
1118
};
@@ -1803,6 +1826,10 @@ struct iteration_statement_node
1803
1826
std::unique_ptr<statement_node> body; // used for "for", else null
1804
1827
bool for_with_in = false ;// used for "for," says whether loop variable is 'in'
1805
1828
1829
+ // Out-of-line definition of the dtor is necessary due to the forward-declared
1830
+ // type(s) used in a std::unique_ptr as a member
1831
+ ~iteration_statement_node ();
1832
+
1806
1833
auto position () const
1807
1834
-> source_position
1808
1835
{
@@ -1854,6 +1881,10 @@ struct alternative_node
1854
1881
source_position equal_sign;
1855
1882
std::unique_ptr<statement_node> statement;
1856
1883
1884
+ // Out-of-line definition of the dtor is necessary due to the forward-declared
1885
+ // type(s) used in a std::unique_ptr as a member
1886
+ ~alternative_node ();
1887
+
1857
1888
auto position () const
1858
1889
-> source_position
1859
1890
{
@@ -1877,6 +1908,10 @@ struct inspect_expression_node
1877
1908
1878
1909
std::vector<std::unique_ptr<alternative_node>> alternatives;
1879
1910
1911
+ // Out-of-line definition of the dtor is necessary due to the forward-declared
1912
+ // type(s) used in a std::unique_ptr as a member
1913
+ ~inspect_expression_node ();
1914
+
1880
1915
auto position () const
1881
1916
-> source_position
1882
1917
{
@@ -2014,6 +2049,10 @@ struct statement_node
2014
2049
2015
2050
statement_node (compound_statement_node* compound_parent_ = nullptr );
2016
2051
2052
+ // Out-of-line definition of the dtor is necessary due to the forward-declared
2053
+ // type(s) used in a std::unique_ptr as a member
2054
+ ~statement_node ();
2055
+
2017
2056
enum active { expression=0 , compound, selection, declaration, return_, iteration, using_, contract, inspect, jump };
2018
2057
std::variant<
2019
2058
std::unique_ptr<expression_statement_node>,
@@ -4389,6 +4428,26 @@ struct translation_unit_node
4389
4428
}
4390
4429
};
4391
4430
4431
+ // Definitions of out-of-line dtors for nodes with unique_ptr members of forward-declared types
4432
+ primary_expression_node::~primary_expression_node () = default ;
4433
+
4434
+ prefix_expression_node::~prefix_expression_node () = default ;
4435
+
4436
+ template <
4437
+ String Name,
4438
+ typename Term
4439
+ >
4440
+ binary_expression_node<Name, Term>::~binary_expression_node () = default ;
4441
+
4442
+ alternative_node::~alternative_node () = default ;
4443
+
4444
+ iteration_statement_node::~iteration_statement_node () = default ;
4445
+
4446
+ template_argument::~template_argument () = default ;
4447
+
4448
+ inspect_expression_node::~inspect_expression_node () = default ;
4449
+
4450
+ statement_node::~statement_node () = default ;
4392
4451
4393
4452
// -----------------------------------------------------------------------
4394
4453
//
0 commit comments