Closed
Description
Bugzilla Link | 33123 |
Version | 4.0 |
OS | Linux |
Attachments | Monad Maybe test case |
Reporter | LLVM Bugzilla Contributor |
Extended Description
In C++14 this code works, but in C++1z it produces an error meaning it can't find the specialization:
template <classT, T X> structA {}; template <classT, classU> structB {}; template <classT, T X> structB<T, A<T, X>> { using result = T; }; staticconstexprdouble input = 1.; intmain() { using result1 = typename B<int, A<int, 15>>::result; // OKusing result2 = typename B<constdouble*, A<constdouble*, &input>>::result; // OKusing result3 = typename B<constdouble&, A<constdouble&, input>>::result; // Error }
testcase4.cpp:19:71: error: no type named 'result' in 'B<const double &, A<const double &, &input> >' using result3 = typename B<const double&, A<const double&, input>>::result; // Error ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
I've attached a more complete example testcase.cpp that works in C++14 mode (prints the value 1) but in C++1z fails to compile.