Skip to content

Fix: using statement in another namespace that pointer to type alias #1286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions source/to_cpp1.h
Original file line number Diff line number Diff line change
Expand Up @@ -5685,10 +5685,11 @@ class cppfront
return;
}

// In phase 0, only need to consider namespaces and types
// In phase 0, only need to consider alias, namespaces and types

if (
printer.get_phase() == printer.phase0_type_decls
&& !n.is_alias()
&& !n.is_namespace()
&& !n.is_type()
)
Expand Down Expand Up @@ -5718,13 +5719,13 @@ class cppfront
auto& a = std::get<declaration_node::an_alias>(n.type);
assert(a);

// Namespace-scope aliases are emitted in phase 1,
// Namespace-scope aliases are emitted in phase 0,
// type-scope object aliases in both phases 1 and 2, and
// function-scope aliases in phase 2
if (
(
!n.parent_is_function()
&& printer.get_phase() == printer.phase1_type_defs_func_decls
&& printer.get_phase() == printer.phase0_type_decls
)
||
(
Expand Down Expand Up @@ -6056,7 +6057,7 @@ class cppfront

// Now, emit our own template parameters
if (
n.template_parameters
(n.template_parameters && !n.is_alias())
&& (
printer.get_phase() < printer.phase2_func_defs
|| n.is_object()
Expand Down