aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/CommentSema.cpp
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2012-07-27 21:34:43 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2012-07-27 21:34:43 +0000
commitbbb7af301e0886f109b6391d7ba913b676ef44f5 (patch)
treec1b6141e00fa031e330f3eb92cadd7de6d03d1b5 /lib/AST/CommentSema.cpp
parent607f587a8cdf590f947a0248df8f18082eac8229 (diff)
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
Diffstat (limited to 'lib/AST/CommentSema.cpp')
-rw-r--r--lib/AST/CommentSema.cpp4
1 files changed, 4 insertions, 0 deletions
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