Comment Sema: don't try to typo-correct a \param when function has zero
arguments.  Just an optimization, no functional change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160896 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/CommentSema.cpp b/lib/AST/CommentSema.cpp
index 5301bfe..f079076 100644
--- a/lib/AST/CommentSema.cpp
+++ b/lib/AST/CommentSema.cpp
@@ -169,6 +169,10 @@
   Diag(ArgLocBegin, diag::warn_doc_param_not_found)
     << Arg << ArgRange;
 
+  // No parameters -- can't suggest a correction.
+  if (ParamVars.size() == 0)
+    return Command;
+
   unsigned CorrectedParamIndex = ParamCommandComment::InvalidParamIndex;
   if (ParamVars.size() == 1) {
     // If function has only one parameter then only that parameter