[Clang] Fix handling of placeholder variables name in init captures (#107055)
authorcor3ntin <corentinjabot@gmail.com>
Tue, 3 Sep 2024 18:36:15 +0000 (20:36 +0200)
committerCorentin Jabot <corentinjabot@gmail.com>
Thu, 12 Sep 2024 10:41:44 +0000 (12:41 +0200)
commit8290ce0998788b6a575ed7b4988b093f48c25b3d
tree65c5acf86e5451e2a727a9c1ff56f3e5e577eda7
parent327ca6c02f0dbf13dd6f039d30d320a7ba1456b8
[Clang] Fix handling of placeholder variables name in init captures (#107055)

We were incorrectly not deduplicating results when looking up `_` which,
for a lambda init capture, would result in an ambiguous lookup.

The same bug caused some diagnostic notes to be emitted twice.

Fixes #107024
clang/docs/ReleaseNotes.rst
clang/lib/Sema/SemaLambda.cpp
clang/lib/Sema/SemaLookup.cpp
clang/test/SemaCXX/cxx2c-placeholder-vars.cpp