forked from OSchip/llvm-project
Sema: code completion for variadic prototypes.
llvm-svn: 226908
This commit is contained in:
parent
8cd5f6f41b
commit
62a9a4fc9b
|
@ -3966,9 +3966,11 @@ void Sema::CodeCompleteCall(Scope *S, Expr *Fn, ArrayRef<Expr *> Args) {
|
||||||
|
|
||||||
if (auto FP = T->getAs<FunctionProtoType>()) {
|
if (auto FP = T->getAs<FunctionProtoType>()) {
|
||||||
if (!TooManyArguments(FP->getNumParams(), Args.size(),
|
if (!TooManyArguments(FP->getNumParams(), Args.size(),
|
||||||
/*PartialOverloading=*/true))
|
/*PartialOverloading=*/true) ||
|
||||||
|
FP->isVariadic())
|
||||||
Results.push_back(ResultCandidate(FP));
|
Results.push_back(ResultCandidate(FP));
|
||||||
} else if (auto FT = T->getAs<FunctionType>())
|
} else if (auto FT = T->getAs<FunctionType>())
|
||||||
|
// No prototype and declaration, it may be a K & R style function.
|
||||||
Results.push_back(ResultCandidate(FT));
|
Results.push_back(ResultCandidate(FT));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue