From: Dmitri Gribenko Date: Fri, 27 Jul 2012 21:34:43 +0000 (+0000) Subject: Comment Sema: don't try to typo-correct a \param when function has zero X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bbb7af301e0886f109b6391d7ba913b676ef44f5;p=clang 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 5301bfebe9..f0790760a9 100644 --- a/lib/AST/CommentSema.cpp +++ b/lib/AST/CommentSema.cpp @@ -169,6 +169,10 @@ ParamCommandComment *Sema::actOnParamCommandParamNameArg( 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