diff options
author | Serge Pavlov <sepavloff@gmail.com> | 2014-04-13 16:52:03 +0000 |
---|---|---|
committer | Serge Pavlov <sepavloff@gmail.com> | 2014-04-13 16:52:03 +0000 |
commit | 6a7ffbed8ab434277483075b7bb3ed37ab4d5889 (patch) | |
tree | 1b76e8fd8c554a934cbe1996badc4479f9288b84 /clang/lib/Sema/SemaDecl.cpp | |
parent | 8e5e78e19bc94f36d968e6e8a8bcec17495ca3a0 (diff) | |
download | bcm5719-llvm-6a7ffbed8ab434277483075b7bb3ed37ab4d5889.tar.gz bcm5719-llvm-6a7ffbed8ab434277483075b7bb3ed37ab4d5889.zip |
Improve error recovery around colon.
Parse of nested name spacifier is modified so that it properly recovers
if colon is mistyped as double colon in case statement.
This patch fixes PR15133.
Differential Revision: http://llvm-reviews.chandlerc.com/D2870
llvm-svn: 206135
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index cc461ef1412..948c58030af 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -584,16 +584,15 @@ Sema::NameClassification Sema::ClassifyName(Scope *S, CorrectionCandidateCallback *CCC) { DeclarationNameInfo NameInfo(Name, NameLoc); ObjCMethodDecl *CurMethod = getCurMethodDecl(); - + if (NextToken.is(tok::coloncolon)) { BuildCXXNestedNameSpecifier(S, *Name, NameLoc, NextToken.getLocation(), QualType(), false, SS, 0, false); - } - + LookupResult Result(*this, Name, NameLoc, LookupOrdinaryName); LookupParsedName(Result, S, &SS, !CurMethod); - + // Perform lookup for Objective-C instance variables (including automatically // synthesized instance variables), if we're in an Objective-C method. // FIXME: This lookup really, really needs to be folded in to the normal |