Forgotten part of previous commit.

llvm-svn: 127536
This commit is contained in:
Abramo Bagnara
2011-03-12 11:17:06 +00:00
parent 5e152ce3fe
commit f2a79d94e4
11 changed files with 51 additions and 43 deletions

View File

@@ -194,14 +194,14 @@ bool Sema::CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New) {
OS << ")";
OS.flush();
SourceLocation AfterParenLoc;
SourceLocation FixItLoc;
if (TypeSourceInfo *TSInfo = New->getTypeSourceInfo()) {
TypeLoc TL = TSInfo->getTypeLoc().IgnoreParens();
if (const FunctionTypeLoc *FTLoc = dyn_cast<FunctionTypeLoc>(&TL))
AfterParenLoc = PP.getLocForEndOfToken(FTLoc->getRParenLoc());
FixItLoc = PP.getLocForEndOfToken(FTLoc->getLocalRangeEnd());
}
if (AfterParenLoc.isInvalid())
if (FixItLoc.isInvalid())
Diag(New->getLocation(), diag::warn_missing_exception_specification)
<< New << OS.str();
else {
@@ -209,7 +209,7 @@ bool Sema::CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New) {
// late-specified return types.
Diag(New->getLocation(), diag::warn_missing_exception_specification)
<< New << OS.str()
<< FixItHint::CreateInsertion(AfterParenLoc, " " + OS.str().str());
<< FixItHint::CreateInsertion(FixItLoc, " " + OS.str().str());
}
if (!Old->getLocation().isInvalid())