[PATCH] Consistently handle clang-tidy check names in ClangTidyError.

Alexander Kornienko alexfh at google.com
Tue Jul 1 09:09:57 PDT 2014


================
Comment at: clang-tidy/ClangTidyDiagnosticConsumer.cpp:278
@@ -270,1 +277,3 @@
 
+    if (CheckName.empty()) {
+      switch (DiagLevel) {
----------------
Daniel Jasper wrote:
> So, this is true if Context.getCheckName(Info.getID()) returns "", right? In which cases does this happen?
Context.getCheckName returns non-empty string iff the diagnostic was generated using Context.diag, i.e. for all clang-tidy diagnostics. Compiler diagnostics may have warning option, which will be returned by getWarningOptionForDiag. If a compiler diagnostic doesn't have a warning option, CheckName remains empty. This is (almost?) always true for compiler errors (except for the ones mapped with -Werror). I've added a comment to the code to clarify this a bit.

================
Comment at: clang-tidy/ClangTidyDiagnosticConsumer.cpp:296
@@ -273,2 +295,3 @@
         DiagLevel == DiagnosticsEngine::Fatal) {
+      // Don't mute Clang errors regardless of filters and non-user code.
       Level = ClangTidyError::Error;
----------------
Daniel Jasper wrote:
> nit: "Don't mute" does not seem to be exactly what this does. It seems to be more of a "Force reporting of".
Done.

http://reviews.llvm.org/D4356






More information about the cfe-commits mailing list