Open CaseyCarter opened 6 years ago
mentioned in issue llvm/llvm-bugzilla-archive#40321
See also the example from llvm/llvm-bugzilla-archive#40321 , which is another partial specialization selection / void_t / access mishap, but not involving an alias template.
Bug llvm/llvm-bugzilla-archive#40321 has been marked as a duplicate of this bug.
Interesting. void_t has historically been broken in Clang; I'm about to land a fix for that, but it doesn't actually help in this case. I have some guesses as to what might be happening here:
There's a "no access checks" context for the template argument list of a template specialization that might incorrectly be being considered here.
Protected access involves an additional check that we might be deferring (and that we somehow end up checking too late, after we've left the SFINAE context for the partial specialization).
... but in any case, in both cases we should hit a SFINAE failure during substitution into the partial specialization's template-id, so we should select the primary template.
Extended Description
Compiling this correct program with -std=c++1z:
produces diagnostices (https://godbolt.org/z/WGvIFN):
Private base class? Fine. Protected base class? EXPLODES