clang  10.0.0git
Public Member Functions | Public Attributes | List of all members
clang::OverloadCandidateSet::OperatorRewriteInfo Struct Reference

Information about operator rewrites to consider when adding operator functions to a candidate set. More...

#include "clang/Sema/Overload.h"

Collaboration diagram for clang::OverloadCandidateSet::OperatorRewriteInfo:
[legend]

Public Member Functions

 OperatorRewriteInfo ()
 
 OperatorRewriteInfo (OverloadedOperatorKind Op, bool AllowRewritten)
 
bool isRewrittenOperator (const FunctionDecl *FD)
 Would use of this function result in a rewrite using a different operator? More...
 
bool isAcceptableCandidate (const FunctionDecl *FD)
 
OverloadCandidateRewriteKind getRewriteKind (const FunctionDecl *FD, OverloadCandidateParamOrder PO)
 Determine the kind of rewrite that should be performed for this candidate. More...
 
bool shouldAddReversed (OverloadedOperatorKind Op)
 Determine whether we should consider looking for and adding reversed candidates for operator Op. More...
 
bool shouldAddReversed (ASTContext &Ctx, const FunctionDecl *FD)
 Determine whether we should add a rewritten candidate for FD with reversed parameter order. More...
 

Public Attributes

OverloadedOperatorKind OriginalOperator
 The original operator as written in the source. More...
 
bool AllowRewrittenCandidates
 Whether we should include rewritten candidates in the overload set. More...
 

Detailed Description

Information about operator rewrites to consider when adding operator functions to a candidate set.

Definition at line 922 of file Overload.h.

Constructor & Destructor Documentation

◆ OperatorRewriteInfo() [1/2]

clang::OverloadCandidateSet::OperatorRewriteInfo::OperatorRewriteInfo ( )
inline

Definition at line 923 of file Overload.h.

◆ OperatorRewriteInfo() [2/2]

clang::OverloadCandidateSet::OperatorRewriteInfo::OperatorRewriteInfo ( OverloadedOperatorKind  Op,
bool  AllowRewritten 
)
inline

Definition at line 925 of file Overload.h.

Member Function Documentation

◆ getRewriteKind()

OverloadCandidateRewriteKind clang::OverloadCandidateSet::OperatorRewriteInfo::getRewriteKind ( const FunctionDecl FD,
OverloadCandidateParamOrder  PO 
)
inline

Determine the kind of rewrite that should be performed for this candidate.

Definition at line 957 of file Overload.h.

References clang::CRK_DifferentOperator, clang::CRK_None, clang::CRK_Reversed, clang::Default, and clang::Reversed.

◆ isAcceptableCandidate()

bool clang::OverloadCandidateSet::OperatorRewriteInfo::isAcceptableCandidate ( const FunctionDecl FD)
inline

◆ isRewrittenOperator()

bool clang::OverloadCandidateSet::OperatorRewriteInfo::isRewrittenOperator ( const FunctionDecl FD)
inline

Would use of this function result in a rewrite using a different operator?

Definition at line 935 of file Overload.h.

References clang::DeclarationName::getCXXOverloadedOperator(), and clang::NamedDecl::getDeclName().

◆ shouldAddReversed() [1/2]

bool OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed ( OverloadedOperatorKind  Op)

Determine whether we should consider looking for and adding reversed candidates for operator Op.

Definition at line 884 of file SemaOverload.cpp.

Referenced by clang::Sema::AddNonMemberOperatorCandidates(), and clang::Sema::LookupOverloadedBinOp().

◆ shouldAddReversed() [2/2]

bool OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed ( ASTContext Ctx,
const FunctionDecl FD 
)

Member Data Documentation

◆ AllowRewrittenCandidates

bool clang::OverloadCandidateSet::OperatorRewriteInfo::AllowRewrittenCandidates

Whether we should include rewritten candidates in the overload set.

Definition at line 931 of file Overload.h.

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

◆ OriginalOperator

OverloadedOperatorKind clang::OverloadCandidateSet::OperatorRewriteInfo::OriginalOperator

The original operator as written in the source.

Definition at line 929 of file Overload.h.


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