Teach code-completion to introduce a ", ..." placeholder for variadic functions
llvm-svn: 82577
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp
index cfec7b2..b19fda2 100644
--- a/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/clang/lib/Sema/SemaCodeComplete.cpp
@@ -657,6 +657,11 @@
// Add the placeholder string.
CCStr->AddPlaceholderChunk(PlaceholderStr.c_str());
}
+
+ if (const FunctionProtoType *Proto
+ = Function->getType()->getAs<FunctionProtoType>())
+ if (Proto->isVariadic())
+ CCStr->AddPlaceholderChunk(", ...");
}
/// \brief Add template parameter chunks to the given code completion string.