From: Douglas Gregor Date: Mon, 15 Jun 2009 16:52:15 +0000 (+0000) Subject: Base SFINAE error suppression counting on the class of an error, not X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8439fac3ce6c26db7982e34d119bf905b57eac91;p=clang Base SFINAE error suppression counting on the class of an error, not its (possibly-remapped) diagnostics. Thanks, Chris! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73390 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index 323f7a7d4a..78b8b0a855 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -118,7 +118,7 @@ const char *Diagnostic::getWarningOptionForDiag(unsigned DiagID) { bool Diagnostic::isBuiltinSFINAEDiag(unsigned DiagID) { if (const StaticDiagInfoRec *Info = GetDiagInfo(DiagID)) - return Info->SFINAE && Info->Class != CLASS_NOTE; + return Info->SFINAE && Info->Class == CLASS_ERROR; return false; } diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index 0607a893da..34513e7d58 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -312,24 +312,8 @@ public: // If we encountered an error during template argument // deduction, and that error is one of the SFINAE errors, // suppress the diagnostic. - bool Fatal = false; - switch (Diags.getDiagnosticLevel(DiagID)) { - case Diagnostic::Ignored: - case Diagnostic::Note: - case Diagnostic::Warning: - break; - - case Diagnostic::Error: - ++NumSFINAEErrors; - break; - - case Diagnostic::Fatal: - Fatal = true; - break; - } - - if (!Fatal) - return SemaDiagnosticBuilder(*this); + ++NumSFINAEErrors; + return SemaDiagnosticBuilder(*this); } DiagnosticBuilder DB = Diags.Report(FullSourceLoc(Loc, SourceMgr), DiagID);