https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80841
Daniel Krügler <daniel.kruegler at googlemail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |daniel.kruegler@googlemail. | |com --- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> --- (In reply to Jason Bell from comment #0) An interesting case. Reduced example: //######################################### template <class T, T X> struct A {}; template <class T, class U> struct B {}; template <class T, T X> struct B<T, A<T, X>> { using result = T; }; static double input; int main() { using result1 = typename B<int, A<int, 15>>::result; // OK using result2 = typename B<double*, A<double*, &input>>::result; // OK using result3 = typename B<double&, A<double&, input>>::result; // Error } //######################################### results in: prog.cc: In function 'int main()': prog.cc:18:59: error: 'result' in 'struct B<double&, A<double&, input> >' does not name a type using result3 = typename B<double&, A<double&, input>>::result; ^~~~~~ Clang behaves exactly the same and from the compiler behaviour it looks like a non-deducible situation, but I fail to match this with current non-deduced context rules at the moment.