[PATCH] D21470: [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:11:03 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL273849: [clang-tidy] Don't run misc-definitions-in-headers check in failing TUs. (authored by hokein).

Changed prior to commit:
  http://reviews.llvm.org/D21470?vs=61092&id=61938#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D21470

Files:
  clang-tools-extra/trunk/clang-tidy/misc/DefinitionsInHeadersCheck.cpp

Index: clang-tools-extra/trunk/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
===================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
+++ clang-tools-extra/trunk/clang-tidy/misc/DefinitionsInHeadersCheck.cpp
@@ -72,6 +72,10 @@
 }
 
 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21470.61938.patch
Type: text/x-patch
Size: 705 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160627/d06e28a1/attachment.bin>


More information about the cfe-commits mailing list