This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112c. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2023-11-10
Consider the following example (taken from issue 3 of paper P0348R0):
template <typename U> void fun(U u = U()); struct X { X(int) {} }; template <class T> decltype(fun<T>()) g(int) { } template<> void g(long) { } int main() { g<X>(0); }
When is the substitution into the return type done? The current specification makes this example ill-formed because the failure to instantiate the default argument in the decltype operand is not in the immediate context of the substitution, although a plausible argument for making this a SFINAE case can be made.
Notes from the June, 2016 meeting:
CWG decided to refer this question to EWG for their consideration.
EWG 2022-11-11
This is tracked in github issue cplusplus/papers#1377.