]> granicus.if.org Git - clang/commitdiff
Base SFINAE error suppression counting on the class of an error, not
authorDouglas Gregor <dgregor@apple.com>
Mon, 15 Jun 2009 16:52:15 +0000 (16:52 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 15 Jun 2009 16:52:15 +0000 (16:52 +0000)
its (possibly-remapped) diagnostics. Thanks, Chris!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73390 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Diagnostic.cpp
lib/Sema/Sema.h

index 323f7a7d4afde33c2d1fadb99f46ab09fcacc925..78b8b0a8559777ecf99a32b59bce3643fd2262cc 100644 (file)
@@ -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;
 }
 
index 0607a893da864bcca09cf5ab232f77d3f46030eb..34513e7d588cd9d0faf49d3b592ff0a64e73f5ed 100644 (file)
@@ -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);