@@ -1572,9 +1572,9 @@ class cppfront
1572
1572
auto & unqual = std::get<id_expression_node::unqualified>(id->id );
1573
1573
assert (unqual);
1574
1574
auto decl = sema.get_declaration_of (*unqual->identifier );
1575
- // TODO: Generalize this -- for now we detect only cases of the form "p: *int = ...;"
1576
- // We don't recognize pointer types that are deduced, multi-level, or from Cpp1
1577
- if (decl && decl->declaration && decl->declaration ->pointer_declarator ) {
1575
+ // TODO: Generalize this -- for now we detect only multi-level cases of the form "p: ** *int = ...;"
1576
+ // We don't recognize pointer types that are deduced or from Cpp1
1577
+ if (decl && decl->declaration && ! decl->declaration ->pointer_declarators . empty () ) {
1578
1578
if (n.ops .empty ()) {
1579
1579
last_postfix_expr_was_pointer = true ;
1580
1580
}
@@ -2155,9 +2155,9 @@ class cppfront
2155
2155
}
2156
2156
else {
2157
2157
emit ( id_expr );
2158
- if ( n.declaration ->pointer_declarator ) {
2159
- printer.print_cpp2 (" " , n. declaration -> pointer_declarator ->position ());
2160
- emit (*n. declaration -> pointer_declarator );
2158
+ for ( const auto pointer_declarator : n.declaration ->pointer_declarators ) {
2159
+ printer.print_cpp2 (" " , pointer_declarator->position ());
2160
+ emit (*pointer_declarator);
2161
2161
}
2162
2162
}
2163
2163
@@ -2538,7 +2538,7 @@ class cppfront
2538
2538
}
2539
2539
printer.preempt_position (n.position ());
2540
2540
emit ( *type );
2541
- if (n. pointer_declarator ) {
2541
+ for ( auto _ : n. pointer_declarators ) {
2542
2542
printer.print_cpp2 (" *" , n.position ());
2543
2543
}
2544
2544
// one pointer is enough for now, pointer-to-function fun can be later
0 commit comments