Skip to content

Commit 263e699

Browse files
committed
Fix: using statement in antoher namespace that pointer to type alias
1 parent ddde3d8 commit 263e699

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

source/to_cpp1.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5762,10 +5762,11 @@ class cppfront
57625762
return;
57635763
}
57645764

5765-
// In phase 0, only need to consider namespaces and types
5765+
// In phase 0, only need to consider alias, namespaces and types
57665766

57675767
if (
57685768
printer.get_phase() == printer.phase0_type_decls
5769+
&& !n.is_alias()
57695770
&& !n.is_namespace()
57705771
&& !n.is_type()
57715772
)
@@ -5795,13 +5796,13 @@ class cppfront
57955796
auto& a = std::get<declaration_node::an_alias>(n.type);
57965797
assert(a);
57975798

5798-
// Namespace-scope aliases are emitted in phase 1,
5799+
// Namespace-scope aliases are emitted in phase 0,
57995800
// type-scope object aliases in both phases 1 and 2, and
58005801
// function-scope aliases in phase 2
58015802
if (
58025803
(
58035804
!n.parent_is_function()
5804-
&& printer.get_phase() == printer.phase1_type_defs_func_decls
5805+
&& printer.get_phase() == printer.phase0_type_decls
58055806
)
58065807
||
58075808
(
@@ -6133,7 +6134,7 @@ class cppfront
61336134

61346135
// Now, emit our own template parameters
61356136
if (
6136-
n.template_parameters
6137+
(n.template_parameters && !n.is_alias())
61376138
&& (
61386139
printer.get_phase() < printer.phase2_func_defs
61396140
|| n.is_object()

0 commit comments

Comments
 (0)