[clang-tools-extra] r273849 - [clang-tidy] Don't run misc-definitions-in-headers check in failing TUs.
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 27 01:04:02 PDT 2016
Author: hokein
Date: Mon Jun 27 03:04:01 2016
New Revision: 273849
URL: http://llvm.org/viewvc/llvm-project?rev=273849&view=rev
Log:
[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
Modified:
clang-tools-extra/trunk/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
Modified: clang-tools-extra/trunk/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/DefinitionsInHeadersCheck.cpp?rev=273849&r1=273848&r2=273849&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/DefinitionsInHeadersCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/DefinitionsInHeadersCheck.cpp Mon Jun 27 03:04:01 2016
@@ -72,6 +72,10 @@ void DefinitionsInHeadersCheck::register
}
void DefinitionsInHeadersCheck::check(const MatchFinder::MatchResult &Result) {
+ // Don't run the check in failing TUs.
+ if (Result.Context->getDiagnostics().hasErrorOccurred())
+ return;
+
// C++ [basic.def.odr] p6:
// There can be more than one definition of a class type, enumeration type,
// inline function with external linkage, class template, non-static function
More information about the cfe-commits
mailing list