clang  3.9.0
Public Types | Public Member Functions | List of all members
clang::OverloadCandidateSet Class Reference

OverloadCandidateSet - A set of overload candidates, used in C++ overload resolution (C++ 13.3). More...

#include <Overload.h>

Public Types

enum  CandidateSetKind { CSK_Normal, CSK_Operator }
 
typedef SmallVectorImpl
< OverloadCandidate >
::iterator 
iterator
 

Public Member Functions

 OverloadCandidateSet (SourceLocation Loc, CandidateSetKind CSK)
 
 ~OverloadCandidateSet ()
 
SourceLocation getLocation () const
 
CandidateSetKind getKind () const
 
bool isNewCandidate (Decl *F)
 Determine when this overload candidate will be new to the overload set. More...
 
void clear ()
 Clear out all of the candidates. More...
 
iterator begin ()
 
iterator end ()
 
size_t size () const
 
bool empty () const
 
OverloadCandidateaddCandidate (unsigned NumConversions=0)
 Add a new candidate with NumConversions conversion sequence slots to the overload set. More...
 
OverloadingResult BestViableFunction (Sema &S, SourceLocation Loc, OverloadCandidateSet::iterator &Best, bool UserDefinedConversion=false)
 Find the best viable function on this overload set, if it exists. More...
 
void NoteCandidates (Sema &S, OverloadCandidateDisplayKind OCD, ArrayRef< Expr * > Args, StringRef Opc="", SourceLocation Loc=SourceLocation())
 PrintOverloadCandidates - When overload resolution fails, prints diagnostic messages containing the candidates in the candidate set. More...
 

Detailed Description

OverloadCandidateSet - A set of overload candidates, used in C++ overload resolution (C++ 13.3).

Definition at line 701 of file Overload.h.

Member Typedef Documentation

Definition at line 750 of file Overload.h.

Member Enumeration Documentation

Enumerator
CSK_Normal 

Normal lookup.

CSK_Operator 

Lookup for candidates for a call using operator syntax.

Candidates that have no parameters of class type will be skipped unless there is a parameter of (reference to) enum type and the corresponding argument is of the same enum type.

Definition at line 703 of file Overload.h.

Constructor & Destructor Documentation

clang::OverloadCandidateSet::OverloadCandidateSet ( SourceLocation  Loc,
CandidateSetKind  CSK 
)
inline

Definition at line 734 of file Overload.h.

clang::OverloadCandidateSet::~OverloadCandidateSet ( )
inline

Definition at line 736 of file Overload.h.

Member Function Documentation

OverloadCandidate& clang::OverloadCandidateSet::addCandidate ( unsigned  NumConversions = 0)
inline
iterator clang::OverloadCandidateSet::begin ( )
inline
OverloadingResult OverloadCandidateSet::BestViableFunction ( Sema S,
SourceLocation  Loc,
OverloadCandidateSet::iterator Best,
bool  UserDefinedConversion = false 
)

Find the best viable function on this overload set, if it exists.

Computes the best viable function (C++ 13.3.3) within an overload candidate set.

Parameters
LocThe location of the function name (or operator symbol) for which overload resolution occurs.
BestIf overload resolution was successful or found a deleted function, Best points to the candidate function found.
Returns
The result of overload resolution.

Definition at line 8770 of file SemaOverload.cpp.

References begin(), clang::Sema::CFP_SameSide, clang::Sema::CFP_WrongSide, clang::Sema::CurContext, clang::Sema::diagnoseEquivalentInternalLinkageDeclarations(), end(), clang::OverloadCandidate::Function, clang::Sema::getLangOpts(), clang::Sema::IdentifyCUDAPreference(), clang::isBetterOverloadCandidate(), clang::Sema::isEquivalentInternalLinkageDeclaration(), clang::Sema::isFunctionConsideredUnavailable(), clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, and clang::OverloadCandidate::Viable.

Referenced by clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildForRangeBeginEndCall(), clang::Sema::BuildOverloadedArrowExpr(), clang::Sema::BuildOverloadedCallExpr(), clang::Sema::buildOverloadedCallSet(), CheckCXX98CompatAccessibleCopy(), CopyObject(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), clang::InitializationSequence::Diagnose(), clang::Sema::FindAllocationOverload(), FindConditionalOverload(), IsInitializerListConstructorConversion(), IsUserDefinedConversion(), clang::Sema::PerformContextualImplicitConversion(), ResolveConstructorOverload(), TryRefInitWithConversionFunction(), TryTypoCorrectionForCall(), and TryUserDefinedConversion().

void OverloadCandidateSet::clear ( )
bool clang::OverloadCandidateSet::empty ( ) const
inline
iterator clang::OverloadCandidateSet::end ( )
inline
CandidateSetKind clang::OverloadCandidateSet::getKind ( ) const
inline

Definition at line 739 of file Overload.h.

Referenced by clang::Sema::AddOverloadCandidate().

SourceLocation clang::OverloadCandidateSet::getLocation ( ) const
inline
bool clang::OverloadCandidateSet::isNewCandidate ( Decl F)
inline
void OverloadCandidateSet::NoteCandidates ( Sema S,
OverloadCandidateDisplayKind  OCD,
ArrayRef< Expr * >  Args,
StringRef  Opc = "",
SourceLocation  OpLoc = SourceLocation() 
)
size_t clang::OverloadCandidateSet::size ( ) const
inline

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