From bbb7af301e0886f109b6391d7ba913b676ef44f5 Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Fri, 27 Jul 2012 21:34:43 +0000 Subject: [PATCH] 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 --- lib/AST/CommentSema.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.50.1