summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorKaelyn Uhrain <rikka@google.com>2013-09-26 21:13:05 +0000
committerKaelyn Uhrain <rikka@google.com>2013-09-26 21:13:05 +0000
commitf73430183afcedd5a331c4ac4d4f1ec6dac8f75f (patch)
tree681d560406d77757efb0394ef8d1f6b61071e39f /clang/lib
parenta1b4206a7018ca8f71e2d8564fc6f464d2bed1b7 (diff)
downloadbcm5719-llvm-f73430183afcedd5a331c4ac4d4f1ec6dac8f75f.tar.gz
bcm5719-llvm-f73430183afcedd5a331c4ac4d4f1ec6dac8f75f.zip
Fix error recovery when a return type correction includes a new name specifier.
llvm-svn: 191459
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 5997abe0296..62f65a580e6 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -426,8 +426,13 @@ bool Sema::DiagnoseUnknownTypeName(IdentifierInfo *&II,
llvm_unreachable("could not have corrected a typo here");
}
+ CXXScopeSpec tmpSS;
+ if (Corrected.getCorrectionSpecifier())
+ tmpSS.MakeTrivial(Context, Corrected.getCorrectionSpecifier(),
+ SourceRange(IILoc));
SuggestedType = getTypeName(*Corrected.getCorrectionAsIdentifierInfo(),
- IILoc, S, SS, false, false, ParsedType(),
+ IILoc, S, tmpSS.isSet() ? &tmpSS : SS, false,
+ false, ParsedType(),
/*IsCtorOrDtorName=*/false,
/*NonTrivialTypeSourceInfo=*/true);
}
OpenPOWER on IntegriCloud