Revert "Remove redundant check discovered in post-commit review of r209505."
authorDaniel Jasper <djasper@google.com>
Fri, 30 May 2014 13:31:14 +0000 (13:31 +0000)
committerDaniel Jasper <djasper@google.com>
Fri, 30 May 2014 13:31:14 +0000 (13:31 +0000)
This breaks with MSVC.
With IsLateTemplateParsed, FunctionDecl::doesThisDeclarationHaveABody() returns true regardless of Body.

This reinstates what was fixed in r208985.

llvm-svn: 209896

clang-tools-extra/clang-tidy/misc/UseOverride.cpp

index 4e4ae27..628c20f 100644 (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" &&