File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -1470,7 +1470,7 @@ class cppfront
1470
1470
|| n == " xor_eq"
1471
1471
)
1472
1472
{
1473
- printer.print_cpp2 (n.to_string (true ) + " _ " , pos);
1473
+ printer.print_cpp2 (" cpp2_ " + n.to_string (true ), pos);
1474
1474
}
1475
1475
else if (
1476
1476
current_declarations.back ()
Original file line number Diff line number Diff line change @@ -5205,21 +5205,25 @@ class parser
5205
5205
5206
5206
// deduced_type == true means that the type will be deduced,
5207
5207
// represented using an empty type-id
5208
- if (deduced_type) {
5208
+ if (
5209
+ deduced_type
5210
+ && peek (1 )
5211
+ )
5212
+ {
5209
5213
auto & type = std::get<declaration_node::an_object>(n->type );
5210
5214
// object initialized by the address of the curr() object
5211
- if (peek (1 ) && peek ( 1 ) ->type () == lexeme::Ampersand) {
5215
+ if (peek (1 )->type () == lexeme::Ampersand) {
5212
5216
type->address_of = &curr ();
5213
5217
}
5214
5218
// object initialized by (potentially multiple) dereference of the curr() object
5215
- else if (peek (1 ) && peek ( 1 ) ->type () == lexeme::Multiply) {
5219
+ else if (peek (1 )->type () == lexeme::Multiply) {
5216
5220
type->dereference_of = &curr ();
5217
5221
for (int i = 1 ; peek (i)->type () == lexeme::Multiply; ++i)
5218
5222
type->dereference_cnt += 1 ;
5219
5223
}
5220
5224
else if (
5221
5225
// object initialized by the result of the function call (and it is not unnamed function)
5222
- (peek (1 ) && peek ( 1 ) ->type () == lexeme::LeftParen && curr ().type () != lexeme::Colon)
5226
+ (peek (1 )->type () == lexeme::LeftParen && curr ().type () != lexeme::Colon)
5223
5227
|| curr ().type () == lexeme::Identifier // or by the object (variable that the type need to be checked)
5224
5228
) {
5225
5229
type->suspicious_initialization = &curr ();
You can’t perform that action at this time.
0 commit comments