diff options
Diffstat (limited to 'contrib/llvm-project/clang/lib/Sema/CodeCompleteConsumer.cpp')
-rw-r--r-- | contrib/llvm-project/clang/lib/Sema/CodeCompleteConsumer.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/contrib/llvm-project/clang/lib/Sema/CodeCompleteConsumer.cpp b/contrib/llvm-project/clang/lib/Sema/CodeCompleteConsumer.cpp index 8e8a1be38c0f..e93be3e04dfe 100644 --- a/contrib/llvm-project/clang/lib/Sema/CodeCompleteConsumer.cpp +++ b/contrib/llvm-project/clang/lib/Sema/CodeCompleteConsumer.cpp @@ -515,7 +515,8 @@ CodeCompleteConsumer::OverloadCandidate::getFunctionType() const { case CK_FunctionType: return Type; - + case CK_FunctionProtoTypeLoc: + return ProtoTypeLoc.getTypePtr(); case CK_Template: case CK_Aggregate: return nullptr; @@ -524,6 +525,13 @@ CodeCompleteConsumer::OverloadCandidate::getFunctionType() const { llvm_unreachable("Invalid CandidateKind!"); } +const FunctionProtoTypeLoc +CodeCompleteConsumer::OverloadCandidate::getFunctionProtoTypeLoc() const { + if (Kind == CK_FunctionProtoTypeLoc) + return ProtoTypeLoc; + return FunctionProtoTypeLoc(); +} + unsigned CodeCompleteConsumer::OverloadCandidate::getNumParams() const { if (Kind == CK_Template) return Template->getTemplateParameters()->size(); @@ -597,7 +605,12 @@ CodeCompleteConsumer::OverloadCandidate::getParamDecl(unsigned N) const { if (const auto *FD = getFunction()) { if (N < FD->param_size()) return FD->getParamDecl(N); + } else if (Kind == CK_FunctionProtoTypeLoc) { + if (N < ProtoTypeLoc.getNumParams()) { + return ProtoTypeLoc.getParam(N); + } } + return nullptr; } |