https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80841
--- Comment #2 from Jason Bell <cipherjason at hotmail dot com> --- Thanks that's a good reduced example. I've changed it slightly so it works with constexpr input. //######################################### 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 constexpr double input = 1.; int main() { using result1 = typename B<int, A<int, 15>>::result; // OK using result2 = typename B<const double*, A<const double*, &input>>::result; // OK using result3 = typename B<const double&, A<const double&, input>>::result; // Error } //######################################### I've noticed that it works in Clang if using --std=c++14 but not with --std=c++1z (same as my previous example).