Revert "Remove redundant check discovered in post-commit review of r209505."

This breaks with MSVC.
With IsLateTemplateParsed, FunctionDecl::doesThisDeclarationHaveABody() returns true regardless of Body.

This reinstates what was fixed in r208985.

llvm-svn: 209896
This commit is contained in:
Daniel Jasper 2014-05-30 13:31:14 +00:00
parent 86f60b7266
commit a2332425c4
1 changed files with 3 additions and 1 deletions

View File

@ -96,8 +96,10 @@ void UseOverride::check(const MatchFinder::MatchResult &Result) {
}
}
if (InsertLoc.isInvalid() && Method->doesThisDeclarationHaveABody())
if (InsertLoc.isInvalid() && Method->doesThisDeclarationHaveABody() &&
Method->getBody()) {
InsertLoc = Method->getBody()->getLocStart();
}
if (!InsertLoc.isValid()) {
if (Tokens.size() > 2 && GetText(Tokens.back(), Sources) == "0" &&