Skip to content

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

New issue

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

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

Already on GitHub? # to your account

Closed
wants to merge 2 commits into from

Conversation

HungMingWu
Copy link

Test case:

A : namespace = {
        t1: type == int;
}

B : namespace = {
        using A::t1;
}

int main()
{
        return 0;
}

@hsutter
Copy link
Owner

hsutter commented Sep 23, 2024

Thanks for your pull request! It looks like this may be your first contribution to cppfront. I've emailed you the Contributor License Agreement (CLA), and once it's signed I can look at your pull request. Thanks again for your contribution.

@hsutter
Copy link
Owner

hsutter commented Sep 24, 2024

Thanks! I agree that the above example isn't handled correctly so there is a bug, but when I tried this PR it fixes that example but breaks others and doesn't pass regression tests.

Here is an example that no longer works with this PR:

A : namespace = {
    test: <T> type == std::vector<T>;
}

which in this PR lowers to:

namespace A {
    template<typename T> using test = std::vector<T>;
}

namespace A {
    template<typename T> 
}

namespace A {

}

I didn't see a quick way to resolve the problem myself just now, but if you want to keep trying I'll review this PR again if you have an update that passes regression tests. Thanks!

@hsutter hsutter added the question - further information requested Further information is requested label Sep 24, 2024
@hsutter
Copy link
Owner

hsutter commented Oct 31, 2024

Hi! I'm sorry I can't get this branch to self-build... rebuilding reflect.h2 and cppregex.h2 generates code that doesn't build. I haven't looked to see why (sorry).

For now I'm going to close this, but if you want to try again please reopen a new PR. Thanks again, I do appreciate your interest and contribution!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants