@@ -882,7 +882,7 @@ struct declaration_node
882
882
883
883
token const * pointer_declarator = nullptr ;
884
884
885
- enum active { function, object };
885
+ enum active : std:: uint8_t { function, object };
886
886
std::variant<
887
887
std::unique_ptr<function_type_node>,
888
888
std::unique_ptr<type_id_node>
@@ -1267,7 +1267,7 @@ class parser
1267
1267
errors.emplace_back ( curr ().position (), m );
1268
1268
}
1269
1269
1270
- auto error (std::string const & msg, bool include_curr_token = true ) const -> void
1270
+ auto error (std::string const & msg, bool = true ) const -> void
1271
1271
{
1272
1272
error (msg.c_str ());
1273
1273
}
@@ -1638,7 +1638,7 @@ class parser
1638
1638
}
1639
1639
else {
1640
1640
return binary_expression<relational_expression_node> (
1641
- [](token const & t ){ return false ; },
1641
+ [](token const &){ return false ; },
1642
1642
[this ]{ return compare_expression (); }
1643
1643
);
1644
1644
}
@@ -1950,7 +1950,7 @@ class parser
1950
1950
return {};
1951
1951
}
1952
1952
assert (term.id ->identifier );
1953
- if (first_time_through_loop && term.scope_op ->type () == lexeme::Scope) {
1953
+ if (first_time_through_loop && first_uid_was_std && term.scope_op ->type () == lexeme::Scope) {
1954
1954
if (*term.id ->identifier == " move" ) {
1955
1955
error (" std::move is not needed in Cpp2 - use 'move' parameters/arguments instead" , false );
1956
1956
return {};
@@ -2839,7 +2839,7 @@ class parser
2839
2839
// G : type-id-opt = statement
2840
2840
// G : type-id
2841
2841
// G
2842
- auto unnamed_declaration (source_position pos , bool semicolon_required = true , bool captures_allowed = false ) -> std::unique_ptr<declaration_node>
2842
+ auto unnamed_declaration (source_position start , bool semicolon_required = true , bool captures_allowed = false ) -> std::unique_ptr<declaration_node>
2843
2843
{
2844
2844
auto deduced_type = false ;
2845
2845
@@ -2850,16 +2850,13 @@ class parser
2850
2850
next ();
2851
2851
2852
2852
auto n = std::make_unique<declaration_node>();
2853
- n->pos = pos ;
2853
+ n->pos = start ;
2854
2854
auto guard =
2855
2855
captures_allowed
2856
2856
? make_unique<capture_groups_stack_guard>(this , &n->captures )
2857
2857
: std::unique_ptr<capture_groups_stack_guard>()
2858
2858
;
2859
2859
2860
- // Remember current position, because we need to look ahead
2861
- auto start_pos = pos;
2862
-
2863
2860
// Next is an an optional type
2864
2861
2865
2862
// It could be a function type, declaring a function
@@ -3043,7 +3040,7 @@ class parse_tree_printer : printing_visitor
3043
3040
o << pre (indent) << n.to_string () << " \n " ;
3044
3041
}
3045
3042
3046
- auto start (expression_node const & n , int indent) -> void
3043
+ auto start (expression_node const &, int indent) -> void
3047
3044
{
3048
3045
o << pre (indent) << " expression\n " ;
3049
3046
// If we are in an expression-list
@@ -3067,7 +3064,7 @@ class parse_tree_printer : printing_visitor
3067
3064
o << pre (indent) << " expression-list\n " ;
3068
3065
}
3069
3066
3070
- auto end (expression_list_node const & n, int indent ) -> void
3067
+ auto end (expression_list_node const & n, int ) -> void
3071
3068
{
3072
3069
// If we're ending an expression list node, our pointer should be
3073
3070
// pointing to one past the end of the expressions
@@ -3081,58 +3078,58 @@ class parse_tree_printer : printing_visitor
3081
3078
current_expression_list_term.pop_back ();
3082
3079
}
3083
3080
3084
- auto start (primary_expression_node const & n , int indent) -> void
3081
+ auto start (primary_expression_node const &, int indent) -> void
3085
3082
{
3086
3083
o << pre (indent) << " primary-expression\n " ;
3087
3084
}
3088
3085
3089
- auto start (prefix_expression_node const & n , int indent) -> void
3086
+ auto start (prefix_expression_node const &, int indent) -> void
3090
3087
{
3091
3088
o << pre (indent) << " prefix-expression\n " ;
3092
3089
}
3093
3090
3094
3091
template <String Name, typename Term>
3095
- auto start (binary_expression_node<Name, Term> const & n , int indent) -> void
3092
+ auto start (binary_expression_node<Name, Term> const &, int indent) -> void
3096
3093
{
3097
3094
o << pre (indent) << Name.value << " -expression\n " ;
3098
3095
}
3099
3096
3100
- auto start (expression_statement_node const & n , int indent) -> void
3097
+ auto start (expression_statement_node const &, int indent) -> void
3101
3098
{
3102
3099
o << pre (indent) << " expression-statement\n " ;
3103
3100
}
3104
3101
3105
- auto start (postfix_expression_node const & n , int indent) -> void
3102
+ auto start (postfix_expression_node const &, int indent) -> void
3106
3103
{
3107
3104
o << pre (indent) << " postfix-expression\n " ;
3108
3105
}
3109
3106
3110
- auto start (unqualified_id_node const & n , int indent) -> void
3107
+ auto start (unqualified_id_node const &, int indent) -> void
3111
3108
{
3112
3109
o << pre (indent) << " unqualified-id\n " ;
3113
3110
}
3114
3111
3115
- auto start (qualified_id_node const & n , int indent) -> void
3112
+ auto start (qualified_id_node const &, int indent) -> void
3116
3113
{
3117
3114
o << pre (indent) << " qualified-id\n " ;
3118
3115
}
3119
3116
3120
- auto start (type_id_node const & n , int indent) -> void
3117
+ auto start (type_id_node const &, int indent) -> void
3121
3118
{
3122
3119
o << pre (indent) << " type-id\n " ;
3123
3120
}
3124
3121
3125
- auto start (id_expression_node const & n , int indent) -> void
3122
+ auto start (id_expression_node const &, int indent) -> void
3126
3123
{
3127
3124
o << pre (indent) << " id-expression\n " ;
3128
3125
}
3129
3126
3130
- auto start (statement_node const & n , int indent) -> void
3127
+ auto start (statement_node const &, int indent) -> void
3131
3128
{
3132
3129
o << pre (indent) << " statement\n " ;
3133
3130
}
3134
3131
3135
- auto start (compound_statement_node const & n , int indent) -> void
3132
+ auto start (compound_statement_node const &, int indent) -> void
3136
3133
{
3137
3134
o << pre (indent) << " compound-statement\n " ;
3138
3135
}
@@ -3143,7 +3140,7 @@ class parse_tree_printer : printing_visitor
3143
3140
o << pre (indent+1 ) << " is_constexpr: " << as<std::string>(n.is_constexpr ) << " \n " ;
3144
3141
}
3145
3142
3146
- auto start (alternative_node const & n , int indent) -> void
3143
+ auto start (alternative_node const &, int indent) -> void
3147
3144
{
3148
3145
o << pre (indent) << " alternative\n " ;
3149
3146
}
@@ -3154,7 +3151,7 @@ class parse_tree_printer : printing_visitor
3154
3151
o << pre (indent+1 ) << " is_constexpr: " << as<std::string>(n.is_constexpr ) << " \n " ;
3155
3152
}
3156
3153
3157
- auto start (return_statement_node const & n , int indent) -> void
3154
+ auto start (return_statement_node const &, int indent) -> void
3158
3155
{
3159
3156
o << pre (indent) << " return-statement\n " ;
3160
3157
}
@@ -3185,7 +3182,7 @@ class parse_tree_printer : printing_visitor
3185
3182
o << pre (indent+1 ) << " throws: " << as<std::string>(n.throws ) << " \n " ;
3186
3183
}
3187
3184
3188
- auto start (function_returns_tag const & n , int indent) -> void
3185
+ auto start (function_returns_tag const &, int indent) -> void
3189
3186
{
3190
3187
o << pre (indent) << " function returns\n " ;
3191
3188
}
@@ -3226,12 +3223,12 @@ class parse_tree_printer : printing_visitor
3226
3223
assert ( n.declaration );
3227
3224
}
3228
3225
3229
- auto start (parameter_declaration_list_node const & n , int indent) -> void
3226
+ auto start (parameter_declaration_list_node const &, int indent) -> void
3230
3227
{
3231
3228
o << pre (indent) << " parameter-declaration-list\n " ;
3232
3229
}
3233
3230
3234
- auto start (translation_unit_node const & n , int indent) -> void
3231
+ auto start (translation_unit_node const &, int indent) -> void
3235
3232
{
3236
3233
o << pre (indent) << " translation-unit\n " ;
3237
3234
}
@@ -3241,7 +3238,7 @@ class parse_tree_printer : printing_visitor
3241
3238
o << pre (indent) << " UNRECOGNIZED -- FIXME\n " ;
3242
3239
}
3243
3240
3244
- auto end (auto const &, int indent ) -> void
3241
+ auto end (auto const &, int ) -> void
3245
3242
{
3246
3243
// Ignore other node types
3247
3244
}
@@ -3272,7 +3269,7 @@ class adjust_remaining_token_columns_on_this_line_visitor
3272
3269
, col_offset{offset}
3273
3270
{ }
3274
3271
3275
- auto start (token& n, int indent ) -> void
3272
+ auto start (token& n, int ) -> void
3276
3273
{
3277
3274
if (n.position ().lineno == line_to_adjust_pos.lineno &&
3278
3275
n.position ().colno >= line_to_adjust_pos.colno
@@ -3282,12 +3279,12 @@ class adjust_remaining_token_columns_on_this_line_visitor
3282
3279
}
3283
3280
}
3284
3281
3285
- auto start (auto const &, int indent ) -> void
3282
+ auto start (auto const &, int ) -> void
3286
3283
{
3287
3284
// Ignore other node types
3288
3285
}
3289
3286
3290
- auto end (auto const &, int indent ) -> void
3287
+ auto end (auto const &, int ) -> void
3291
3288
{
3292
3289
// Ignore other node types
3293
3290
}
0 commit comments