Skip to content
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

Infinite loop resolving items when combining partial template specialization with qualified dependent types #2085

Closed
pcwalton opened this issue Jul 30, 2021 · 0 comments · Fixed by #2088

Comments

@pcwalton
Copy link
Contributor

Another fun one. This is minimized from GCC 8's version of <unordered_map> in the STL.

Input C/C++ Header

template<typename T>
struct Foo;

template<typename T, typename U>
struct Bar {};

template<typename T>
struct Bar<T, void> {
    using BarDependent = typename Foo<T>::Dependent;
    void method(const BarDependent &);
};

template<typename T>
void Bar<T, void>::method(const BarDependent &) {}

Bindgen Invocation

$ bindgen input.hpp -- -x c++

Actual Results

I haven't fully investigated yet, but I think the failing loop is here:

    frame #4: 0x00000001001dd8b2 bindgen`bindgen::ir::context::ItemResolver::resolve::h03bf533c52fa58fd(self=ItemResolver @ 0x00007ffeefbe71f0, ctx=0x00007ffeefbe9d28) at context.rs:2721:24

Expected Results

We don't need bindings for these methods, but we need to not hang or panic.

pcwalton added a commit to pcwalton/rust-bindgen that referenced this issue Aug 2, 2021
These can happen in certain cases involving incomplete qualified dependent
types. To avoid looping forever, we need to check for them.

Closes rust-lang#2085.
emilio pushed a commit that referenced this issue Aug 24, 2021
These can happen in certain cases involving incomplete qualified dependent
types. To avoid looping forever, we need to check for them.

Closes #2085.
lightsofapollo pushed a commit to lightsofapollo/rust-bindgen that referenced this issue Oct 19, 2021
These can happen in certain cases involving incomplete qualified dependent
types. To avoid looping forever, we need to check for them.

Closes rust-lang#2085.
LoganBarnett pushed a commit to LoganBarnett/rust-bindgen that referenced this issue Dec 2, 2023
These can happen in certain cases involving incomplete qualified dependent
types. To avoid looping forever, we need to check for them.

Closes rust-lang#2085.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant