diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-23 14:56:09 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-23 14:56:09 +0000 |
commit | 5bd1a1151f5da8236c5b60f4e8a6135627a8130a (patch) | |
tree | 4658870a27d296e4ccc45ed44252308909956b29 /lib/Sema/SemaOverload.cpp | |
parent | 38a809571bf5fc3aee9bdd8aae866a8194dae146 (diff) |
When code-completion after a "," is building an overload set, note
that there is one more argument (the one following the comma) and make
the candidate non-viable if the function cannot accept any argument in
that position.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82625 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index 144cf93d31..12eb58733b 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -2189,7 +2189,8 @@ Sema::AddOverloadCandidate(FunctionDecl *Function, // (C++ 13.3.2p2): A candidate function having fewer than m // parameters is viable only if it has an ellipsis in its parameter // list (8.3.5). - if (NumArgs > NumArgsInProto && !Proto->isVariadic()) { + if ((NumArgs + (PartialOverloading && NumArgs)) > NumArgsInProto && + !Proto->isVariadic()) { Candidate.Viable = false; return; } |