clang 18.0.0git
|
A structure used to record information about a failed template argument deduction, for diagnosis. More...
#include "clang/Sema/TemplateDeduction.h"
Public Member Functions | |
PartialDiagnosticAt * | getSFINAEDiagnostic () |
Retrieve the diagnostic which caused this deduction failure, if any. | |
TemplateParameter | getTemplateParameter () |
Retrieve the template parameter this deduction failure refers to, if any. | |
TemplateArgumentList * | getTemplateArgumentList () |
Retrieve the template argument list associated with this deduction failure, if any. | |
const TemplateArgument * | getFirstArg () |
Return the first template argument this deduction failure refers to, if any. | |
const TemplateArgument * | getSecondArg () |
Return the second template argument this deduction failure refers to, if any. | |
std::optional< unsigned > | getCallArgIndex () |
Return the index of the call argument that this deduction failure refers to, if any. | |
void | Destroy () |
Free any memory associated with this deduction failure. | |
Public Attributes | |
unsigned | Result: 8 |
A Sema::TemplateDeductionResult. | |
unsigned | HasDiagnostic: 1 |
Indicates whether a diagnostic is stored in Diagnostic. | |
void * | Data |
Opaque pointer containing additional data about this deduction failure. | |
char | Diagnostic [sizeof(PartialDiagnosticAt)] |
A diagnostic indicating why deduction failed. | |
A structure used to record information about a failed template argument deduction, for diagnosis.
Definition at line 258 of file TemplateDeduction.h.
void DeductionFailureInfo::Destroy | ( | ) |
Free any memory associated with this deduction failure.
Definition at line 712 of file SemaOverload.cpp.
References Data, Diag(), getSFINAEDiagnostic(), HasDiagnostic, Result, clang::Sema::TDK_AlreadyDiagnosed, clang::Sema::TDK_ConstraintsNotSatisfied, clang::Sema::TDK_CUDATargetMismatch, clang::Sema::TDK_DeducedMismatch, clang::Sema::TDK_DeducedMismatchNested, clang::Sema::TDK_Incomplete, clang::Sema::TDK_IncompletePack, clang::Sema::TDK_Inconsistent, clang::Sema::TDK_InstantiationDepth, clang::Sema::TDK_Invalid, clang::Sema::TDK_InvalidExplicitArguments, clang::Sema::TDK_MiscellaneousDeductionFailure, clang::Sema::TDK_NonDeducedMismatch, clang::Sema::TDK_NonDependentConversionFailure, clang::Sema::TDK_SubstitutionFailure, clang::Sema::TDK_Success, clang::Sema::TDK_TooFewArguments, clang::Sema::TDK_TooManyArguments, and clang::Sema::TDK_Underqualified.
std::optional< unsigned > DeductionFailureInfo::getCallArgIndex | ( | ) |
Return the index of the call argument that this deduction failure refers to, if any.
Definition at line 900 of file SemaOverload.cpp.
References Data, Result, clang::Sema::TDK_DeducedMismatch, and clang::Sema::TDK_DeducedMismatchNested.
Referenced by DiagnoseBadDeduction().
const TemplateArgument * DeductionFailureInfo::getFirstArg | ( | ) |
Return the first template argument this deduction failure refers to, if any.
Definition at line 836 of file SemaOverload.cpp.
References Data, Result, clang::Sema::TDK_AlreadyDiagnosed, clang::Sema::TDK_ConstraintsNotSatisfied, clang::Sema::TDK_CUDATargetMismatch, clang::Sema::TDK_DeducedMismatch, clang::Sema::TDK_DeducedMismatchNested, clang::Sema::TDK_Incomplete, clang::Sema::TDK_IncompletePack, clang::Sema::TDK_Inconsistent, clang::Sema::TDK_InstantiationDepth, clang::Sema::TDK_Invalid, clang::Sema::TDK_InvalidExplicitArguments, clang::Sema::TDK_MiscellaneousDeductionFailure, clang::Sema::TDK_NonDeducedMismatch, clang::Sema::TDK_NonDependentConversionFailure, clang::Sema::TDK_SubstitutionFailure, clang::Sema::TDK_Success, clang::Sema::TDK_TooFewArguments, clang::Sema::TDK_TooManyArguments, and clang::Sema::TDK_Underqualified.
Referenced by DiagnoseBadDeduction().
const TemplateArgument * DeductionFailureInfo::getSecondArg | ( | ) |
Return the second template argument this deduction failure refers to, if any.
Definition at line 868 of file SemaOverload.cpp.
References Data, Result, clang::Sema::TDK_AlreadyDiagnosed, clang::Sema::TDK_ConstraintsNotSatisfied, clang::Sema::TDK_CUDATargetMismatch, clang::Sema::TDK_DeducedMismatch, clang::Sema::TDK_DeducedMismatchNested, clang::Sema::TDK_Incomplete, clang::Sema::TDK_IncompletePack, clang::Sema::TDK_Inconsistent, clang::Sema::TDK_InstantiationDepth, clang::Sema::TDK_Invalid, clang::Sema::TDK_InvalidExplicitArguments, clang::Sema::TDK_MiscellaneousDeductionFailure, clang::Sema::TDK_NonDeducedMismatch, clang::Sema::TDK_NonDependentConversionFailure, clang::Sema::TDK_SubstitutionFailure, clang::Sema::TDK_Success, clang::Sema::TDK_TooFewArguments, clang::Sema::TDK_TooManyArguments, and clang::Sema::TDK_Underqualified.
Referenced by DiagnoseBadDeduction().
PartialDiagnosticAt * DeductionFailureInfo::getSFINAEDiagnostic | ( | ) |
Retrieve the diagnostic which caused this deduction failure, if any.
Definition at line 760 of file SemaOverload.cpp.
References Diagnostic, and HasDiagnostic.
Referenced by Destroy(), and DiagnoseBadDeduction().
TemplateArgumentList * DeductionFailureInfo::getTemplateArgumentList | ( | ) |
Retrieve the template argument list associated with this deduction failure, if any.
Definition at line 800 of file SemaOverload.cpp.
References Data, Result, clang::Sema::TDK_AlreadyDiagnosed, clang::Sema::TDK_ConstraintsNotSatisfied, clang::Sema::TDK_CUDATargetMismatch, clang::Sema::TDK_DeducedMismatch, clang::Sema::TDK_DeducedMismatchNested, clang::Sema::TDK_Incomplete, clang::Sema::TDK_IncompletePack, clang::Sema::TDK_Inconsistent, clang::Sema::TDK_InstantiationDepth, clang::Sema::TDK_Invalid, clang::Sema::TDK_InvalidExplicitArguments, clang::Sema::TDK_MiscellaneousDeductionFailure, clang::Sema::TDK_NonDeducedMismatch, clang::Sema::TDK_NonDependentConversionFailure, clang::Sema::TDK_SubstitutionFailure, clang::Sema::TDK_Success, clang::Sema::TDK_TooFewArguments, clang::Sema::TDK_TooManyArguments, and clang::Sema::TDK_Underqualified.
Referenced by DiagnoseBadDeduction().
TemplateParameter DeductionFailureInfo::getTemplateParameter | ( | ) |
Retrieve the template parameter this deduction failure refers to, if any.
Definition at line 766 of file SemaOverload.cpp.
References Data, Result, clang::Sema::TDK_AlreadyDiagnosed, clang::Sema::TDK_ConstraintsNotSatisfied, clang::Sema::TDK_CUDATargetMismatch, clang::Sema::TDK_DeducedMismatch, clang::Sema::TDK_DeducedMismatchNested, clang::Sema::TDK_Incomplete, clang::Sema::TDK_IncompletePack, clang::Sema::TDK_Inconsistent, clang::Sema::TDK_InstantiationDepth, clang::Sema::TDK_Invalid, clang::Sema::TDK_InvalidExplicitArguments, clang::Sema::TDK_MiscellaneousDeductionFailure, clang::Sema::TDK_NonDeducedMismatch, clang::Sema::TDK_NonDependentConversionFailure, clang::Sema::TDK_SubstitutionFailure, clang::Sema::TDK_Success, clang::Sema::TDK_TooFewArguments, clang::Sema::TDK_TooManyArguments, and clang::Sema::TDK_Underqualified.
Referenced by DiagnoseBadDeduction().
void* clang::DeductionFailureInfo::Data |
Opaque pointer containing additional data about this deduction failure.
Definition at line 267 of file TemplateDeduction.h.
Referenced by clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddSurrogateCandidate(), Destroy(), DiagnoseBadDeduction(), DiagnoseFailedEnableIfAttr(), getCallArgIndex(), getFirstArg(), getSecondArg(), getTemplateArgumentList(), and getTemplateParameter().
char clang::DeductionFailureInfo::Diagnostic[sizeof(PartialDiagnosticAt)] |
A diagnostic indicating why deduction failed.
Definition at line 270 of file TemplateDeduction.h.
Referenced by getSFINAEDiagnostic().
unsigned clang::DeductionFailureInfo::HasDiagnostic |
Indicates whether a diagnostic is stored in Diagnostic.
Definition at line 263 of file TemplateDeduction.h.
Referenced by Destroy(), and getSFINAEDiagnostic().
unsigned clang::DeductionFailureInfo::Result |
A Sema::TemplateDeductionResult.
Definition at line 260 of file TemplateDeduction.h.
Referenced by CheckArityMismatch(), Destroy(), DiagnoseBadDeduction(), getCallArgIndex(), getFirstArg(), getSecondArg(), getTemplateArgumentList(), getTemplateParameter(), and RankDeductionFailure().