Fix PR24694 (CWG1591): Deducing array bound and element type from initializer list
https://llvm.org/bugs/show_bug.cgi?id=24694 http://wg21.link/cwg1591 Teach DeduceFromInitializerList in SemaTemplateDeduction.cpp to deduce against array (constant and dependent sized) parameters (really, reference to arrays since they don't decay to pointers), by checking if the template parameter is either one of those kinds of arrays, and if so, deducing each initializer list element against the element type, and then deducing the array bound if needed. In brief, this patch enables the following code: template<class T, int N> int *f(T (&&)[N]); int *ip = f({1, 2, 3}); llvm-svn: 255221
Loading
Please register or sign in to comment