diff options
author | Ilya Biryukov <ibiryukov@google.com> | 2019-10-04 08:10:27 +0000 |
---|---|---|
committer | Ilya Biryukov <ibiryukov@google.com> | 2019-10-04 08:10:27 +0000 |
commit | 8613e90ba71d3d96a6765320f92c49f08d1e55d1 (patch) | |
tree | a4c2824c0f5e12929395beb1eaf4a54007cf8626 /clang/lib/Sema/SemaCodeComplete.cpp | |
parent | 4c056583548ab59e2ad24deb2ca30790a290a8e3 (diff) | |
download | bcm5719-llvm-8613e90ba71d3d96a6765320f92c49f08d1e55d1.tar.gz bcm5719-llvm-8613e90ba71d3d96a6765320f92c49f08d1e55d1.zip |
[CodeComplete] Ensure object is the same in compareOverloads()
Summary:
This fixes a regression that led to size() not being available in clangd
when completing 'deque().^' and using libc++.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68335
llvm-svn: 373710
Diffstat (limited to 'clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index e4bbee86e35..f24c3b234ff 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -1185,6 +1185,9 @@ static OverloadCompare compareOverloads(const CXXMethodDecl &Candidate, const CXXMethodDecl &Incumbent, const Qualifiers &ObjectQuals, ExprValueKind ObjectKind) { + // Base/derived shadowing is handled elsewhere. + if (Candidate.getDeclContext() != Incumbent.getDeclContext()) + return OverloadCompare::BothViable; if (Candidate.isVariadic() != Incumbent.isVariadic() || Candidate.getNumParams() != Incumbent.getNumParams() || Candidate.getMinRequiredArguments() != |