summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseTentative.cpp
diff options
context:
space:
mode:
authorKaelyn Uhrain <rikka@google.com>2013-04-03 16:59:49 +0000
committerKaelyn Uhrain <rikka@google.com>2013-04-03 16:59:49 +0000
commit989b7ca0922104157e76bc8520cc1bc1affb0304 (patch)
tree8286e790cc6dfe051a276b2f5813f5e964b3fb40 /clang/lib/Parse/ParseTentative.cpp
parent80031d9fc45f9d647a1462d74a44d8070da672bb (diff)
downloadbcm5719-llvm-989b7ca0922104157e76bc8520cc1bc1affb0304.tar.gz
bcm5719-llvm-989b7ca0922104157e76bc8520cc1bc1affb0304.zip
Give the default CorrectionCandidateCallback::ValidateCandidate some
smarts so that it doesn't approve of keywords and/or type names when it knows (based on its flags) that those kinds of corrections are not wanted. llvm-svn: 178668
Diffstat (limited to 'clang/lib/Parse/ParseTentative.cpp')
-rw-r--r--clang/lib/Parse/ParseTentative.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseTentative.cpp b/clang/lib/Parse/ParseTentative.cpp
index fe602f6b658..5e0ef2b83f6 100644
--- a/clang/lib/Parse/ParseTentative.cpp
+++ b/clang/lib/Parse/ParseTentative.cpp
@@ -999,6 +999,7 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult,
// to types and identifiers, in order to try to recover from errors.
CorrectionCandidateCallback TypoCorrection;
TypoCorrection.WantRemainingKeywords = false;
+ TypoCorrection.WantTypeSpecifiers = Next.isNot(tok::arrow);
switch (TryAnnotateName(false /* no nested name specifier */,
&TypoCorrection)) {
case ANK_Error:
OpenPOWER on IntegriCloud