[PATCH] D73701: [clang] fix linkage of nested lambda

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 30 18:32:35 PST 2020


rsmith added a comment.

This is effectively reverting https://reviews.llvm.org/D1783. If we don't need that any more for whatever reason, can we also get rid of the check for whether the outermost lambda has a mangling number a few lines above? (Please also check if we can remove `getOutermostEnclosingLambda`, which was added for this purpose.)



================
Comment at: clang/lib/AST/Decl.cpp:1416-1417
         return getLVForClosure(
-                  OuterMostLambda->getDeclContext()->getRedeclContext(),
-                  OuterMostLambda->getLambdaContextDecl(), computation);
+                  Record->getDeclContext()->getRedeclContext(),
+                  Record->getLambdaContextDecl(), computation);
       }
----------------
hliao wrote:
> The code is still inconsistent with the comment. `Record` is the lambda itself instead of the parent of the lambda.
`Record->getDeclContext()` returns the parent of the lambda.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73701/new/

https://reviews.llvm.org/D73701





More information about the cfe-commits mailing list