summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorFaisal Vali <faisalv@yahoo.com>2013-06-26 02:34:24 +0000
committerFaisal Vali <faisalv@yahoo.com>2013-06-26 02:34:24 +0000
commit86648b13eb01c0565de7264b27799ba81c7ad060 (patch)
treebc58950aaa230b53929ee3d794a25e79ef949968 /lib/CodeGen/CGExpr.cpp
parent7b6301f7f5f9c0ead17a448aad7c456b3252bb45 (diff)
downloadclang-86648b13eb01c0565de7264b27799ba81c7ad060.tar.gz
clang-86648b13eb01c0565de7264b27799ba81c7ad060.tar.bz2
clang-86648b13eb01c0565de7264b27799ba81c7ad060.tar.xz
Fix PCH bug with member templates of local classes in nontemplate functions.
As noted by Richard in the post: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130624/082605.html, the following code should not add an entry into PendingLocalImplicitInstantiations, since local instantiations should only occur within the context of other instantiations: int foo(double y) { struct Lambda { template<class T> T operator()(T t) const { return t; }; } lambda; return lambda(y); } Hence the attached code does the following: 1) In MarkFunctionReferenced, check if ActiveInstantiations.size() is non-zero before adding to PendingLocalImplicitInstantiations. 2) In InstantiateFunctionDefinition, we swap out/in PendingLocalImplicitInstantiations so that only those pending local instantiations that are added during the instantiation of the current function are instantiated recursively. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184903 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
0 files changed, 0 insertions, 0 deletions