Skip to content

Commit a233242

Browse files
committed
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
1 parent 86f60b7 commit a233242

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ void UseOverride::check(const MatchFinder::MatchResult &Result) {
9696
}
9797
}
9898

99-
if (InsertLoc.isInvalid() && Method->doesThisDeclarationHaveABody())
99+
if (InsertLoc.isInvalid() && Method->doesThisDeclarationHaveABody() &&
100+
Method->getBody()) {
100101
InsertLoc = Method->getBody()->getLocStart();
102+
}
101103

102104
if (!InsertLoc.isValid()) {
103105
if (Tokens.size() > 2 && GetText(Tokens.back(), Sources) == "0" &&

0 commit comments

Comments
 (0)