[Bug c++/80841] Fails to match template specialization with polymorphic non-type template argument
cipherjason at hotmail dot com
gcc-bugzilla@gcc.gnu.org
Mon May 22 07:36:00 GMT 2017
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).
More information about the Gcc-bugs
mailing list