aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-06-15 16:52:15 +0000
committerDouglas Gregor <dgregor@apple.com>2009-06-15 16:52:15 +0000
commit8439fac3ce6c26db7982e34d119bf905b57eac91 (patch)
tree8a81e0a9141a72040d821654d6cc57adf9b90cdd /lib
parent7420c2dee747a19c718f486e8d092094cdab56ed (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/Basic/Diagnostic.cpp2
-rw-r--r--lib/Sema/Sema.h20
2 files changed, 3 insertions, 19 deletions
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);