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

Ambiguous partial specialization on Clang 4.0 (trunk) #318

Closed
brunocodutra opened this issue Jan 15, 2017 · 9 comments
Closed

Ambiguous partial specialization on Clang 4.0 (trunk) #318

brunocodutra opened this issue Jan 15, 2017 · 9 comments

Comments

@brunocodutra
Copy link

Specializations of algorithms for hana::tuple fail with

ambiguous partial specializations of 'tag_of<boost::hana::tuple<>, boost::hana::when<true> >'
    struct tag_of : tag_of<T, when<true>> { };

on

$ clang --version

clang version 4.0.0 (trunk 291432)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
@palebedev
Copy link

Looks like what I've already reported here:
http://lists.llvm.org/pipermail/cfe-dev/2017-January/052160.html

@ldionne
Copy link
Member

ldionne commented Jan 15, 2017

Thanks for the heads up. I guess we still don't know whether the problem is with the library of the compiler?

@pfultz2
Copy link

pfultz2 commented Jan 15, 2017

You can see the commit for the change here: llvm-mirror/clang@89014aa

@palebedev
Copy link

I've pinged cfe-dev once more, hopefully they'll notice before clang 4 is released.

@ldionne
Copy link
Member

ldionne commented Jan 16, 2017

Unfortunately, I'm tempted to think that it's Hana's fault. If so, that will require a significant change to the way dispatching is done across the library, and that'll be a breaking change. In any case, that'll have to wait for Boost 1.64. I'm still hoping that it's a Clang bug, but I'm not too hopeful.

@brunocodutra
Copy link
Author

brunocodutra commented Jan 17, 2017 via email

@brunocodutra
Copy link
Author

Taking a closer look into it, the simplified mental model that I mentioned doesn't help here, because it is only good to address the rule that

The type of a template parameter corresponding to a specialized non-type argument shall not be dependent on a parameter of the specialization.

The present case is more complex and involves non-deduced context in the partial specialization ordering of class templates, which is as hairy as it gets:

http://stackoverflow.com/questions/31497357/partial-specialization-ordering-with-non-deduced-context

I'm not too confident Clang is correct here anymore.

@palebedev
Copy link

This problem is complicated, indeed, as we're in underspecified area of the standard, but it looks like we're safe for now - the pattern in question is now part of clang tests: llvm-mirror/clang@ae0874f . I've verified that clang with this commit works again.

@ldionne
Copy link
Member

ldionne commented Jan 17, 2017

That's great news, at least for now. Thanks a lot! I'll close this now.

@ldionne ldionne closed this as completed Jan 17, 2017
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

No branches or pull requests

4 participants