clang 22.0.0git
clang::OverloadCandidate Struct Reference

OverloadCandidate - A single candidate in an overload set (C++ 13.3). More...

#include "clang/Sema/Overload.h"

Public Member Functions

OverloadCandidateRewriteKind getRewriteKind () const
 Get RewriteKind value in OverloadCandidateRewriteKind type (This function is to workaround the spurious GCC bitfield enum warning)
bool isReversed () const
bool hasAmbiguousConversion () const
 hasAmbiguousConversion - Returns whether this overload candidate requires an ambiguous conversion or not.
bool isPerfectMatch (const ASTContext &Ctx) const
bool TryToFixBadConversion (unsigned Idx, Sema &S)
unsigned getNumParams () const
bool NotValidBecauseConstraintExprHasError () const

Public Attributes

FunctionDeclFunction
 Function - The actual function that this candidate represents.
DeclAccessPair FoundDecl
 FoundDecl - The original declaration that was looked up / invented / otherwise found, together with its access.
QualType BuiltinParamTypes [3]
 BuiltinParamTypes - Provides the parameter types of a built-in overload candidate.
CXXConversionDeclSurrogate
 Surrogate - The conversion function for which this candidate is a surrogate, but only if IsSurrogate is true.
ConversionSequenceList Conversions
 The conversion sequences used to convert the function arguments to the function parameters.
ConversionFixItGenerator Fix
 The FixIt hints which can be used to fix the Bad candidate.
unsigned Viable: 1
 Viable - True to indicate that this overload candidate is viable.
unsigned Best: 1
 Whether this candidate is the best viable function, or tied for being the best viable function.
unsigned IsSurrogate: 1
 IsSurrogate - True to indicate that this candidate is a surrogate for a conversion to a function pointer or reference (C++ [over.call.object]).
unsigned IgnoreObjectArgument: 1
 IgnoreObjectArgument - True to indicate that the first argument's conversion, which for this function represents the implicit object argument, should be ignored.
unsigned TookAddressOfOverload: 1
unsigned StrictPackMatch: 1
 Have we matched any packs on the parameter side, versus any non-packs on the argument side, in a context where the opposite matching is also allowed?
unsigned IsADLCandidate: 1
 True if the candidate was found using ADL.
unsigned HasFinalConversion: 1
 Whether FinalConversion has been set.
unsigned RewriteKind: 2
 Whether this is a rewritten candidate, and if so, of what kind?
unsigned FailureKind: 8
 FailureKind - The reason why this candidate is not viable.
unsigned ExplicitCallArguments
 The number of call arguments that were explicitly provided, to be used while performing partial ordering of function templates.
union { 
   DeductionFailureInfo   DeductionFailure 
   StandardConversionSequence   FinalConversion 
 FinalConversion - For a conversion function (where Function is a CXXConversionDecl), the standard conversion that occurs after the call to the overload candidate to convert the result of calling the conversion function to the required type. More...
}; 

Friends

class OverloadCandidateSet

Detailed Description

OverloadCandidate - A single candidate in an overload set (C++ 13.3).

Definition at line 926 of file Overload.h.

Member Function Documentation

◆ getNumParams()

unsigned clang::OverloadCandidate::getNumParams ( ) const
inline

◆ getRewriteKind()

OverloadCandidateRewriteKind clang::OverloadCandidate::getRewriteKind ( ) const
inline

Get RewriteKind value in OverloadCandidateRewriteKind type (This function is to workaround the spurious GCC bitfield enum warning)

Definition at line 1026 of file Overload.h.

References RewriteKind.

Referenced by DiagnoseBadConversion(), DiagnoseBadTarget(), isReversed(), and NoteFunctionCandidate().

◆ hasAmbiguousConversion()

bool clang::OverloadCandidate::hasAmbiguousConversion ( ) const
inline

hasAmbiguousConversion - Returns whether this overload candidate requires an ambiguous conversion or not.

Definition at line 1034 of file Overload.h.

References clang::C, and Conversions.

◆ isPerfectMatch()

bool clang::OverloadCandidate::isPerfectMatch ( const ASTContext & Ctx) const
inline

Definition at line 1044 of file Overload.h.

References clang::C, Conversions, FinalConversion, HasFinalConversion, and Viable.

◆ isReversed()

bool clang::OverloadCandidate::isReversed ( ) const
inline

◆ NotValidBecauseConstraintExprHasError()

bool OverloadCandidate::NotValidBecauseConstraintExprHasError ( ) const

◆ TryToFixBadConversion()

bool clang::OverloadCandidate::TryToFixBadConversion ( unsigned Idx,
Sema & S )
inline

Definition at line 1056 of file Overload.h.

References Conversions, and Fix.

Referenced by CompleteNonViableCandidate().

◆ OverloadCandidateSet

Member Data Documentation

◆ [union]

union { ... } clang::OverloadCandidate

◆ Best

unsigned clang::OverloadCandidate::Best

Whether this candidate is the best viable function, or tied for being the best viable function.

For an ambiguous overload resolution, indicates whether this candidate was part of the ambiguity kernel: the minimal non-empty set of viable candidates such that all elements of the ambiguity kernel are better than all viable candidates not in the ambiguity kernel.

Definition at line 966 of file Overload.h.

Referenced by clang::OverloadCandidateSet::CompleteCandidates().

◆ BuiltinParamTypes

QualType clang::OverloadCandidate::BuiltinParamTypes[3]

BuiltinParamTypes - Provides the parameter types of a built-in overload candidate.

Only valid when Function is NULL.

Definition at line 940 of file Overload.h.

Referenced by clang::Sema::AddBuiltinCandidate(), CompleteNonViableCandidate(), and NoteBuiltinOperatorCandidate().

◆ Conversions

◆ DeductionFailure

◆ ExplicitCallArguments

unsigned clang::OverloadCandidate::ExplicitCallArguments

◆ FailureKind

◆ FinalConversion

StandardConversionSequence clang::OverloadCandidate::FinalConversion

FinalConversion - For a conversion function (where Function is a CXXConversionDecl), the standard conversion that occurs after the call to the overload candidate to convert the result of calling the conversion function to the required type.

Definition at line 1021 of file Overload.h.

Referenced by clang::Sema::AddConversionCandidate(), clang::isBetterOverloadCandidate(), and isPerfectMatch().

◆ Fix

ConversionFixItGenerator clang::OverloadCandidate::Fix

The FixIt hints which can be used to fix the Bad candidate.

Definition at line 952 of file Overload.h.

Referenced by CompleteNonViableCandidate(), DiagnoseBadConversion(), and TryToFixBadConversion().

◆ FoundDecl

◆ Function

◆ HasFinalConversion

unsigned clang::OverloadCandidate::HasFinalConversion

Whether FinalConversion has been set.

Definition at line 999 of file Overload.h.

Referenced by clang::Sema::AddConversionCandidate(), clang::isBetterOverloadCandidate(), isPerfectMatch(), and OverloadCandidateSet.

◆ IgnoreObjectArgument

unsigned clang::OverloadCandidate::IgnoreObjectArgument

IgnoreObjectArgument - True to indicate that the first argument's conversion, which for this function represents the implicit object argument, should be ignored.

This will be true when the candidate is a static member function (where the implicit object argument is just a placeholder) or a non-static member function when the call doesn't have an object argument.

Definition at line 982 of file Overload.h.

Referenced by clang::Sema::AddMethodCandidate(), AddMethodTemplateCandidateImmediately(), CompleteNonViableCandidate(), clang::isBetterOverloadCandidate(), NoteFunctionCandidate(), and OverloadCandidateSet.

◆ IsADLCandidate

unsigned clang::OverloadCandidate::IsADLCandidate

True if the candidate was found using ADL.

Definition at line 995 of file Overload.h.

Referenced by clang::Sema::AddOverloadCandidate(), and OverloadCandidateSet.

◆ IsSurrogate

unsigned clang::OverloadCandidate::IsSurrogate

IsSurrogate - True to indicate that this candidate is a surrogate for a conversion to a function pointer or reference (C++ [over.call.object]).

Definition at line 972 of file Overload.h.

Referenced by AddMethodTemplateCandidateImmediately(), clang::Sema::AddSurrogateCandidate(), clang::OverloadCandidateSet::CompleteCandidates(), CompleteNonViableCandidate(), GetLocationForCandidate(), getNumParams(), clang::OverloadCandidateSet::NoteCandidates(), and OverloadCandidateSet.

◆ RewriteKind

unsigned clang::OverloadCandidate::RewriteKind

◆ StrictPackMatch

unsigned clang::OverloadCandidate::StrictPackMatch

Have we matched any packs on the parameter side, versus any non-packs on the argument side, in a context where the opposite matching is also allowed?

Definition at line 991 of file Overload.h.

Referenced by clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), clang::Sema::AddOverloadCandidate(), clang::isBetterOverloadCandidate(), and OverloadCandidateSet.

◆ Surrogate

CXXConversionDecl* clang::OverloadCandidate::Surrogate

Surrogate - The conversion function for which this candidate is a surrogate, but only if IsSurrogate is true.

Definition at line 944 of file Overload.h.

Referenced by clang::Sema::AddSurrogateCandidate(), CompleteNonViableCandidate(), GetLocationForCandidate(), getNumParams(), and NoteSurrogateCandidate().

◆ TookAddressOfOverload

◆ Viable


The documentation for this struct was generated from the following files: