aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorcor3ntin <corentinjabot@gmail.com>2024-09-03 20:36:15 +0200
committerGitHub <noreply@github.com>2024-09-03 20:36:15 +0200
commiteec1fac9b51d06c8afafe9952a20ba7cd4c3ce1c (patch)
tree9f79ea195ea8bc91a2702ab99a0516df996db2bd /clang/lib/Sema/SemaLookup.cpp
parent15fa3ba547bc3ee04af5c32b8f723a97e3feefd8 (diff)
downloadllvm-eec1fac9b51d06c8afafe9952a20ba7cd4c3ce1c.zip
llvm-eec1fac9b51d06c8afafe9952a20ba7cd4c3ce1c.tar.gz
llvm-eec1fac9b51d06c8afafe9952a20ba7cd4c3ce1c.tar.bz2
[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
Diffstat (limited to 'clang/lib/Sema/SemaLookup.cpp')
-rw-r--r--clang/lib/Sema/SemaLookup.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index 7a6a645..d3d4bf27 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -570,7 +570,7 @@ void LookupResult::resolveKind() {
// For non-type declarations, check for a prior lookup result naming this
// canonical declaration.
- if (!D->isPlaceholderVar(getSema().getLangOpts()) && !ExistingI) {
+ if (!ExistingI) {
auto UniqueResult = Unique.insert(std::make_pair(D, I));
if (!UniqueResult.second) {
// We've seen this entity before.