diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-25 22:17:48 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-25 22:17:48 +0000 |
commit | eab5d1eaaa662c849f1f9920dc8c6a31d7c32d47 (patch) | |
tree | 1313bf5996ce3065393646b179b9e8f2b5408c31 /lib/Basic | |
parent | 90f97892eb8b2ecfcf633c9df01e2504686d4d96 (diff) |
Teach the diagnostic engine to provide more detailed information about
how to handle a diagnostic during template argument deduction, which
may be "substitution failure", "suppress", or "report". This keeps us
from, e.g., emitting warnings while performing template argument
deduction.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99560 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic')
-rw-r--r-- | lib/Basic/Diagnostic.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index 31d3b34c81..21a8aeae42 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -124,10 +124,20 @@ const char *Diagnostic::getWarningOptionForDiag(unsigned DiagID) { return 0; } -bool Diagnostic::isBuiltinSFINAEDiag(unsigned DiagID) { - if (const StaticDiagInfoRec *Info = GetDiagInfo(DiagID)) - return Info->SFINAE && Info->Class == CLASS_ERROR; - return false; +Diagnostic::SFINAEResponse +Diagnostic::getDiagnosticSFINAEResponse(unsigned DiagID) { + if (const StaticDiagInfoRec *Info = GetDiagInfo(DiagID)) { + if (!Info->SFINAE) + return SFINAE_Report; + + if (Info->Class == CLASS_ERROR) + return SFINAE_SubstitutionFailure; + + // Suppress notes, warnings, and extensions; + return SFINAE_Suppress; + } + + return SFINAE_Report; } /// getDiagClass - Return the class field of the diagnostic. |