diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-07-22 23:45:10 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-07-22 23:45:10 +0000 |
commit | 505df2340ade21487c9fafe0f8075ddf7f66197e (patch) | |
tree | 76baa651be80e88d4eff524bddfd13de2f776e7c /clang/lib/Sema/TreeTransform.h | |
parent | f5b24e0136d71a884d4a671a3e4803a8b879e31f (diff) | |
download | bcm5719-llvm-505df2340ade21487c9fafe0f8075ddf7f66197e.tar.gz bcm5719-llvm-505df2340ade21487c9fafe0f8075ddf7f66197e.zip |
PR12917: Remove incorrect assumption that lambda mangling information cannot
change once it's been assigned. It can change in two ways:
1) In a template instantiation, the context declaration should be the
instantiated declaration, not the declaration in the template.
2) If a lambda appears in the pattern of a variadic pack expansion, the
mangling number will depend on the pack length.
llvm-svn: 160614
Diffstat (limited to 'clang/lib/Sema/TreeTransform.h')
-rw-r--r-- | clang/lib/Sema/TreeTransform.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index b03f86bb0ed..fff3b3f4bfd 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -7904,15 +7904,11 @@ TreeTransform<Derived>::TransformLambdaExpr(LambdaExpr *E) { Invalid = true; // Build the call operator. - // Note: Once a lambda mangling number and context declaration have been - // assigned, they never change. - unsigned ManglingNumber = E->getLambdaClass()->getLambdaManglingNumber(); - Decl *ContextDecl = E->getLambdaClass()->getLambdaContextDecl(); CXXMethodDecl *CallOperator = getSema().startLambdaDefinition(Class, E->getIntroducerRange(), - MethodTy, + MethodTy, E->getCallOperator()->getLocEnd(), - Params, ManglingNumber, ContextDecl); + Params); getDerived().transformAttrs(E->getCallOperator(), CallOperator); // FIXME: Instantiation-specific. |