summaryrefslogtreecommitdiffstats
path: root/clang/lib
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
commitf24990aef10c3a36f46402747d27aeb702a129df (patch)
treea9c5be62a214cbf09f87d33a5dbd7d5104170ec0 /clang/lib
parent84c97cafd063882b956ecc4b6743cbe185ef2ddc (diff)
downloadbcm5719-llvm-f24990aef10c3a36f46402747d27aeb702a129df.tar.gz
bcm5719-llvm-f24990aef10c3a36f46402747d27aeb702a129df.zip
Comment Sema: don't try to typo-correct a \param when function has zero
arguments. Just an optimization, no functional change. llvm-svn: 160896
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/CommentSema.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/AST/CommentSema.cpp b/clang/lib/AST/CommentSema.cpp
index 5301bfebe96..f0790760a9b 100644
--- a/clang/lib/AST/CommentSema.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud