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

Hang in the test-case from #1127 with extra assertions. #1129

Open
emilio opened this issue Oct 31, 2017 · 2 comments
Open

Hang in the test-case from #1127 with extra assertions. #1129

emilio opened this issue Oct 31, 2017 · 2 comments
Labels

Comments

@emilio
Copy link
Contributor

emilio commented Oct 31, 2017

With the fix for the panic in #1128, we get through it and generate code correctly, but on llvm 4.0 we generate a cyclic alias reference, so we get stuck resolving items in assert_every_item_in_a_module (enabled only with extra assertions).

The test is:

// bindgen-flags: -- -std=c++11

template <typename> struct A;
template <typename, typename, bool> struct _Map_base;
template <typename _Pair, typename _Traits>
struct _Map_base<_Pair, _Traits, true> {
  using __hashtable_base = A<_Traits>;
  using key_type = typename __hashtable_base::key_type;
  using mapped_type = typename _Pair::type;
  mapped_type &at(const key_type &);
};
template <typename _Pair, typename _Traits>
auto _Map_base<_Pair, _Traits, true>::at(const key_type &) -> mapped_type & {}

The method definition does surprisingly matter, so there's something fishy going on there, but I'm punting on landing the test-case for now because the fix fixes the issue, and also unblocks updating bindgen in mozilla-central.

@emilio
Copy link
Contributor Author

emilio commented Oct 31, 2017

Bisect points to c736faa, which is where the assertion was introduced, so that's not really helpful... :)

@fitzgen
Copy link
Member

fitzgen commented Nov 27, 2017

We have debug-only sets that we use to assert against infinite loops elsewhere (item ancestors iirc) so we should use them here as well.

Of course, the bigger issue is that we shouldn't be generating cyclic aliases at all...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants