]> granicus.if.org Git - clang/commit
Teach getTemplateInstantiationPattern to deal with generic lambdas.
authorFaisal Vali <faisalv@yahoo.com>
Thu, 3 Apr 2014 16:32:21 +0000 (16:32 +0000)
committerFaisal Vali <faisalv@yahoo.com>
Thu, 3 Apr 2014 16:32:21 +0000 (16:32 +0000)
commit05654971781ffd083c40d2115b81db7b8334c10f
tree59b729b40a4e6ef1d8b26453adf6f84aa1a8e4e5
parent5fdd7751b7138de87245ac49ad68bd44aff11d5b
Teach getTemplateInstantiationPattern to deal with generic lambdas.

No functionality change.

When determining the pattern for instantiating a generic lambda call operator specialization - we must not go drilling down for the 'prototype' (i.e. as written) pattern - rather we must use our partially transformed  pattern (whose DeclRefExprs are wired correctly to any enclosing lambda's decls that should be mapped correctly in a local instantiation scope) that is the templated pattern of the specialization's primary template (even though the primary template might be instantiated from a 'prototype' member-template).  Previously, the drilling down was haltted by marking the instantiated-from primary template as a member-specialization (incorrectly).

This prompted Richard to remark (http://llvm-reviews.chandlerc.com/D1784?id=4687#inline-10272)
"It's a bit nasty to (essentially) set this bit incorrectly. Can you put the check into getTemplateInstantiationPattern instead?"

In my reckless youth, I chose to ignore that comment.  With the passage of time, I have come to learn the value of bowing to the will of the angry Gods ;)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205543 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/ASTLambda.h
lib/AST/Decl.cpp
lib/Sema/SemaTemplateInstantiate.cpp