Skip to content

Commit 3f15893

Browse files
committed
Fix: using statement in antoher namespace that pointer to type alias
1 parent f1b8d9c commit 3f15893

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

source/to_cpp1.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5685,10 +5685,11 @@ class cppfront
56855685
return;
56865686
}
56875687

5688-
// In phase 0, only need to consider namespaces and types
5688+
// In phase 0, only need to consider alias, namespaces and types
56895689

56905690
if (
56915691
printer.get_phase() == printer.phase0_type_decls
5692+
&& !n.is_alias()
56925693
&& !n.is_namespace()
56935694
&& !n.is_type()
56945695
)
@@ -5718,13 +5719,13 @@ class cppfront
57185719
auto& a = std::get<declaration_node::an_alias>(n.type);
57195720
assert(a);
57205721

5721-
// Namespace-scope aliases are emitted in phase 1,
5722+
// Namespace-scope aliases are emitted in phase 0,
57225723
// type-scope object aliases in both phases 1 and 2, and
57235724
// function-scope aliases in phase 2
57245725
if (
57255726
(
57265727
!n.parent_is_function()
5727-
&& printer.get_phase() == printer.phase1_type_defs_func_decls
5728+
&& printer.get_phase() == printer.phase0_type_decls
57285729
)
57295730
||
57305731
(

0 commit comments

Comments
 (0)