[clang] Fix linkage of nested lambdas.
authorMichael Liao <michael.hliao@gmail.com>
Fri, 7 Feb 2020 17:58:17 +0000 (12:58 -0500)
committerMichael Liao <michael.hliao@gmail.com>
Fri, 7 Feb 2020 18:24:21 +0000 (13:24 -0500)
commit2926917f430d705f084813b63a40fafc61872524
treee54d1f37357d004ca3e45cc7626425457cfe65ea
parentcbe0c8299e946e572870054cf21ccb7e86d90d03
[clang] Fix linkage of nested lambdas.

patch from Philippe Daouadi <blastrock@free.fr>

This is an attempt to fix
[PR#44368](https://bugs.llvm.org/show_bug.cgi?id=44368)

This effectively reverts [D1783](https://reviews.llvm.org/D1783). It
doesn't break the current tests and fixes the test that this commit
adds.

We now decide of a lambda linkage only depending on the visibility of
its parent context.

Differential Revision: https://reviews.llvm.org/D73701
clang/lib/AST/Decl.cpp
clang/test/CodeGenCXX/lambda-expressions-nested-linkage.cpp