]> granicus.if.org Git - clang/commit
Fix an instantiation bug with nested generic lambdas and conversion to fptrs.
authorFaisal Vali <faisalv@yahoo.com>
Thu, 24 Oct 2013 01:05:22 +0000 (01:05 +0000)
committerFaisal Vali <faisalv@yahoo.com>
Thu, 24 Oct 2013 01:05:22 +0000 (01:05 +0000)
commit605f91ffd18f35ffcb5fcdd38379bd09b67a6cb8
treef2060aee5d7f9ac54068df6a6c0071165b1ba635
parent4a589c705d3b67a006fadfb140c4fa4d3b6df98d
Fix an instantiation bug with nested generic lambdas and conversion to fptrs.

This patch fixes the typelocs of the conversion-operator and the conversion-operator-name and adds the parameters of the call operator to the FunctionProtoTypeLoc of the respective entities. Thus, when the template declarations (conversion operators) undergo deduction and instantiation/transformation/substitution - they add themselves to the local instantiation scope if needed.

This patch supports the following:

auto L = [](auto b) {
  return [](auto a) ->decltype(a) { return a; };
};
int (*fp)(int) = L(8);

Richard LGTM'd this patch: http://llvm-reviews.chandlerc.com/D1831

Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193294 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaLambda.cpp
test/SemaCXX/cxx1y-generic-lambdas.cpp