clang  6.0.0svn
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 "clang/Sema/Overload.h"

Public Types

enum  CandidateSetKind { CSK_Normal, CSK_Operator, CSK_InitByUserDefinedConversion, CSK_InitByConstructor }
 
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 (CandidateSetKind CSK)
 Clear out all of the candidates. More...
 
iterator begin ()
 
iterator end ()
 
size_t size () const
 
bool empty () const
 
ConversionSequenceList allocateConversionSequences (unsigned NumConversions)
 Allocate storage for conversion sequences for NumConversions conversions. More...
 
OverloadCandidateaddCandidate (unsigned NumConversions=0, ConversionSequenceList Conversions=None)
 Add a new candidate with NumConversions conversion sequence slots to the overload set. More...
 
OverloadingResult BestViableFunction (Sema &S, SourceLocation Loc, OverloadCandidateSet::iterator &Best)
 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(), llvm::function_ref< bool(OverloadCandidate &)> Filter=[](OverloadCandidate &) { return true;})
 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 724 of file Overload.h.

Member Typedef Documentation

◆ iterator

Definition at line 809 of file Overload.h.

Member Enumeration Documentation

◆ CandidateSetKind

Enumerator
CSK_Normal 

Normal lookup.

CSK_Operator 

C++ [over.match.oper]: Lookup of operator function candidates in 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.

CSK_InitByUserDefinedConversion 

C++ [over.match.copy]: Copy-initialization of an object of class type by user-defined conversion.

CSK_InitByConstructor 

C++ [over.match.ctor], [over.match.list] Initialization of an object of class type by constructor, using either a parenthesized or braced list of arguments.

Definition at line 726 of file Overload.h.

Constructor & Destructor Documentation

◆ OverloadCandidateSet()

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

Definition at line 793 of file Overload.h.

◆ ~OverloadCandidateSet()

clang::OverloadCandidateSet::~OverloadCandidateSet ( )
inline

Definition at line 795 of file Overload.h.

Member Function Documentation

◆ addCandidate()

OverloadCandidate& clang::OverloadCandidateSet::addCandidate ( unsigned  NumConversions = 0,
ConversionSequenceList  Conversions = None 
)
inline

Add a new candidate with NumConversions conversion sequence slots to the overload set.

Definition at line 832 of file Overload.h.

References clang::C, and clang::OverloadCandidate::Conversions.

Referenced by clang::Sema::AddBuiltinCandidate(), and clang::Sema::AddMethodCandidate().

◆ allocateConversionSequences()

ConversionSequenceList clang::OverloadCandidateSet::allocateConversionSequences ( unsigned  NumConversions)
inline

Allocate storage for conversion sequences for NumConversions conversions.

Definition at line 819 of file Overload.h.

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

◆ begin()

iterator clang::OverloadCandidateSet::begin ( )
inline

Definition at line 810 of file Overload.h.

Referenced by mergeCandidatesWithResults(), and TryUserDefinedConversion().

◆ BestViableFunction()

OverloadingResult OverloadCandidateSet::BestViableFunction ( Sema S,
SourceLocation  Loc,
OverloadCandidateSet::iterator Best 
)

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 9151 of file SemaOverload.cpp.

Referenced by clang::Sema::buildOverloadedCallSet(), clang::InitializationSequence::Diagnose(), FindConditionalOverload(), and IsInitializerListConstructorConversion().

◆ clear()

void OverloadCandidateSet::clear ( CandidateSetKind  CSK)

◆ empty()

bool clang::OverloadCandidateSet::empty ( ) const
inline

◆ end()

iterator clang::OverloadCandidateSet::end ( )
inline

Definition at line 811 of file Overload.h.

Referenced by mergeCandidatesWithResults(), and TryUserDefinedConversion().

◆ getKind()

CandidateSetKind clang::OverloadCandidateSet::getKind ( ) const
inline

Definition at line 798 of file Overload.h.

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

◆ getLocation()

SourceLocation clang::OverloadCandidateSet::getLocation ( ) const
inline

Definition at line 797 of file Overload.h.

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

◆ isNewCandidate()

bool clang::OverloadCandidateSet::isNewCandidate ( Decl F)
inline

Determine when this overload candidate will be new to the overload set.

Definition at line 802 of file Overload.h.

References clang::CodeGen::clear(), and clang::Decl::getCanonicalDecl().

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

◆ NoteCandidates()

void OverloadCandidateSet::NoteCandidates ( Sema S,
OverloadCandidateDisplayKind  OCD,
ArrayRef< Expr *>  Args,
StringRef  Opc = "",
SourceLocation  OpLoc = SourceLocation(),
llvm::function_ref< bool(OverloadCandidate &)>  Filter = [](OverloadCandidate&) { return true; } 
)

PrintOverloadCandidates - When overload resolution fails, prints diagnostic messages containing the candidates in the candidate set.

Definition at line 10499 of file SemaOverload.cpp.

Referenced by CheckCXX98CompatAccessibleCopy(), CopyObject(), clang::InitializationSequence::Diagnose(), and FinishOverloadedCallExpr().

◆ size()

size_t clang::OverloadCandidateSet::size ( ) const
inline

Definition at line 813 of file Overload.h.

Referenced by CopyObject(), and IsInitializerListConstructorConversion().


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