Skip to content

Commit e5d2779

Browse files
committedJun 27, 2016
[clang-tidy] Don't run misc-definitions-in-headers check in failing TUs.
Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D21470 llvm-svn: 273849
1 parent a45da38 commit e5d2779

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎clang-tools-extra/clang-tidy/misc/DefinitionsInHeadersCheck.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ void DefinitionsInHeadersCheck::registerMatchers(MatchFinder *Finder) {
7272
}
7373

7474
void DefinitionsInHeadersCheck::check(const MatchFinder::MatchResult &Result) {
75+
// Don't run the check in failing TUs.
76+
if (Result.Context->getDiagnostics().hasErrorOccurred())
77+
return;
78+
7579
// C++ [basic.def.odr] p6:
7680
// There can be more than one definition of a class type, enumeration type,
7781
// inline function with external linkage, class template, non-static function

0 commit comments

Comments
 (0)
Please sign in to comment.