diff options
Diffstat (limited to 'include/clang/Sema/TemplateDeduction.h')
-rw-r--r-- | include/clang/Sema/TemplateDeduction.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/include/clang/Sema/TemplateDeduction.h b/include/clang/Sema/TemplateDeduction.h index ac32e9c..7cc3571 100644 --- a/include/clang/Sema/TemplateDeduction.h +++ b/include/clang/Sema/TemplateDeduction.h @@ -13,7 +13,9 @@ #ifndef LLVM_CLANG_SEMA_TEMPLATE_DEDUCTION_H #define LLVM_CLANG_SEMA_TEMPLATE_DEDUCTION_H +#include "clang/Basic/PartialDiagnostic.h" #include "clang/AST/DeclTemplate.h" +#include "llvm/ADT/SmallVector.h" namespace clang { @@ -21,7 +23,7 @@ class ASTContext; class TemplateArgumentList; namespace sema { - + /// \brief Provides information about an attempted template argument /// deduction, whose success or failure was described by a /// TemplateDeductionResult value. @@ -37,6 +39,10 @@ class TemplateDeductionInfo { /// deduction is occurring. SourceLocation Loc; + /// \brief Warnings (and follow-on notes) that were suppressed due to + /// SFINAE while performing template argument deduction. + llvm::SmallVector<PartialDiagnosticAt, 4> SuppressedDiagnostics; + // do not implement these TemplateDeductionInfo(const TemplateDeductionInfo&); TemplateDeductionInfo &operator=(const TemplateDeductionInfo&); @@ -69,6 +75,23 @@ public: Deduced = NewDeduced; } + /// \brief Add a new diagnostic to the set of diagnostics + void addSuppressedDiagnostic(SourceLocation Loc, const PartialDiagnostic &PD) { + SuppressedDiagnostics.push_back(std::make_pair(Loc, PD)); + } + + /// \brief Iterator over the set of suppressed diagnostics. + typedef llvm::SmallVectorImpl<PartialDiagnosticAt>::const_iterator + diag_iterator; + + /// \brief Returns an iterator at the beginning of the sequence of suppressed + /// diagnostics. + diag_iterator diag_begin() const { return SuppressedDiagnostics.begin(); } + + /// \brief Returns an iterator at the end of the sequence of suppressed + /// diagnostics. + diag_iterator diag_end() const { return SuppressedDiagnostics.end(); } + /// \brief The template parameter to which a template argument /// deduction failure refers. /// |