[clang-tools-extra] r209896 - Revert "Remove redundant check discovered in post-commit review of r209505."

Daniel Jasper djasper at google.com
Fri May 30 06:31:14 PDT 2014


Author: djasper
Date: Fri May 30 08:31:14 2014
New Revision: 209896

URL: http://llvm.org/viewvc/llvm-project?rev=209896&view=rev
Log:
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.

Modified:
    clang-tools-extra/trunk/clang-tidy/misc/UseOverride.cpp

Modified: clang-tools-extra/trunk/clang-tidy/misc/UseOverride.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/UseOverride.cpp?rev=209896&r1=209895&r2=209896&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/UseOverride.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/UseOverride.cpp Fri May 30 08:31:14 2014
@@ -96,8 +96,10 @@ void UseOverride::check(const MatchFinde
       }
     }
 
-    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" &&





More information about the cfe-commits mailing list