|
clang 22.0.0git
|
Provides information about an attempted template argument deduction, whose success or failure was described by a TemplateDeductionResult value. More...
#include "clang/Sema/TemplateDeduction.h"
Public Types | |
| enum | ForBaseTag { ForBase } |
| using | diag_iterator = SmallVectorImpl<PartialDiagnosticAt>::const_iterator |
| Iterator over the set of suppressed diagnostics. | |
Public Member Functions | |
| TemplateDeductionInfo (SourceLocation Loc, unsigned DeducedDepth=0) | |
| TemplateDeductionInfo (const TemplateDeductionInfo &)=delete | |
| TemplateDeductionInfo & | operator= (const TemplateDeductionInfo &)=delete |
| TemplateDeductionInfo (ForBaseTag, const TemplateDeductionInfo &Info) | |
| Create temporary template deduction info for speculatively deducing against a base class of an argument's type. | |
| SourceLocation | getLocation () const |
| Returns the location at which template argument is occurring. | |
| unsigned | getDeducedDepth () const |
| The depth of template parameters for which deduction is being performed. | |
| bool | hasStrictPackMatch () const |
| void | setStrictPackMatch () |
| unsigned | getNumExplicitArgs () const |
| Get the number of explicitly-specified arguments. | |
| TemplateArgumentList * | takeSugared () |
| Take ownership of the deduced template argument lists. | |
| TemplateArgumentList * | takeCanonical () |
| void | takeSFINAEDiagnostic (PartialDiagnosticAt &PD) |
| Take ownership of the SFINAE diagnostic. | |
| void | clearSFINAEDiagnostic () |
| Discard any SFINAE diagnostics. | |
| const PartialDiagnosticAt & | peekSFINAEDiagnostic () const |
| Peek at the SFINAE diagnostic. | |
| void | setExplicitArgs (TemplateArgumentList *NewDeducedSugared, TemplateArgumentList *NewDeducedCanonical) |
| Provide an initial template argument list that contains the explicitly-specified arguments. | |
| void | reset (TemplateArgumentList *NewDeducedSugared, TemplateArgumentList *NewDeducedCanonical) |
| Provide a new template argument list that contains the results of template argument deduction. | |
| bool | hasSFINAEDiagnostic () const |
| Is a SFINAE diagnostic available? | |
| void | addSFINAEDiagnostic (SourceLocation Loc, PartialDiagnostic PD) |
| Set the diagnostic which caused the SFINAE failure. | |
| void | addSuppressedDiagnostic (SourceLocation Loc, PartialDiagnostic PD) |
| Add a new diagnostic to the set of diagnostics. | |
| diag_iterator | diag_begin () const |
| Returns an iterator at the beginning of the sequence of suppressed diagnostics. | |
| diag_iterator | diag_end () const |
| Returns an iterator at the end of the sequence of suppressed diagnostics. | |
Public Attributes | |
| TemplateParameter | Param |
| The template parameter to which a template argument deduction failure refers. | |
| TemplateArgument | FirstArg |
| The first template argument to which the template argument deduction failure refers. | |
| TemplateArgument | SecondArg |
| The second template argument to which the template argument deduction failure refers. | |
| unsigned | CallArgIndex = 0 |
| The index of the function argument that caused a deduction failure. | |
| bool | AggregateDeductionCandidateHasMismatchedArity = false |
| SmallVector< DeducedPack *, 8 > | PendingDeducedPacks |
| Information on packs that we're currently expanding. | |
| ConstraintSatisfaction | AssociatedConstraintsSatisfaction |
| The constraint satisfaction details resulting from the associated constraints satisfaction tests. | |
Provides information about an attempted template argument deduction, whose success or failure was described by a TemplateDeductionResult value.
Definition at line 43 of file TemplateDeduction.h.
| using clang::sema::TemplateDeductionInfo::diag_iterator = SmallVectorImpl<PartialDiagnosticAt>::const_iterator |
Iterator over the set of suppressed diagnostics.
Definition at line 178 of file TemplateDeduction.h.
| Enumerator | |
|---|---|
| ForBase | |
Definition at line 76 of file TemplateDeduction.h.
|
inline |
Definition at line 71 of file TemplateDeduction.h.
Referenced by operator=(), TemplateDeductionInfo(), and TemplateDeductionInfo().
|
delete |
References TemplateDeductionInfo().
|
inline |
Create temporary template deduction info for speculatively deducing against a base class of an argument's type.
Definition at line 79 of file TemplateDeduction.h.
References TemplateDeductionInfo().
|
inline |
Set the diagnostic which caused the SFINAE failure.
Definition at line 160 of file TemplateDeduction.h.
|
inline |
Add a new diagnostic to the set of diagnostics.
Definition at line 170 of file TemplateDeduction.h.
|
inline |
Discard any SFINAE diagnostics.
Definition at line 125 of file TemplateDeduction.h.
Referenced by clang::Sema::isMoreSpecializedThanPrimary(), clang::Sema::isMoreSpecializedThanPrimary(), and takeSFINAEDiagnostic().
|
inline |
Returns an iterator at the beginning of the sequence of suppressed diagnostics.
Definition at line 182 of file TemplateDeduction.h.
Referenced by clang::Sema::FinishTemplateArgumentDeduction().
|
inline |
Returns an iterator at the end of the sequence of suppressed diagnostics.
Definition at line 186 of file TemplateDeduction.h.
Referenced by clang::Sema::FinishTemplateArgumentDeduction().
|
inline |
The depth of template parameters for which deduction is being performed.
Definition at line 91 of file TemplateDeduction.h.
Referenced by clang::Sema::DeduceAutoType(), DeduceNonTypeTemplateArgument(), DeduceTemplateArguments(), DeduceTemplateArgumentsByTypeMatch(), and getDeducedNTTParameterFromExpr().
|
inline |
Returns the location at which template argument is occurring.
Definition at line 85 of file TemplateDeduction.h.
Referenced by CheckDeducedArgumentConstraints(), CheckOriginalCallArgDeduction(), ConvertDeducedTemplateArgument(), createSubstDiag(), clang::Sema::DeduceAutoType(), clang::Sema::DeduceTemplateArguments(), clang::Sema::DeduceTemplateArguments(), clang::Sema::DeduceTemplateArguments(), DeduceTemplateArguments(), DeduceTemplateArgumentsByTypeMatch(), clang::Sema::DeduceTemplateArgumentsFromType(), clang::Sema::FinishTemplateArgumentDeduction(), instantiateExplicitSpecifierDeferred(), isAtLeastAsSpecializedAs(), isAtLeastAsSpecializedAs(), clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), and clang::Sema::SubstituteExplicitTemplateArguments().
|
inline |
Get the number of explicitly-specified arguments.
Definition at line 100 of file TemplateDeduction.h.
|
inline |
Is a SFINAE diagnostic available?
Definition at line 155 of file TemplateDeduction.h.
Referenced by checkMoreSpecializedThanPrimary(), createSubstDiag(), and clang::MakeDeductionFailureInfo().
|
inline |
Definition at line 95 of file TemplateDeduction.h.
Referenced by AddMethodTemplateCandidateImmediately(), AddTemplateConversionCandidateImmediately(), getPatternForClassTemplateSpecialization(), and clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs().
|
delete |
References TemplateDeductionInfo().
|
inline |
Peek at the SFINAE diagnostic.
Definition at line 131 of file TemplateDeduction.h.
|
inline |
Provide a new template argument list that contains the results of template argument deduction.
Definition at line 148 of file TemplateDeduction.h.
Referenced by CheckDeducedArgumentConstraints(), ConvertDeducedTemplateArguments(), clang::Sema::FinishTemplateArgumentDeduction(), FinishTemplateArgumentDeduction(), and FinishTemplateArgumentDeduction().
|
inline |
Provide an initial template argument list that contains the explicitly-specified arguments.
Definition at line 138 of file TemplateDeduction.h.
References clang::TemplateArgumentList::size().
Referenced by clang::Sema::SubstituteExplicitTemplateArguments().
|
inline |
Definition at line 97 of file TemplateDeduction.h.
Referenced by ConvertDeducedTemplateArgument(), and DeduceTemplateArguments().
|
inline |
Definition at line 110 of file TemplateDeduction.h.
References clang::Result.
Referenced by clang::Sema::FinishTemplateArgumentDeduction(), and getPatternForClassTemplateSpecialization().
|
inline |
Take ownership of the SFINAE diagnostic.
Definition at line 117 of file TemplateDeduction.h.
References clearSFINAEDiagnostic().
Referenced by checkMoreSpecializedThanPrimary(), createSubstDiag(), and clang::MakeDeductionFailureInfo().
|
inline |
Take ownership of the deduced template argument lists.
Definition at line 105 of file TemplateDeduction.h.
References clang::Result.
Referenced by clang::Sema::CheckVarTemplateId(), clang::Sema::FinishTemplateArgumentDeduction(), and clang::MakeDeductionFailureInfo().
Definition at line 252 of file TemplateDeduction.h.
| ConstraintSatisfaction clang::sema::TemplateDeductionInfo::AssociatedConstraintsSatisfaction |
The constraint satisfaction details resulting from the associated constraints satisfaction tests.
Definition at line 261 of file TemplateDeduction.h.
Referenced by CheckDeducedArgumentConstraints(), clang::Sema::FinishTemplateArgumentDeduction(), and clang::MakeDeductionFailureInfo().
| unsigned clang::sema::TemplateDeductionInfo::CallArgIndex = 0 |
The index of the function argument that caused a deduction failure.
TDK_DeducedMismatch: this is the index of the argument that had a different argument type from its substituted parameter type.
Definition at line 245 of file TemplateDeduction.h.
Referenced by CheckOriginalCallArgDeduction(), and clang::MakeDeductionFailureInfo().
| TemplateArgument clang::sema::TemplateDeductionInfo::FirstArg |
The first template argument to which the template argument deduction failure refers.
Depending on the result of the template argument deduction, this template argument may have different meanings:
TDK_IncompletePack: this is the number of arguments we deduced for the pack.
TDK_Inconsistent: this argument is the first value deduced for the corresponding template parameter.
TDK_SubstitutionFailure: this argument is the template argument we were instantiating when we encountered an error.
TDK_DeducedMismatch: this is the parameter type, after substituting deduced arguments.
TDK_NonDeducedMismatch: this is the component of the 'parameter' of the deduction, directly provided in the source code.
Definition at line 224 of file TemplateDeduction.h.
Referenced by CheckOriginalCallArgDeduction(), clang::Sema::DeduceAutoType(), clang::Sema::DeduceFunctionTypeFromReturnExpr(), DeduceNonTypeTemplateArgument(), clang::Sema::DeduceTemplateArguments(), DeduceTemplateArguments(), DeduceTemplateArguments(), DeduceTemplateArgumentsByTypeMatch(), DeduceTemplateSpecArguments(), FinishTemplateArgumentDeduction(), clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), and clang::MakeDeductionFailureInfo().
| TemplateParameter clang::sema::TemplateDeductionInfo::Param |
The template parameter to which a template argument deduction failure refers.
Depending on the result of template argument deduction, this template parameter may have different meanings:
TDK_Incomplete: this is the first template parameter whose corresponding template argument was not deduced.
TDK_IncompletePack: this is the expanded parameter pack for which we deduced too few arguments.
TDK_Inconsistent: this is the template parameter for which two different template argument values were deduced.
Definition at line 202 of file TemplateDeduction.h.
Referenced by ConvertDeducedTemplateArguments(), DeduceNonTypeTemplateArgument(), DeduceTemplateArguments(), DeduceTemplateArgumentsByTypeMatch(), FinishTemplateArgumentDeduction(), clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), clang::MakeDeductionFailureInfo(), and clang::Sema::SubstituteExplicitTemplateArguments().
| SmallVector<DeducedPack *, 8> clang::sema::TemplateDeductionInfo::PendingDeducedPacks |
Information on packs that we're currently expanding.
FIXME: This should be kept internal to SemaTemplateDeduction.
Definition at line 257 of file TemplateDeduction.h.
| TemplateArgument clang::sema::TemplateDeductionInfo::SecondArg |
The second template argument to which the template argument deduction failure refers.
TDK_Inconsistent: this argument is the second value deduced for the corresponding template parameter.
TDK_DeducedMismatch: this is the (adjusted) call argument type.
TDK_NonDeducedMismatch: this is the mismatching component of the 'argument' of the deduction, from which we are deducing arguments.
FIXME: Finish documenting this.
Definition at line 238 of file TemplateDeduction.h.
Referenced by CheckOriginalCallArgDeduction(), clang::Sema::DeduceAutoType(), clang::Sema::DeduceFunctionTypeFromReturnExpr(), DeduceNonTypeTemplateArgument(), clang::Sema::DeduceTemplateArguments(), DeduceTemplateArguments(), DeduceTemplateArguments(), DeduceTemplateArgumentsByTypeMatch(), DeduceTemplateSpecArguments(), FinishTemplateArgumentDeduction(), clang::Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs(), and clang::MakeDeductionFailureInfo().