clang 20.0.0git
|
#include "CheckExprLifetime.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/Type.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticOptions.h"
#include "clang/Basic/OperatorKinds.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Sema/EnterExpressionEvaluationContext.h"
#include "clang/Sema/Initialization.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Overload.h"
#include "clang/Sema/SemaCUDA.h"
#include "clang/Sema/SemaObjC.h"
#include "clang/Sema/Template.h"
#include "clang/Sema/TemplateDeduction.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/STLForwardCompat.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdlib>
#include <optional>
Go to the source code of this file.
Typedefs | |
using | AllowedExplicit = Sema::AllowedExplicit |
Enumerations | |
enum | { ft_default , ft_different_class , ft_parameter_arity , ft_parameter_mismatch , ft_return_type , ft_qualifer_mismatch , ft_noexcept } |
enum class | FixedEnumPromotion { None , ToUnderlyingType , ToPromotedUnderlyingType } |
Functions | |
static bool | functionHasPassObjectSizeParams (const FunctionDecl *FD) |
static ExprResult | CreateFunctionRefExpr (Sema &S, FunctionDecl *Fn, NamedDecl *FoundDecl, const Expr *Base, bool HadMultipleCandidates, SourceLocation Loc=SourceLocation(), const DeclarationNameLoc &LocInfo=DeclarationNameLoc()) |
A convenience routine for creating a decayed reference to a function. | |
static bool | IsStandardConversion (Sema &S, Expr *From, QualType ToType, bool InOverloadResolution, StandardConversionSequence &SCS, bool CStyle, bool AllowObjCWritebackConversion) |
IsStandardConversion - Determines whether there is a standard conversion sequence (C++ [conv], C++ [over.ics.scs]) from the expression From to the type ToType. | |
static bool | IsTransparentUnionStandardConversion (Sema &S, Expr *From, QualType &ToType, bool InOverloadResolution, StandardConversionSequence &SCS, bool CStyle) |
static OverloadingResult | IsUserDefinedConversion (Sema &S, Expr *From, QualType ToType, UserDefinedConversionSequence &User, OverloadCandidateSet &CandidateSet, AllowedExplicit AllowExplicit, bool AllowObjCConversionOnExplicit) |
Determines whether there is a user-defined conversion sequence (C++ [over.ics.user]) that converts expression From to the type ToType. | |
static ImplicitConversionSequence::CompareKind | CompareStandardConversionSequences (Sema &S, SourceLocation Loc, const StandardConversionSequence &SCS1, const StandardConversionSequence &SCS2) |
CompareStandardConversionSequences - Compare two standard conversion sequences to determine whether one is better than the other or if they are indistinguishable (C++ 13.3.3.2p3). | |
static ImplicitConversionSequence::CompareKind | CompareQualificationConversions (Sema &S, const StandardConversionSequence &SCS1, const StandardConversionSequence &SCS2) |
CompareQualificationConversions - Compares two standard conversion sequences to determine whether they can be ranked based on their qualification conversions (C++ 13.3.3.2p3 bullet 3). | |
static ImplicitConversionSequence::CompareKind | CompareDerivedToBaseConversions (Sema &S, SourceLocation Loc, const StandardConversionSequence &SCS1, const StandardConversionSequence &SCS2) |
CompareDerivedToBaseConversions - Compares two standard conversion sequences to determine whether they can be ranked based on their various kinds of derived-to-base conversions (C++ [over.ics.rank]p4b3). | |
static const char * | GetImplicitConversionName (ImplicitConversionKind Kind) |
GetImplicitConversionName - Return the name of this kind of implicit conversion. | |
static const Expr * | IgnoreNarrowingConversion (ASTContext &Ctx, const Expr *Converted) |
Skip any implicit casts which could be either part of a narrowing conversion or after one in an implicit conversion. | |
static bool | FunctionsCorrespond (ASTContext &Ctx, const FunctionDecl *X, const FunctionDecl *Y) |
static bool | shouldAddReversedEqEq (Sema &S, SourceLocation OpLoc, Expr *FirstOperand, FunctionDecl *EqFD) |
static bool | checkPlaceholderForOverload (Sema &S, Expr *&E, UnbridgedCastsSet *unbridgedCasts=nullptr) |
checkPlaceholderForOverload - Do any interesting placeholder-like preprocessing on the given expression. | |
static bool | checkArgPlaceholdersForOverload (Sema &S, MultiExprArg Args, UnbridgedCastsSet &unbridged) |
checkArgPlaceholdersForOverload - Check a set of call operands for placeholders. | |
static bool | IsOverloadOrOverrideImpl (Sema &SemaRef, FunctionDecl *New, FunctionDecl *Old, bool UseMemberUsingDeclRules, bool ConsiderCudaAttrs, bool UseOverrideRules=false) |
static ImplicitConversionSequence | TryUserDefinedConversion (Sema &S, Expr *From, QualType ToType, bool SuppressUserConversions, AllowedExplicit AllowExplicit, bool InOverloadResolution, bool CStyle, bool AllowObjCWritebackConversion, bool AllowObjCConversionOnExplicit) |
Tries a user-defined conversion from From to ToType. | |
static ImplicitConversionSequence | TryImplicitConversion (Sema &S, Expr *From, QualType ToType, bool SuppressUserConversions, AllowedExplicit AllowExplicit, bool InOverloadResolution, bool CStyle, bool AllowObjCWritebackConversion, bool AllowObjCConversionOnExplicit) |
TryImplicitConversion - Attempt to perform an implicit conversion from the given expression (Expr) to the given type (ToType). | |
static bool | IsFloatingPointConversion (Sema &S, QualType FromType, QualType ToType) |
Determine whether the conversion from FromType to ToType is a valid floating point conversion. | |
static bool | IsVectorElementConversion (Sema &S, QualType FromType, QualType ToType, ImplicitConversionKind &ICK, Expr *From) |
static bool | IsVectorConversion (Sema &S, QualType FromType, QualType ToType, ImplicitConversionKind &ICK, ImplicitConversionKind &ElConv, Expr *From, bool InOverloadResolution, bool CStyle) |
Determine whether the conversion from FromType to ToType is a valid vector conversion. | |
static bool | tryAtomicConversion (Sema &S, Expr *From, QualType ToType, bool InOverloadResolution, StandardConversionSequence &SCS, bool CStyle) |
static QualType | BuildSimilarlyQualifiedPointerType (const Type *FromPtr, QualType ToPointee, QualType ToType, ASTContext &Context, bool StripObjCLifetime=false) |
BuildSimilarlyQualifiedPointerType - In a pointer conversion from the pointer type FromPtr to a pointer to type ToPointee, with the same type qualifiers as FromPtr has on its pointee type. | |
static bool | isNullPointerConstantForConversion (Expr *Expr, bool InOverloadResolution, ASTContext &Context) |
static QualType | AdoptQualifiers (ASTContext &Context, QualType T, Qualifiers Qs) |
Adopt the given qualifiers for the given type. | |
static const FunctionProtoType * | tryGetFunctionProtoType (QualType FromType) |
Attempts to get the FunctionProtoType from a Type. | |
static bool | isNonTrivialObjCLifetimeConversion (Qualifiers FromQuals, Qualifiers ToQuals) |
Determine whether the lifetime conversion between the two given qualifiers sets is nontrivial. | |
static bool | isQualificationConversionStep (QualType FromType, QualType ToType, bool CStyle, bool IsTopLevel, bool &PreviousToQualsIncludeConst, bool &ObjCLifetimeConversion, const ASTContext &Ctx) |
Perform a single iteration of the loop for checking if a qualification conversion is valid. | |
static bool | isFirstArgumentCompatibleWithType (ASTContext &Context, CXXConstructorDecl *Constructor, QualType Type) |
static OverloadingResult | IsInitializerListConstructorConversion (Sema &S, Expr *From, QualType ToType, CXXRecordDecl *To, UserDefinedConversionSequence &User, OverloadCandidateSet &CandidateSet, bool AllowExplicit) |
static const FunctionType * | getConversionOpReturnTyAsFunction (CXXConversionDecl *Conv) |
static ImplicitConversionSequence::CompareKind | compareConversionFunctions (Sema &S, FunctionDecl *Function1, FunctionDecl *Function2) |
Compare the user-defined conversion functions or constructors of two user-defined conversion sequences to determine whether any ordering is possible. | |
static bool | hasDeprecatedStringLiteralToCharPtrConversion (const ImplicitConversionSequence &ICS) |
static ImplicitConversionSequence::CompareKind | CompareImplicitConversionSequences (Sema &S, SourceLocation Loc, const ImplicitConversionSequence &ICS1, const ImplicitConversionSequence &ICS2) |
CompareImplicitConversionSequences - Compare two implicit conversion sequences to determine whether one is better than the other or if they are indistinguishable (C++ 13.3.3.2). | |
static ImplicitConversionSequence::CompareKind | compareStandardConversionSubsets (ASTContext &Context, const StandardConversionSequence &SCS1, const StandardConversionSequence &SCS2) |
static bool | isBetterReferenceBindingKind (const StandardConversionSequence &SCS1, const StandardConversionSequence &SCS2) |
Determine whether one of the given reference bindings is better than the other based on what kind of bindings they are. | |
static FixedEnumPromotion | getFixedEnumPromtion (Sema &S, const StandardConversionSequence &SCS) |
Returns kind of fixed enum promotion the SCS uses. | |
static QualType | withoutUnaligned (ASTContext &Ctx, QualType T) |
static bool | FindConversionForRefInit (Sema &S, ImplicitConversionSequence &ICS, QualType DeclType, SourceLocation DeclLoc, Expr *Init, QualType T2, bool AllowRvalues, bool AllowExplicit) |
Look for a user-defined conversion to a value reference-compatible with DeclType. | |
static ImplicitConversionSequence | TryReferenceInit (Sema &S, Expr *Init, QualType DeclType, SourceLocation DeclLoc, bool SuppressUserConversions, bool AllowExplicit) |
Compute an implicit conversion sequence for reference initialization. | |
static ImplicitConversionSequence | TryCopyInitialization (Sema &S, Expr *From, QualType ToType, bool SuppressUserConversions, bool InOverloadResolution, bool AllowObjCWritebackConversion, bool AllowExplicit) |
TryCopyInitialization - Try to copy-initialize a value of type ToType from the expression From. | |
static ImplicitConversionSequence | TryListConversion (Sema &S, InitListExpr *From, QualType ToType, bool SuppressUserConversions, bool InOverloadResolution, bool AllowObjCWritebackConversion) |
TryListConversion - Try to copy-initialize a value of type ToType from the initializer list From. | |
static bool | TryCopyInitialization (const CanQualType FromQTy, const CanQualType ToQTy, Sema &S, SourceLocation Loc, ExprValueKind FromVK) |
static ImplicitConversionSequence | TryObjectArgumentInitialization (Sema &S, SourceLocation Loc, QualType FromType, Expr::Classification FromClassification, CXXMethodDecl *Method, const CXXRecordDecl *ActingContext, bool InOverloadResolution=false, QualType ExplicitParameterType=QualType(), bool SuppressUserConversion=false) |
TryObjectArgumentInitialization - Try to initialize the object parameter of the given member function (Method ) from the expression From . | |
static ImplicitConversionSequence | TryContextuallyConvertToBool (Sema &S, Expr *From) |
TryContextuallyConvertToBool - Attempt to contextually convert the expression From to bool (C++0x [conv]p3). | |
static bool | CheckConvertedConstantConversions (Sema &S, StandardConversionSequence &SCS) |
Check that the specified conversion is permitted in a converted constant expression, according to C++11 [expr.const]p3. | |
static ExprResult | BuildConvertedConstantExpression (Sema &S, Expr *From, QualType T, Sema::CCEKind CCE, NamedDecl *Dest, APValue &PreNarrowingValue) |
BuildConvertedConstantExpression - Check that the expression From is a converted constant expression of type T, perform the conversion but does not evaluate the expression. | |
static ExprResult | CheckConvertedConstantExpression (Sema &S, Expr *From, QualType T, APValue &Value, Sema::CCEKind CCE, bool RequireInt, NamedDecl *Dest) |
CheckConvertedConstantExpression - Check that the expression From is a converted constant expression of type T, perform the conversion and produce the converted expression, per C++11 [expr.const]p3. | |
static void | dropPointerConversion (StandardConversionSequence &SCS) |
dropPointerConversions - If the given standard conversion sequence involves any pointer conversions, remove them. | |
static ImplicitConversionSequence | TryContextuallyConvertToObjCPointer (Sema &S, Expr *From) |
TryContextuallyConvertToObjCPointer - Attempt to contextually convert the expression From to an Objective-C pointer type. | |
static QualType | GetExplicitObjectType (Sema &S, const Expr *MemExprE) |
static Expr * | GetExplicitObjectExpr (Sema &S, Expr *Obj, const FunctionDecl *Fun) |
static bool | PrepareExplicitObjectArgument (Sema &S, CXXMethodDecl *Method, Expr *Object, MultiExprArg &Args, SmallVectorImpl< Expr * > &NewArgs) |
static ExprResult | diagnoseAmbiguousConversion (Sema &SemaRef, SourceLocation Loc, Expr *From, Sema::ContextualImplicitConverter &Converter, QualType T, UnresolvedSetImpl &ViableConversions) |
static bool | diagnoseNoViableConversion (Sema &SemaRef, SourceLocation Loc, Expr *&From, Sema::ContextualImplicitConverter &Converter, QualType T, bool HadMultipleCandidates, UnresolvedSetImpl &ExplicitConversions) |
static bool | recordConversion (Sema &SemaRef, SourceLocation Loc, Expr *&From, Sema::ContextualImplicitConverter &Converter, QualType T, bool HadMultipleCandidates, DeclAccessPair &Found) |
static ExprResult | finishContextualImplicitConversion (Sema &SemaRef, SourceLocation Loc, Expr *From, Sema::ContextualImplicitConverter &Converter) |
static void | collectViableConversionCandidates (Sema &SemaRef, Expr *From, QualType ToType, UnresolvedSetImpl &ViableConversions, OverloadCandidateSet &CandidateSet) |
static bool | IsAcceptableNonMemberOperatorCandidate (ASTContext &Context, FunctionDecl *Fn, ArrayRef< Expr * > Args) |
IsAcceptableNonMemberOperatorCandidate - Determine whether Fn is an acceptable non-member overloaded operator for a call whose arguments have types T1 (and, if non-empty, T2). | |
static bool | isNonViableMultiVersionOverload (FunctionDecl *FD) |
static bool | convertArgsForAvailabilityChecks (Sema &S, FunctionDecl *Function, Expr *ThisArg, SourceLocation CallLoc, ArrayRef< Expr * > Args, Sema::SFINAETrap &Trap, bool MissingImplicitThis, Expr *&ConvertedThis, SmallVectorImpl< Expr * > &ConvertedArgs) |
template<typename CheckFn > | |
static bool | diagnoseDiagnoseIfAttrsWith (Sema &S, const NamedDecl *ND, bool ArgDependent, SourceLocation Loc, CheckFn &&IsSuccessful) |
static bool | isNonDependentlyExplicit (FunctionTemplateDecl *FTD) |
Determine whether a given function template has a simple explicit specifier or a non-value-dependent explicit-specification that evaluates to true. | |
static bool | isAllowableExplicitConversion (Sema &S, QualType ConvType, QualType ToType, bool AllowObjCPointerConversion) |
Determine whether this is an allowable conversion from the result of an explicit conversion operator to the expected type, per C++ [over.match.conv]p1 and [over.match.ref]p1. | |
static QualType | AdjustAddressSpaceForBuiltinOperandType (Sema &S, QualType T, Expr *Arg) |
Helper function for adjusting address spaces for the pointer or reference operands of builtin operators depending on the argument. | |
static void | AddBuiltinAssignmentOperatorCandidates (Sema &S, QualType T, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet) |
Helper function for AddBuiltinOperatorCandidates() that adds the volatile- and non-volatile-qualified assignment operators for the given type to the candidate set. | |
static Qualifiers | CollectVRQualifiers (ASTContext &Context, Expr *ArgExpr) |
CollectVRQualifiers - This routine returns Volatile/Restrict qualifiers, if any, found in visible type conversion functions found in ArgExpr's type. | |
static void | forAllQualifierCombinationsImpl (QualifiersAndAtomic Available, QualifiersAndAtomic Applied, llvm::function_ref< void(QualifiersAndAtomic)> Callback) |
static void | forAllQualifierCombinations (QualifiersAndAtomic Quals, llvm::function_ref< void(QualifiersAndAtomic)> Callback) |
static QualType | makeQualifiedLValueReferenceType (QualType Base, QualifiersAndAtomic Quals, Sema &S) |
static Comparison | compareEnableIfAttrs (const Sema &S, const FunctionDecl *Cand1, const FunctionDecl *Cand2) |
Compares the enable_if attributes of two FunctionDecls, for the purposes of overload resolution. | |
static Comparison | isBetterMultiversionCandidate (const OverloadCandidate &Cand1, const OverloadCandidate &Cand2) |
static std::optional< QualType > | getImplicitObjectParamType (ASTContext &Context, const FunctionDecl *F) |
Compute the type of the implicit object parameter for the given function, if any. | |
static bool | allowAmbiguity (ASTContext &Context, const FunctionDecl *F1, const FunctionDecl *F2) |
static bool | sameFunctionParameterTypeLists (Sema &S, const OverloadCandidate &Cand1, const OverloadCandidate &Cand2) |
We're allowed to use constraints partial ordering only if the candidates have the same parameter types: [over.match.best.general]p2.6 F1 and F2 are non-template functions with the same non-object-parameter-type-lists, and F1 is more constrained than F2 [...]. | |
static bool | isFunctionAlwaysEnabled (const ASTContext &Ctx, const FunctionDecl *FD) |
static bool | checkAddressOfFunctionIsAvailable (Sema &S, const FunctionDecl *FD, bool Complain, bool InOverloadResolution, SourceLocation Loc) |
Returns true if we can take the address of the function. | |
static bool | checkAddressOfCandidateIsAvailable (Sema &S, const FunctionDecl *FD) |
static bool | shouldSkipNotingLambdaConversionDecl (const FunctionDecl *Fn) |
static void | MaybeDiagnoseAmbiguousConstraints (Sema &S, ArrayRef< OverloadCandidate > Cands) |
static void | DiagnoseBadConversion (Sema &S, OverloadCandidate *Cand, unsigned I, bool TakingCandidateAddress) |
static bool | CheckArityMismatch (Sema &S, OverloadCandidate *Cand, unsigned NumArgs, bool IsAddressOf=false) |
Additional arity mismatch diagnosis specific to a function overload candidates. | |
static void | DiagnoseArityMismatch (Sema &S, NamedDecl *Found, Decl *D, unsigned NumFormalArgs, bool IsAddressOf=false) |
General arity mismatch diagnosis over a candidate in a candidate set. | |
static void | DiagnoseArityMismatch (Sema &S, OverloadCandidate *Cand, unsigned NumFormalArgs) |
Arity mismatch diagnosis specific to a function overload candidate. | |
static TemplateDecl * | getDescribedTemplate (Decl *Templated) |
static void | DiagnoseBadDeduction (Sema &S, NamedDecl *Found, Decl *Templated, DeductionFailureInfo &DeductionFailure, unsigned NumArgs, bool TakingCandidateAddress) |
Diagnose a failed template-argument deduction. | |
static void | DiagnoseBadDeduction (Sema &S, OverloadCandidate *Cand, unsigned NumArgs, bool TakingCandidateAddress) |
Diagnose a failed template-argument deduction, for function calls. | |
static void | DiagnoseBadTarget (Sema &S, OverloadCandidate *Cand) |
CUDA: diagnose an invalid call across targets. | |
static void | DiagnoseFailedEnableIfAttr (Sema &S, OverloadCandidate *Cand) |
static void | DiagnoseFailedExplicitSpec (Sema &S, OverloadCandidate *Cand) |
static void | NoteImplicitDeductionGuide (Sema &S, FunctionDecl *Fn) |
static void | NoteFunctionCandidate (Sema &S, OverloadCandidate *Cand, unsigned NumArgs, bool TakingCandidateAddress, LangAS CtorDestAS=LangAS::Default) |
Generates a 'note' diagnostic for an overload candidate. | |
static void | NoteSurrogateCandidate (Sema &S, OverloadCandidate *Cand) |
static void | NoteBuiltinOperatorCandidate (Sema &S, StringRef Opc, SourceLocation OpLoc, OverloadCandidate *Cand) |
static void | NoteAmbiguousUserConversions (Sema &S, SourceLocation OpLoc, OverloadCandidate *Cand) |
static SourceLocation | GetLocationForCandidate (const OverloadCandidate *Cand) |
static unsigned | RankDeductionFailure (const DeductionFailureInfo &DFI) |
static void | CompleteNonViableCandidate (Sema &S, OverloadCandidate *Cand, ArrayRef< Expr * > Args, OverloadCandidateSet::CandidateSetKind CSK) |
CompleteNonViableCandidate - Normally, overload resolution only computes up to the first bad conversion. | |
static SourceLocation | GetLocationForCandidate (const TemplateSpecCandidate *Cand) |
static bool | completeFunctionType (Sema &S, FunctionDecl *FD, SourceLocation Loc, bool Complain=true) |
static void | AddOverloadedCallCandidate (Sema &S, DeclAccessPair FoundDecl, TemplateArgumentListInfo *ExplicitTemplateArgs, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool PartialOverloading, bool KnownValid) |
Add a single candidate to the overload set. | |
static bool | canBeDeclaredInNamespace (const DeclarationName &Name) |
Determine whether a declaration with the specified name could be moved into a different namespace. | |
static bool | DiagnoseTwoPhaseLookup (Sema &SemaRef, SourceLocation FnLoc, const CXXScopeSpec &SS, LookupResult &R, OverloadCandidateSet::CandidateSetKind CSK, TemplateArgumentListInfo *ExplicitTemplateArgs, ArrayRef< Expr * > Args, CXXRecordDecl **FoundInClass=nullptr) |
Attempt to recover from an ill-formed use of a non-dependent name in a template, where the non-dependent name was declared after the template was defined. | |
static bool | DiagnoseTwoPhaseOperatorLookup (Sema &SemaRef, OverloadedOperatorKind Op, SourceLocation OpLoc, ArrayRef< Expr * > Args) |
Attempt to recover from ill-formed use of a non-dependent operator in a template, where the non-dependent operator was declared after the template was defined. | |
static ExprResult | BuildRecoveryCallExpr (Sema &SemaRef, Scope *S, Expr *Fn, UnresolvedLookupExpr *ULE, SourceLocation LParenLoc, MutableArrayRef< Expr * > Args, SourceLocation RParenLoc, bool EmptyLookup, bool AllowTypoCorrection) |
Attempts to recover from a call where no functions were found. | |
static QualType | chooseRecoveryType (OverloadCandidateSet &CS, OverloadCandidateSet::iterator *Best) |
static ExprResult | FinishOverloadedCallExpr (Sema &SemaRef, Scope *S, Expr *Fn, UnresolvedLookupExpr *ULE, SourceLocation LParenLoc, MultiExprArg Args, SourceLocation RParenLoc, Expr *ExecConfig, OverloadCandidateSet *CandidateSet, OverloadCandidateSet::iterator *Best, OverloadingResult OverloadResult, bool AllowTypoCorrection) |
FinishOverloadedCallExpr - given an OverloadCandidateSet, builds and returns the completed call expression. | |
static void | markUnaddressableCandidatesUnviable (Sema &S, OverloadCandidateSet &CS) |
static bool | PrepareArgumentsForCallToObjectOfClassType (Sema &S, SmallVectorImpl< Expr * > &MethodArgs, CXXMethodDecl *Method, MultiExprArg Args, SourceLocation LParenLoc) |
using AllowedExplicit = Sema::AllowedExplicit |
Definition at line 52 of file SemaOverload.cpp.
anonymous enum |
Enumerator | |
---|---|
ft_default | |
ft_different_class | |
ft_parameter_arity | |
ft_parameter_mismatch | |
ft_return_type | |
ft_qualifer_mismatch | |
ft_noexcept |
Definition at line 3240 of file SemaOverload.cpp.
|
strong |
Enumerator | |
---|---|
None | |
ToUnderlyingType | |
ToPromotedUnderlyingType |
Definition at line 4366 of file SemaOverload.cpp.
|
static |
Helper function for AddBuiltinOperatorCandidates() that adds the volatile- and non-volatile-qualified assignment operators for the given type to the candidate set.
Definition at line 8762 of file SemaOverload.cpp.
References clang::Sema::AddBuiltinCandidate(), AdjustAddressSpaceForBuiltinOperandType(), clang::Sema::Context, clang::ASTContext::getCanonicalType(), clang::ASTContext::getLValueReferenceType(), clang::ASTContext::getVolatileType(), clang::CanQual< T >::isVolatileQualified(), and clang::T.
|
static |
Add a single candidate to the overload set.
Definition at line 13565 of file SemaOverload.cpp.
References clang::Sema::AddOverloadCandidate(), clang::Sema::AddTemplateOverloadCandidate(), and clang::Func.
Referenced by clang::Sema::AddOverloadedCallCandidates().
Helper function for adjusting address spaces for the pointer or reference operands of builtin operators depending on the argument.
Definition at line 8754 of file SemaOverload.cpp.
References clang::Sema::Context, clang::QualType::getAddressSpace(), clang::ASTContext::getAddrSpaceQualType(), clang::Expr::getType(), and clang::T.
Referenced by AddBuiltinAssignmentOperatorCandidates().
|
static |
Adopt the given qualifiers for the given type.
Definition at line 2963 of file SemaOverload.cpp.
References clang::Qualifiers::compatiblyIncludes(), clang::ASTContext::getQualifiedType(), and clang::T.
Referenced by clang::Sema::isObjCPointerConversion().
|
static |
Definition at line 10255 of file SemaOverload.cpp.
References clang::declaresSameEntity(), clang::First, getImplicitObjectParamType(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::FunctionDecl::getPrimaryTemplate(), clang::ValueDecl::getType(), clang::ASTContext::hasSameUnqualifiedType(), clang::QualType::isNull(), and clang::T.
Referenced by clang::Sema::CreateOverloadedBinOp(), and clang::isBetterOverloadCandidate().
|
static |
BuildConvertedConstantExpression - Check that the expression From is a converted constant expression of type T, perform the conversion but does not evaluate the expression.
Definition at line 6130 of file SemaOverload.cpp.
References clang::Sema::ActOnFinishFullExpr(), clang::UserDefinedConversionSequence::After, clang::ImplicitConversionSequence::AmbiguousConversion, clang::ImplicitConversionSequence::BadConversion, clang::UserDefinedConversionSequence::Before, clang::Sema::CCEK_ArrayBound, clang::Sema::CCEK_ExplicitBool, clang::Sema::CCEK_Noexcept, clang::Sema::CCEK_TemplateArg, CheckConvertedConstantConversions(), checkPlaceholderForOverload(), clang::Sema::Context, clang::Converting, clang::SemaBase::Diag(), clang::Sema::DiagnoseMultipleUserDefinedConversion(), clang::StandardConversionSequence::DirectBinding, clang::ImplicitConversionSequence::EllipsisConversion, clang::ExprError(), clang::APValue::getAsString(), clang::Stmt::getBeginLoc(), clang::Expr::getExprLoc(), clang::ImplicitConversionSequence::getKind(), clang::Sema::getLangOpts(), clang::StandardConversionSequence::getNarrowingKind(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::InitializedEntity::InitializeTemplateParameter(), clang::APValue::isInt(), clang::Type::isIntegralOrEnumerationType(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::NK_Constant_Narrowing, clang::NK_Dependent_Narrowing, clang::NK_Not_Narrowing, clang::NK_Type_Narrowing, clang::NK_Variable_Narrowing, clang::Sema::PerformCopyInitialization(), clang::Sema::PerformImplicitConversion(), clang::StandardConversionSequence::ReferenceBinding, clang::Expr::refersToBitField(), clang::Result, clang::ImplicitConversionSequence::Standard, clang::ImplicitConversionSequence::StandardConversion, clang::ImplicitConversionSequence::StaticObjectArgumentConversion, clang::T, TryContextuallyConvertToBool(), TryCopyInitialization(), clang::ImplicitConversionSequence::UserDefined, and clang::ImplicitConversionSequence::UserDefinedConversion.
Referenced by CheckConvertedConstantExpression().
|
static |
Attempts to recover from a call where no functions were found.
This function will do one of three things:
Definition at line 13827 of file SemaOverload.cpp.
References clang::CXXScopeSpec::Adopt(), clang::LookupResult::begin(), clang::Sema::BuildCallExpr(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildPossibleImplicitMemberExpr(), clang::Sema::BuildTemplateIdExpr(), clang::LookupResult::clear(), clang::OverloadExpr::copyTemplateArgumentsInto(), clang::OverloadCandidateSet::CSK_Normal, clang::Sema::DiagnoseDependentMemberLookup(), clang::Sema::DiagnoseEmptyLookup(), DiagnoseTwoPhaseLookup(), clang::LookupResult::empty(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Sema::getLangOpts(), clang::OverloadExpr::getName(), clang::OverloadExpr::getNameLoc(), clang::OverloadExpr::getQualifierLoc(), clang::OverloadExpr::getTemplateKeywordLoc(), clang::OverloadExpr::hasExplicitTemplateArgs(), clang::LookupResult::isAmbiguous(), clang::Sema::IsBuildingRecoveryCallExpr, clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::SourceLocation::isValid(), clang::Sema::LookupOrdinaryName, and clang::LookupResult::suppressDiagnostics().
Referenced by FinishOverloadedCallExpr().
|
static |
BuildSimilarlyQualifiedPointerType - In a pointer conversion from the pointer type FromPtr to a pointer to type ToPointee, with the same type qualifiers as FromPtr has on its pointee type.
ToType, if non-empty, will be a pointer to ToType that may or may not have the right set of qualifiers on its pointee.
Conversions to 'id' subsume cv-qualifier conversions.
Definition at line 2772 of file SemaOverload.cpp.
References clang::ASTContext::getCanonicalType(), clang::QualType::getLocalQualifiers(), clang::QualType::getLocalUnqualifiedType(), clang::ASTContext::getObjCObjectPointerType(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::Type::getTypeClass(), clang::QualType::getUnqualifiedType(), clang::QualType::isNull(), clang::Type::isObjCIdType(), clang::Type::isObjCQualifiedIdType(), and clang::Qualifiers::removeObjCLifetime().
Referenced by clang::Sema::isObjCPointerConversion(), and clang::Sema::IsPointerConversion().
|
static |
Determine whether a declaration with the specified name could be moved into a different namespace.
Definition at line 13667 of file SemaOverload.cpp.
Referenced by DiagnoseTwoPhaseLookup().
|
static |
Definition at line 11068 of file SemaOverload.cpp.
References checkAddressOfFunctionIsAvailable().
Referenced by DiagnoseBadConversion(), DiagnoseBadDeduction(), NoteFunctionCandidate(), and clang::Sema::NoteOverloadCandidate().
|
static |
Returns true if we can take the address of the function.
Complain | - If true, we'll emit a diagnostic |
InOverloadResolution | - For the purposes of emitting a diagnostic, are we in overload resolution? |
Loc | - The location of the statement we're complaining about. Ignored if we're not complaining, or if we're in overload resolution. |
Definition at line 11006 of file SemaOverload.cpp.
References clang::Sema::CheckFunctionConstraints(), clang::Sema::Context, clang::SemaBase::Diag(), clang::Sema::DiagnoseUnsatisfiedConstraint(), clang::DeclaratorDecl::getBeginLoc(), clang::Decl::getLocation(), clang::FunctionDecl::getPrimaryTemplate(), clang::Sema::getTemplateArgumentBindingsText(), clang::FunctionDecl::getTemplateSpecializationArgs(), clang::DeclaratorDecl::getTrailingRequiresClause(), isFunctionAlwaysEnabled(), clang::ConstraintSatisfaction::IsSatisfied, Loc, P, clang::FunctionDecl::param_begin(), clang::FunctionDecl::param_end(), and clang::FunctionDecl::parameters().
Referenced by checkAddressOfCandidateIsAvailable(), and clang::Sema::resolveAddressOfSingleOverloadCandidate().
|
static |
checkArgPlaceholdersForOverload - Check a set of call operands for placeholders.
Definition at line 1190 of file SemaOverload.cpp.
References checkPlaceholderForOverload().
Referenced by clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::buildOverloadedCallSet(), and clang::Sema::CreateOverloadedArraySubscriptExpr().
|
static |
Additional arity mismatch diagnosis specific to a function overload candidates.
This is not covered by the more general DiagnoseArityMismatch() over a candidate in any candidate set.
Definition at line 11465 of file SemaOverload.cpp.
References clang::DeclarationName::CXXOperatorName, clang::OverloadCandidate::DeductionFailure, clang::OverloadCandidate::FailureKind, clang::OverloadCandidate::Function, clang::DeductionFailureInfo::getResult(), clang::ovl_fail_bad_deduction, clang::ovl_fail_too_few_arguments, clang::ovl_fail_too_many_arguments, clang::TooFewArguments, and clang::TooManyArguments.
Referenced by DiagnoseArityMismatch(), and DiagnoseBadDeduction().
|
static |
Check that the specified conversion is permitted in a converted constant expression, according to C++11 [expr.const]p3.
Return true if the conversion is acceptable.
Definition at line 6058 of file SemaOverload.cpp.
References clang::StandardConversionSequence::getFromType(), clang::StandardConversionSequence::getToType(), clang::ICK_Array_To_Pointer, clang::ICK_Block_Pointer_Conversion, clang::ICK_Boolean_Conversion, clang::ICK_C_Only_Conversion, clang::ICK_Compatible_Conversion, clang::ICK_Complex_Conversion, clang::ICK_Complex_Promotion, clang::ICK_Complex_Real, clang::ICK_Derived_To_Base, clang::ICK_Fixed_Point_Conversion, clang::ICK_Floating_Conversion, clang::ICK_Floating_Integral, clang::ICK_Floating_Promotion, clang::ICK_Function_Conversion, clang::ICK_Function_To_Pointer, clang::ICK_HLSL_Array_RValue, clang::ICK_HLSL_Vector_Splat, clang::ICK_HLSL_Vector_Truncation, clang::ICK_Identity, clang::ICK_Incompatible_Pointer_Conversion, clang::ICK_Integral_Conversion, clang::ICK_Integral_Promotion, clang::ICK_Lvalue_To_Rvalue, clang::ICK_Num_Conversion_Kinds, clang::ICK_Pointer_Conversion, clang::ICK_Pointer_Member, clang::ICK_Qualification, clang::ICK_RVV_Vector_Conversion, clang::ICK_SVE_Vector_Conversion, clang::ICK_TransparentUnionConversion, clang::ICK_Vector_Conversion, clang::ICK_Vector_Splat, clang::ICK_Writeback_Conversion, clang::ICK_Zero_Event_Conversion, clang::ICK_Zero_Queue_Conversion, clang::Type::isBooleanType(), clang::Type::isIntegralOrUnscopedEnumerationType(), clang::Type::isNullPtrType(), and clang::StandardConversionSequence::Second.
Referenced by BuildConvertedConstantExpression().
|
static |
CheckConvertedConstantExpression - Check that the expression From is a converted constant expression of type T, perform the conversion and produce the converted expression, per C++11 [expr.const]p3.
Definition at line 6271 of file SemaOverload.cpp.
References BuildConvertedConstantExpression(), clang::Sema::EvaluateConvertedConstantExpression(), clang::Result, and clang::T.
Referenced by clang::Sema::CheckConvertedConstantExpression().
|
static |
checkPlaceholderForOverload - Do any interesting placeholder-like preprocessing on the given expression.
unbridgedCasts | a collection to which to add unbridged casts; without this, they will be immediately diagnosed as errors |
Return true on unrecoverable error.
Definition at line 1160 of file SemaOverload.cpp.
References clang::Sema::CheckPlaceholderExpr(), E, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsPlaceholderType(), clang::Expr::getType(), and clang::ActionResult< PtrTy, Compress >::isInvalid().
Referenced by clang::Sema::BuildCallToObjectOfClassType(), BuildConvertedConstantExpression(), clang::Sema::BuildOverloadedArrowExpr(), checkArgPlaceholdersForOverload(), clang::Sema::CreateOverloadedBinOp(), clang::Sema::CreateOverloadedUnaryOp(), clang::Sema::PerformContextuallyConvertToBool(), clang::Sema::PerformContextuallyConvertToObjCPointer(), and clang::Sema::PerformImplicitConversion().
|
static |
Definition at line 13984 of file SemaOverload.cpp.
References clang::C, clang::OverloadCandidateSet::end(), clang::Result, and clang::T.
Referenced by clang::Sema::BuildCallToMemberFunction(), and FinishOverloadedCallExpr().
|
static |
Definition at line 6606 of file SemaOverload.cpp.
References clang::Sema::AddConversionCandidate(), clang::Sema::AddTemplateConversionCandidate(), D, clang::Decl::getDeclContext(), and clang::UnresolvedSetImpl::pairs().
Referenced by clang::Sema::PerformContextualImplicitConversion().
|
static |
CollectVRQualifiers - This routine returns Volatile/Restrict qualifiers, if any, found in visible type conversion functions found in ArgExpr's type.
Definition at line 8788 of file SemaOverload.cpp.
References clang::Qualifiers::addRestrict(), clang::Qualifiers::addVolatile(), D, clang::Type::getAs(), clang::ASTContext::getCanonicalType(), clang::RecordType::getDecl(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::CXXRecordDecl::getVisibleConversionFunctions(), clang::CXXRecordDecl::hasDefinition(), clang::Qualifiers::hasRestrict(), clang::Qualifiers::hasVolatile(), clang::QualType::isRestrictQualified(), and clang::QualType::isVolatileQualified().
Referenced by clang::Sema::AddBuiltinOperatorCandidates().
|
static |
Compare the user-defined conversion functions or constructors of two user-defined conversion sequences to determine whether any ordering is possible.
Definition at line 4090 of file SemaOverload.cpp.
References clang::ImplicitConversionSequence::Better, clang::Type::castAs(), clang::Sema::Context, clang::FunctionType::getCallConv(), getConversionOpReturnTyAsFunction(), clang::CXXConversionDecl::getConversionType(), clang::ASTContext::getDefaultCallingConvention(), clang::CXXRecordDecl::getLambdaCallOperator(), clang::Sema::getLangOpts(), clang::CXXMethodDecl::getParent(), clang::ValueDecl::getType(), clang::ImplicitConversionSequence::Indistinguishable, clang::Type::isBlockPointerType(), clang::CXXRecordDecl::isLambda(), and clang::ImplicitConversionSequence::Worse.
Referenced by CompareImplicitConversionSequences(), and clang::isBetterOverloadCandidate().
|
static |
CompareDerivedToBaseConversions - Compares two standard conversion sequences to determine whether they can be ranked based on their various kinds of derived-to-base conversions (C++ [over.ics.rank]p4b3).
As part of these checks, we also look at conversions between Objective-C interface types.
Definition at line 4710 of file SemaOverload.cpp.
References clang::ImplicitConversionSequence::Better, clang::ASTContext::canAssignObjCInterfaces(), clang::Type::castAs(), clang::Sema::Context, clang::StandardConversionSequence::First, clang::ASTContext::getArrayDecayedType(), clang::Type::getAs(), clang::ASTContext::getCanonicalType(), clang::MemberPointerType::getClass(), clang::StandardConversionSequence::getFromType(), clang::ObjCObjectPointerType::getInterfaceDecl(), getPointeeType(), clang::StandardConversionSequence::getToType(), clang::QualType::getUnqualifiedType(), clang::ASTContext::hasSameType(), clang::ASTContext::hasSameUnqualifiedType(), clang::ICK_Array_To_Pointer, clang::ICK_Derived_To_Base, clang::ICK_Pointer_Conversion, clang::ICK_Pointer_Member, clang::ImplicitConversionSequence::Indistinguishable, clang::Sema::IsDerivedFrom(), clang::Type::isMemberPointerType(), clang::ObjCObjectPointerType::isObjCClassType(), clang::ObjCObjectPointerType::isObjCIdType(), clang::Type::isPointerType(), clang::ObjCObjectPointerType::isSpecialized(), Loc, clang::StandardConversionSequence::Second, and clang::ImplicitConversionSequence::Worse.
Referenced by CompareStandardConversionSequences().
|
static |
Compares the enable_if attributes of two FunctionDecls, for the purposes of overload resolution.
Cand1's set of enable_if attributes are said to be "better" than Cand2's iff Cand1's first N enable_if attributes have precisely the same conditions as Cand2's first N enable_if attributes (where N = the number of enable_if attributes on Cand2), and Cand1 has more than N enable_if attributes.
Note that you can have a pair of candidates such that Cand1's enable_if attributes are worse than Cand2's, and Cand2's enable_if attributes are worse than Cand1's.
Definition at line 10144 of file SemaOverload.cpp.
References clang::Sema::getASTContext(), clang::Decl::hasAttr(), and clang::Decl::specific_attrs().
Referenced by clang::isBetterOverloadCandidate().
|
static |
CompareImplicitConversionSequences - Compare two implicit conversion sequences to determine whether one is better than the other or if they are indistinguishable (C++ 13.3.3.2).
Definition at line 4160 of file SemaOverload.cpp.
References clang::UserDefinedConversionSequence::After, clang::ImplicitConversionSequence::Better, compareConversionFunctions(), CompareStandardConversionSequences(), clang::Sema::Context, clang::UserDefinedConversionSequence::ConversionFunction, clang::ASTContext::getAsConstantArrayType(), clang::ImplicitConversionSequence::getInitializerListContainerType(), clang::ImplicitConversionSequence::getKind(), clang::ImplicitConversionSequence::getKindRank(), clang::Sema::getLangOpts(), hasDeprecatedStringLiteralToCharPtrConversion(), clang::ImplicitConversionSequence::hasInitializerListContainerType(), clang::ASTContext::hasSameUnqualifiedType(), clang::ImplicitConversionSequence::Indistinguishable, clang::ImplicitConversionSequence::isBad(), clang::ImplicitConversionSequence::isInitializerListOfIncompleteArray(), clang::ImplicitConversionSequence::isStandard(), clang::Sema::isStdInitializerList(), clang::ImplicitConversionSequence::isUserDefined(), Loc, clang::Result, clang::ImplicitConversionSequence::Standard, clang::ImplicitConversionSequence::UserDefined, and clang::ImplicitConversionSequence::Worse.
Referenced by clang::Sema::CreateOverloadedBinOp(), clang::isBetterOverloadCandidate(), and TryListConversion().
|
static |
CompareQualificationConversions - Compares two standard conversion sequences to determine whether they can be ranked based on their qualification conversions (C++ 13.3.3.2p3 bullet 3).
Definition at line 4641 of file SemaOverload.cpp.
References clang::ImplicitConversionSequence::Better, clang::Sema::Context, clang::StandardConversionSequence::DeprecatedStringLiteralToCharPtr, clang::StandardConversionSequence::First, clang::ASTContext::getCanonicalType(), clang::StandardConversionSequence::getToType(), clang::ASTContext::getUnqualifiedArrayType(), clang::ICK_Qualification, clang::ImplicitConversionSequence::Indistinguishable, clang::Sema::IsQualificationConversion(), clang::Type::isReferenceType(), clang::StandardConversionSequence::QualificationIncludesObjCLifetime, clang::StandardConversionSequence::Second, clang::StandardConversionSequence::Third, and clang::ImplicitConversionSequence::Worse.
Referenced by CompareStandardConversionSequences().
|
static |
CompareStandardConversionSequences - Compare two standard conversion sequences to determine whether one is better than the other or if they are indistinguishable (C++ 13.3.3.2p3).
Definition at line 4398 of file SemaOverload.cpp.
References clang::ASTContext::areCompatibleRVVTypes(), clang::ASTContext::areCompatibleSveTypes(), clang::ASTContext::areCompatibleVectorTypes(), clang::ImplicitConversionSequence::Better, clang::ASTContext::canAssignObjCInterfaces(), CompareDerivedToBaseConversions(), CompareQualificationConversions(), compareStandardConversionSubsets(), clang::Sema::Context, clang::StandardConversionSequence::First, clang::ASTContext::getArrayDecayedType(), clang::Type::getAs(), clang::Sema::getASTContext(), clang::ASTContext::getCanonicalType(), getFixedEnumPromtion(), clang::StandardConversionSequence::getFromType(), clang::Sema::getLangOpts(), clang::Type::getPointeeType(), clang::ASTContext::getQualifiedType(), clang::StandardConversionSequence::getRank(), clang::StandardConversionSequence::getToType(), clang::ASTContext::getTypeSize(), clang::ASTContext::getUnqualifiedArrayType(), clang::QualType::getUnqualifiedType(), clang::ASTContext::hasSameType(), clang::ICK_Array_To_Pointer, clang::ICK_Floating_Integral, clang::ICK_Integral_Conversion, clang::ICK_RVV_Vector_Conversion, clang::ICK_SVE_Vector_Conversion, clang::ICK_Vector_Conversion, clang::ImplicitConversionSequence::Indistinguishable, isBetterReferenceBindingKind(), clang::LangOptions::isCompatibleWithMSVC(), clang::Sema::IsDerivedFrom(), clang::QualType::isMoreQualifiedThan(), clang::StandardConversionSequence::isPointerConversionToBool(), clang::StandardConversionSequence::isPointerConversionToVoidPointer(), Loc, clang::LangOptionsBase::MSVC2019_8, clang::StandardConversionSequence::ObjCLifetimeConversionBinding, clang::StandardConversionSequence::ReferenceBinding, clang::StandardConversionSequence::Second, and clang::ImplicitConversionSequence::Worse.
Referenced by CompareImplicitConversionSequences(), and clang::isBetterOverloadCandidate().
|
static |
Definition at line 4297 of file SemaOverload.cpp.
References clang::ImplicitConversionSequence::Better, clang::StandardConversionSequence::getToType(), clang::ASTContext::hasSameType(), clang::ASTContext::hasSimilarType(), clang::ICK_Identity, clang::ImplicitConversionSequence::Indistinguishable, clang::StandardConversionSequence::isIdentityConversion(), clang::Result, clang::StandardConversionSequence::Second, clang::StandardConversionSequence::Third, and clang::ImplicitConversionSequence::Worse.
Referenced by CompareStandardConversionSequences().
|
static |
Definition at line 12840 of file SemaOverload.cpp.
References clang::Type::castAs(), clang::Sema::DeduceReturnType(), clang::Sema::getLangOpts(), clang::FunctionDecl::getReturnType(), clang::ValueDecl::getType(), clang::Type::isUndeducedType(), clang::isUnresolvedExceptionSpec(), Loc, and clang::Sema::ResolveExceptionSpec().
Referenced by clang::Sema::ResolveSingleFunctionTemplateSpecialization().
|
static |
CompleteNonViableCandidate - Normally, overload resolution only computes up to the first bad conversion.
Produces the FixIt set if possible.
Definition at line 12485 of file SemaOverload.cpp.
References clang::OverloadCandidate::BuiltinParamTypes, clang::Type::castAs(), clang::OverloadCandidate::Conversions, clang::OverloadCandidateSet::CSK_Operator, clang::OverloadCandidate::FailureKind, clang::OverloadCandidate::Fix, clang::OverloadCandidate::Function, clang::Type::getAs(), clang::CXXConversionDecl::getConversionType(), clang::DeclarationName::getCXXOverloadedOperator(), clang::NamedDecl::getDeclName(), clang::Sema::getLangOpts(), clang::QualType::getNonReferenceType(), clang::Type::getPointeeType(), clang::ValueDecl::getType(), clang::OverloadCandidate::IgnoreObjectArgument, clang::OverloadCandidate::isReversed(), clang::OverloadCandidate::IsSurrogate, clang::ovl_fail_bad_conversion, clang::Reversed, clang::ConversionFixItGenerator::setConversionChecker(), clang::OverloadCandidate::Surrogate, TryCopyInitialization(), clang::OverloadCandidate::TryToFixBadConversion(), and clang::OverloadCandidate::Viable.
Referenced by clang::OverloadCandidateSet::CompleteCandidates().
|
static |
Definition at line 7233 of file SemaOverload.cpp.
References clang::Sema::BuildCXXDefaultArgExpr(), clang::Sema::Context, clang::Function, clang::ActionResult< PtrTy, Compress >::get(), clang::Sema::SFINAETrap::hasErrorOccurred(), clang::InitializedEntity::InitializeParameter(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::CXXMethodDecl::isStatic(), P, clang::Sema::PerformCopyInitialization(), and clang::Sema::PerformImplicitObjectArgumentInitialization().
Referenced by clang::Sema::CheckEnableIf().
|
static |
A convenience routine for creating a decayed reference to a function.
Definition at line 61 of file SemaOverload.cpp.
References clang::Sema::Context, clang::Sema::DiagnoseUseOfDecl(), clang::ExprError(), clang::Type::getAs(), clang::ASTContext::getPointerType(), clang::Expr::getType(), clang::Sema::ImpCastExprToType(), clang::isUnresolvedExceptionSpec(), Loc, clang::Sema::MarkDeclRefReferenced(), clang::Sema::ResolveExceptionSpec(), clang::DeclRefExpr::setHadMultipleCandidates(), clang::Expr::setType(), and clang::VK_LValue.
Referenced by clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::BuildCXXMemberCallExpr(), clang::Sema::BuildLiteralOperatorCall(), clang::Sema::BuildOverloadedArrowExpr(), clang::Sema::CreateOverloadedArraySubscriptExpr(), clang::Sema::CreateOverloadedBinOp(), and clang::Sema::CreateOverloadedUnaryOp().
|
static |
Definition at line 6504 of file SemaOverload.cpp.
References clang::Sema::ContextualImplicitConverter::diagnoseAmbiguous(), clang::ExprError(), clang::CXXConversionDecl::getConversionType(), clang::QualType::getNonReferenceType(), clang::Stmt::getSourceRange(), Loc, clang::Sema::ContextualImplicitConverter::noteAmbiguous(), clang::UnresolvedSetImpl::size(), clang::Sema::ContextualImplicitConverter::Suppress, and clang::T.
Referenced by clang::Sema::PerformContextualImplicitConversion().
|
static |
General arity mismatch diagnosis over a candidate in a candidate set.
Definition at line 11497 of file SemaOverload.cpp.
References clang::CRK_None, D, clang::SemaBase::Diag(), and clang::Found.
Referenced by DiagnoseArityMismatch(), DiagnoseBadDeduction(), and NoteFunctionCandidate().
|
static |
Arity mismatch diagnosis specific to a function overload candidate.
Definition at line 11556 of file SemaOverload.cpp.
References CheckArityMismatch(), DiagnoseArityMismatch(), clang::OverloadCandidate::FoundDecl, clang::OverloadCandidate::Function, and clang::OverloadCandidate::TookAddressOfOverload.
|
static |
Definition at line 11225 of file SemaOverload.cpp.
References clang::ImplicitConversionSequence::Bad, checkAddressOfCandidateIsAvailable(), clang::Sema::Context, clang::OverloadCandidate::Conversions, clang::SemaBase::Diag(), E, clang::OverloadCandidate::Fix, clang::OverloadCandidate::FoundDecl, clang::BadConversionSequence::FromExpr, clang::OverloadCandidate::Function, clang::Qualifiers::getAddressSpace(), clang::CanQual< T >::getAs(), clang::Type::getAs(), clang::Sema::getASTContext(), clang::ASTContext::getCanonicalType(), clang::Qualifiers::getCVRQualifiers(), clang::BadConversionSequence::getFromType(), clang::QualType::getNonReferenceType(), clang::Qualifiers::getObjCGCAttr(), clang::Qualifiers::getObjCLifetime(), clang::ObjCObjectPointerType::getPointeeType(), clang::CanQual< T >::getQualifiers(), clang::OverloadCandidate::getRewriteKind(), clang::BadConversionSequence::getToType(), clang::CanQual< T >::getUnqualifiedType(), clang::ConversionFixItGenerator::Hints, clang::Expr::IgnoreParens(), clang::CanQual< T >::isAtLeastAsQualifiedAs(), clang::ImplicitConversionSequence::isBad(), clang::Sema::IsDerivedFrom(), clang::Type::isIncompleteType(), clang::SourceManager::isInSystemHeader(), clang::Type::isReferenceType(), clang::BadConversionSequence::Kind, clang::ConversionFixItGenerator::Kind, clang::BadConversionSequence::lvalue_ref_to_rvalue, clang::ASTContext::OverloadTy, clang::SemaBase::PDiag(), clang::BadConversionSequence::rvalue_ref_to_lvalue, clang::Sema::SourceMgr, clang::BadConversionSequence::too_few_initializers, and clang::BadConversionSequence::too_many_initializers.
Referenced by NoteFunctionCandidate().
|
static |
Diagnose a failed template-argument deduction.
Definition at line 11573 of file SemaOverload.cpp.
References clang::AlreadyDiagnosed, clang::QualifierCollector::apply(), checkAddressOfCandidateIsAvailable(), clang::ConstraintsNotSatisfied, clang::Sema::Context, clang::CUDATargetMismatch, clang::DeductionFailureInfo::Data, clang::DeducedMismatch, clang::DeducedMismatchNested, clang::SemaBase::Diag(), DiagnoseArityMismatch(), clang::Sema::DiagnoseUnsatisfiedConstraint(), clang::Found, clang::TemplateArgument::getAsTemplate(), clang::TemplateName::getAsTemplateDecl(), clang::TemplateArgument::getAsType(), clang::DeductionFailureInfo::getCallArgIndex(), clang::NamedDecl::getDeclName(), getDescribedTemplate(), clang::Sema::getDiagnostics(), clang::DeductionFailureInfo::getFirstArg(), clang::TemplateArgument::getKind(), clang::TemplateName::getKind(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::TemplateArgument::getNonTypeTemplateArgumentType(), clang::DeductionFailureInfo::getResult(), clang::DeductionFailureInfo::getSecondArg(), clang::DeductionFailureInfo::getSFINAEDiagnostic(), clang::Sema::getTemplateArgumentBindingsText(), clang::DeductionFailureInfo::getTemplateArgumentList(), clang::DeductionFailureInfo::getTemplateParameter(), clang::TypeDecl::getTypeForDecl(), clang::ASTContext::hasSameType(), clang::Incomplete, clang::IncompletePack, clang::Inconsistent, clang::InstantiationDepth, clang::Invalid, clang::InvalidExplicitArguments, clang::QualType::isNull(), clang::MiscellaneousDeductionFailure, clang::NonDeducedMismatch, clang::NonDependentConversionFailure, clang::TemplateArgument::Pack, clang::TemplateArgument::pack_size(), clang::QualifierCollector::strip(), clang::SubstitutionFailure, clang::Success, clang::TemplateArgument::Template, clang::TemplateName::Template, clang::TooFewArguments, clang::TooManyArguments, and clang::Underqualified.
Referenced by DiagnoseBadDeduction(), clang::TemplateSpecCandidate::NoteDeductionFailure(), and NoteFunctionCandidate().
|
static |
Diagnose a failed template-argument deduction, for function calls.
Definition at line 11858 of file SemaOverload.cpp.
References CheckArityMismatch(), clang::OverloadCandidate::DeductionFailure, DiagnoseBadDeduction(), clang::OverloadCandidate::FoundDecl, clang::OverloadCandidate::Function, clang::DeductionFailureInfo::getResult(), clang::TooFewArguments, and clang::TooManyArguments.
|
static |
CUDA: diagnose an invalid call across targets.
Definition at line 11874 of file SemaOverload.cpp.
References clang::CopyAssignment, clang::CopyConstructor, clang::Sema::CUDA(), clang::DefaultConstructor, clang::SemaBase::Diag(), clang::OverloadCandidate::FoundDecl, clang::OverloadCandidate::Function, clang::Type::getAs(), clang::Sema::getCurFunctionDecl(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::OverloadCandidate::getRewriteKind(), clang::ValueDecl::getType(), clang::SemaCUDA::IdentifyTarget(), clang::SemaCUDA::inferTargetForImplicitSpecialMember(), clang::Decl::isImplicit(), clang::MoveAssignment, and clang::MoveConstructor.
Referenced by NoteFunctionCandidate().
|
static |
Definition at line 7328 of file SemaOverload.cpp.
References clang::SemaBase::Diag(), Loc, and clang::Decl::specific_attrs().
Referenced by clang::Sema::diagnoseArgDependentDiagnoseIfAttrs(), and clang::Sema::diagnoseArgIndependentDiagnoseIfAttrs().
|
static |
Definition at line 11933 of file SemaOverload.cpp.
References clang::DeductionFailureInfo::Data, clang::OverloadCandidate::DeductionFailure, clang::SemaBase::Diag(), and clang::OverloadCandidate::Function.
Referenced by NoteFunctionCandidate().
|
static |
Definition at line 11943 of file SemaOverload.cpp.
References clang::SemaBase::Diag(), clang::First, clang::OverloadCandidate::Function, clang::ExplicitSpecifier::getExpr(), clang::ExplicitSpecifier::getFromDecl(), clang::Stmt::getSourceRange(), and clang::ExplicitSpecifier::isExplicit().
Referenced by NoteFunctionCandidate().
|
static |
Definition at line 6522 of file SemaOverload.cpp.
References clang::Sema::BuildCXXMemberCallExpr(), clang::Sema::CheckMemberOperatorAccess(), clang::FixItHint::CreateInsertion(), clang::Sema::CreateRecoveryExpr(), clang::Sema::ContextualImplicitConverter::diagnoseExplicitConv(), clang::Found, clang::QualType::getAsStringInternal(), clang::Stmt::getBeginLoc(), clang::CXXConversionDecl::getConversionType(), clang::Stmt::getEndLoc(), clang::Expr::getExprLoc(), clang::Sema::getLocForEndOfToken(), clang::QualType::getNonReferenceType(), clang::Sema::getPrintingPolicy(), clang::Sema::isSFINAEContext(), Loc, clang::Sema::ContextualImplicitConverter::noteExplicitConv(), clang::Result, clang::UnresolvedSetImpl::size(), clang::Sema::ContextualImplicitConverter::Suppress, and clang::T.
Referenced by clang::Sema::PerformContextualImplicitConversion().
|
static |
Attempt to recover from an ill-formed use of a non-dependent name in a template, where the non-dependent name was declared after the template was defined.
This is common in code written for a compilers which do not correctly implement two-stage name lookup.
Returns true if a viable candidate was found and a diagnostic was issued.
Definition at line 13684 of file SemaOverload.cpp.
References clang::LookupResult::addDecl(), clang::Sema::AddOverloadedCallCandidates(), clang::OverloadCandidateSet::BestViableFunction(), canBeDeclaredInNamespace(), clang::LookupResult::clear(), clang::Sema::CurContext, clang::SemaBase::Diag(), clang::LookupResult::empty(), clang::OverloadCandidateSet::end(), clang::Sema::FindAssociatedClassesAndNamespaces(), clang::LookupResult::getLookupName(), clang::LookupResult::getNameLoc(), clang::DeclContext::getParent(), clang::NamedDecl::getQualifiedNameAsString(), clang::Sema::getStdNamespace(), clang::Sema::inTemplateInstantiation(), clang::CXXScopeSpec::isEmpty(), clang::Sema::LookupQualifiedName(), clang::OR_Success, clang::LookupResult::resolveKind(), Std, and clang::LookupResult::suppressDiagnostics().
Referenced by BuildRecoveryCallExpr(), and DiagnoseTwoPhaseOperatorLookup().
|
static |
Attempt to recover from ill-formed use of a non-dependent operator in a template, where the non-dependent operator was declared after the template was defined.
Returns true if a viable candidate was found and a diagnostic was issued.
Definition at line 13793 of file SemaOverload.cpp.
References clang::Sema::Context, clang::OverloadCandidateSet::CSK_Operator, clang::ASTContext::DeclarationNames, DiagnoseTwoPhaseLookup(), clang::DeclarationNameTable::getCXXOperatorName(), and clang::Sema::LookupOperatorName.
Referenced by clang::Sema::CreateOverloadedBinOp(), and clang::Sema::CreateOverloadedUnaryOp().
|
static |
dropPointerConversions - If the given standard conversion sequence involves any pointer conversions, remove them.
This may change the result type of the conversion sequence.
Definition at line 6382 of file SemaOverload.cpp.
References clang::StandardConversionSequence::Dimension, clang::ICK_Identity, clang::ICK_Pointer_Conversion, clang::StandardConversionSequence::Second, clang::StandardConversionSequence::Third, and clang::StandardConversionSequence::ToTypePtrs.
Referenced by TryContextuallyConvertToObjCPointer().
|
static |
Look for a user-defined conversion to a value reference-compatible with DeclType.
Return true if something definite is found.
Definition at line 5019 of file SemaOverload.cpp.
References clang::AmbiguousConversionSequence::addConversion(), clang::Sema::AddConversionCandidate(), clang::Sema::AddTemplateConversionCandidate(), clang::UserDefinedConversionSequence::After, clang::ImplicitConversionSequence::Ambiguous, clang::UserDefinedConversionSequence::Before, clang::OverloadCandidateSet::begin(), clang::OverloadCandidateSet::BestViableFunction(), clang::Type::castAs(), clang::Sema::CompareReferenceRelationship(), clang::UserDefinedConversionSequence::ConversionFunction, clang::OverloadCandidateSet::CSK_InitByUserDefinedConversion, D, clang::StandardConversionSequence::DirectBinding, E, clang::UserDefinedConversionSequence::EllipsisConversion, clang::OverloadCandidateSet::end(), clang::UserDefinedConversionSequence::FoundConversionFunction, clang::Type::getAs(), clang::CXXConversionDecl::getConversionType(), clang::RecordType::getDecl(), clang::Decl::getDeclContext(), clang::QualType::getNonReferenceType(), clang::ReferenceType::getPointeeType(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::QualType::getUnqualifiedType(), clang::UserDefinedConversionSequence::HadMultipleCandidates, clang::Init, clang::Type::isFunctionType(), clang::Type::isLValueReferenceType(), clang::Type::isRecordType(), clang::Type::isRValueReferenceType(), clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::Sema::Ref_Incompatible, clang::StandardConversionSequence::ReferenceBinding, clang::ImplicitConversionSequence::setAmbiguous(), clang::ImplicitConversionSequence::setUserDefined(), clang::OverloadCandidateSet::size(), and clang::ImplicitConversionSequence::UserDefined.
Referenced by TryReferenceInit().
|
static |
Definition at line 6595 of file SemaOverload.cpp.
References clang::Sema::DefaultLvalueConversion(), clang::Sema::ContextualImplicitConverter::diagnoseNoMatch(), clang::Stmt::getSourceRange(), clang::Expr::getType(), Loc, clang::Sema::ContextualImplicitConverter::match(), and clang::Sema::ContextualImplicitConverter::Suppress.
Referenced by clang::Sema::PerformContextualImplicitConversion().
|
static |
FinishOverloadedCallExpr - given an OverloadCandidateSet, builds and returns the completed call expression.
If overload resolution fails, emits diagnostics and returns ExprError()
Definition at line 14029 of file SemaOverload.cpp.
References BuildRecoveryCallExpr(), clang::Sema::BuildResolvedCallExpr(), clang::Sema::checkAddressOfFunctionIsAvailable(), clang::Sema::CheckUnresolvedLookupAccess(), chooseRecoveryType(), clang::Sema::CreateRecoveryExpr(), clang::OverloadCandidateSet::CSK_AddressOfOverloadSet, clang::Sema::DiagnoseUseOfDecl(), clang::Sema::DiagnoseUseOfDeletedFunction(), clang::OverloadCandidateSet::empty(), clang::OverloadCandidateSet::end(), clang::ExprError(), clang::Sema::FixOverloadedFunctionReference(), clang::ActionResult< PtrTy, Compress >::get(), clang::OverloadCandidateSet::getKind(), clang::OverloadExpr::getName(), clang::OverloadExpr::getNameLoc(), clang::CXXMethodDecl::isImplicitObjectMemberFunction(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, and clang::SemaBase::PDiag().
Referenced by clang::Sema::BuildForRangeBeginEndCall(), and clang::Sema::BuildOverloadedCallExpr().
|
static |
Definition at line 8863 of file SemaOverload.cpp.
References forAllQualifierCombinationsImpl().
|
static |
Definition at line 8839 of file SemaOverload.cpp.
References forAllQualifierCombinationsImpl(), clang::QualifiersAndAtomic::hasVolatile(), clang::QualifiersAndAtomic::withAtomic(), and clang::QualifiersAndAtomic::withVolatile().
Referenced by forAllQualifierCombinations(), and forAllQualifierCombinationsImpl().
|
static |
Definition at line 54 of file SemaOverload.cpp.
References P, and clang::FunctionDecl::parameters().
Referenced by clang::isBetterOverloadCandidate(), and IsOverloadOrOverrideImpl().
|
static |
Definition at line 1016 of file SemaOverload.cpp.
References clang::FunctionDecl::getDescribedFunctionTemplate(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::ValueDecl::getType(), clang::ASTContext::hasSameUnqualifiedType(), clang::ASTContext::isSameTemplateParameterList(), and X.
Referenced by shouldAddReversedEqEq().
|
static |
Definition at line 4075 of file SemaOverload.cpp.
References clang::Type::castAs(), clang::Type::getAs(), clang::PointerType::getPointeeType(), clang::FunctionType::getReturnType(), and clang::ValueDecl::getType().
Referenced by compareConversionFunctions().
|
static |
Definition at line 11565 of file SemaOverload.cpp.
References clang::Decl::getDescribedTemplate().
Referenced by DiagnoseBadDeduction().
|
static |
Definition at line 6460 of file SemaOverload.cpp.
References clang::UnaryOperator::Create(), clang::Sema::getASTContext(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::Type::isPointerType(), clang::OK_Ordinary, and clang::VK_LValue.
Referenced by clang::Sema::InitializeExplicitObjectArgument(), and PrepareExplicitObjectArgument().
Definition at line 6440 of file SemaOverload.cpp.
References clang::Sema::getCurrentThisType(), clang::Type::getPointeeType(), clang::Type::isPointerType(), and clang::T.
Referenced by clang::Sema::BuildCallToMemberFunction().
|
static |
Returns kind of fixed enum promotion the SCS uses.
Definition at line 4374 of file SemaOverload.cpp.
References clang::Type::castAs(), clang::Sema::Context, clang::Enum, clang::StandardConversionSequence::getFromType(), clang::StandardConversionSequence::getToType(), clang::ASTContext::hasSameType(), clang::ICK_Integral_Promotion, clang::Type::isEnumeralType(), and clang::StandardConversionSequence::Second.
Referenced by CompareStandardConversionSequences().
|
static |
GetImplicitConversionName - Return the name of this kind of implicit conversion.
Definition at line 192 of file SemaOverload.cpp.
References clang::ICK_Num_Conversion_Kinds, and int.
Referenced by clang::StandardConversionSequence::dump().
|
static |
Compute the type of the implicit object parameter for the given function, if any.
Returns std::nullopt if there is no implicit object parameter, and a null QualType if there is a 'matches anything' implicit object parameter.
Definition at line 10242 of file SemaOverload.cpp.
Referenced by allowAmbiguity().
|
static |
Definition at line 12252 of file SemaOverload.cpp.
References clang::OverloadCandidate::Function, clang::Decl::getLocation(), clang::OverloadCandidate::IsSurrogate, and clang::OverloadCandidate::Surrogate.
|
static |
Definition at line 12715 of file SemaOverload.cpp.
References clang::Decl::getLocation(), and clang::TemplateSpecCandidate::Specialization.
|
static |
Definition at line 4149 of file SemaOverload.cpp.
References clang::UserDefinedConversionSequence::Before, clang::StandardConversionSequence::DeprecatedStringLiteralToCharPtr, clang::ImplicitConversionSequence::isStandard(), clang::ImplicitConversionSequence::isUserDefined(), clang::ImplicitConversionSequence::Standard, and clang::ImplicitConversionSequence::UserDefined.
Referenced by CompareImplicitConversionSequences(), and clang::isBetterOverloadCandidate().
|
static |
Skip any implicit casts which could be either part of a narrowing conversion or after one in an implicit conversion.
Definition at line 313 of file SemaOverload.cpp.
References clang::ExprWithCleanups::Create(), and IgnoreNarrowingConversion().
Referenced by clang::StandardConversionSequence::getNarrowingKind(), and IgnoreNarrowingConversion().
|
static |
IsAcceptableNonMemberOperatorCandidate - Determine whether Fn is an acceptable non-member overloaded operator for a call whose arguments have types T1 (and, if non-empty, T2).
This routine implements the check in C++ [over.match.oper]p3b2 concerning enumeration types.
Definition at line 6836 of file SemaOverload.cpp.
References clang::ASTContext::hasSameUnqualifiedType(), clang::Type::isDependentType(), clang::Type::isEnumeralType(), clang::QualType::isNull(), and clang::Type::isRecordType().
Referenced by clang::Sema::AddOverloadCandidate().
|
static |
Determine whether this is an allowable conversion from the result of an explicit conversion operator to the expected type, per C++ [over.match.conv]p1 and [over.match.ref]p1.
ConvType | The return type of the conversion function. |
ToType | The type we are converting to. |
AllowObjCPointerConversion | Allow a conversion from one Objective-C pointer to another. |
Definition at line 7916 of file SemaOverload.cpp.
References clang::Sema::Context, clang::QualType::getNonReferenceType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Sema::isObjCPointerConversion(), and clang::Sema::IsQualificationConversion().
Referenced by clang::Sema::AddConversionCandidate().
|
static |
Definition at line 10183 of file SemaOverload.cpp.
References clang::OverloadCandidate::Function, clang::Decl::getAttr(), getName(), clang::Decl::hasAttr(), clang::Decl::isInvalidDecl(), and clang::FunctionDecl::isMultiVersion().
Referenced by clang::isBetterOverloadCandidate().
|
static |
Determine whether one of the given reference bindings is better than the other based on what kind of bindings they are.
Definition at line 4341 of file SemaOverload.cpp.
References clang::StandardConversionSequence::BindsImplicitObjectArgumentWithoutRefQualifier, clang::StandardConversionSequence::BindsToFunctionLvalue, clang::StandardConversionSequence::BindsToRvalue, and clang::StandardConversionSequence::IsLvalueReference.
Referenced by CompareStandardConversionSequences().
|
static |
Definition at line 3745 of file SemaOverload.cpp.
References clang::QualType::getNonReferenceType(), and clang::ASTContext::hasSameUnqualifiedType().
Referenced by IsUserDefinedConversion().
Determine whether the conversion from FromType to ToType is a valid floating point conversion.
Definition at line 1972 of file SemaOverload.cpp.
References clang::Sema::Context, clang::ASTContext::getFloatTypeSemantics(), clang::Type::isBFloat16Type(), clang::Type::isFloat16Type(), clang::Type::isHalfType(), and clang::Type::isRealFloatingType().
Referenced by IsStandardConversion(), and IsVectorElementConversion().
|
static |
Definition at line 10986 of file SemaOverload.cpp.
References clang::Decl::specific_attrs().
Referenced by checkAddressOfFunctionIsAvailable().
|
static |
Definition at line 3758 of file SemaOverload.cpp.
References clang::Sema::AddOverloadCandidate(), clang::Sema::AddTemplateOverloadCandidate(), clang::UserDefinedConversionSequence::After, clang::UserDefinedConversionSequence::Before, clang::OverloadCandidateSet::BestViableFunction(), clang::OverloadCandidateSet::clear(), clang::UserDefinedConversionSequence::ConversionFunction, clang::OverloadCandidateSet::CSK_InitByUserDefinedConversion, D, clang::UserDefinedConversionSequence::FoundConversionFunction, clang::Stmt::getBeginLoc(), clang::getConstructorInfo(), clang::UserDefinedConversionSequence::HadMultipleCandidates, clang::Sema::isInitListConstructor(), clang::Sema::LookupConstructors(), clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::Result, clang::StandardConversionSequence::setAllToTypes(), clang::StandardConversionSequence::setAsIdentityConversion(), clang::StandardConversionSequence::setFromType(), and clang::OverloadCandidateSet::size().
Referenced by IsUserDefinedConversion().
|
static |
Determine whether a given function template has a simple explicit specifier or a non-value-dependent explicit-specification that evaluates to true.
Definition at line 7744 of file SemaOverload.cpp.
References clang::ExplicitSpecifier::getFromDecl(), clang::FunctionTemplateDecl::getTemplatedDecl(), and clang::ExplicitSpecifier::isExplicit().
Referenced by clang::Sema::AddTemplateConversionCandidate(), and clang::Sema::AddTemplateOverloadCandidate().
|
static |
Determine whether the lifetime conversion between the two given qualifiers sets is nontrivial.
Definition at line 3592 of file SemaOverload.cpp.
References clang::Qualifiers::getObjCLifetime(), clang::Qualifiers::hasConst(), and clang::Qualifiers::OCL_ExplicitNone.
Referenced by isQualificationConversionStep().
|
static |
Definition at line 6870 of file SemaOverload.cpp.
References clang::ASTContext::forEachMultiversionedFunctionVersion(), clang::Decl::getASTContext(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::FunctionDecl::isMultiVersion(), clang::FunctionDecl::isTargetMultiVersion(), and clang::FunctionDecl::isTargetMultiVersionDefault().
Referenced by clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), and clang::Sema::AddOverloadCandidate().
|
static |
Definition at line 2814 of file SemaOverload.cpp.
References clang::Expr::getType(), clang::Type::isEnumeralType(), clang::Type::isIntegerType(), clang::Expr::isNullPointerConstant(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::Expr::NPC_ValueDependentIsNotNull, and clang::Expr::NPC_ValueDependentIsNull.
Referenced by clang::Sema::IsPointerConversion().
|
static |
Definition at line 1312 of file SemaOverload.cpp.
References clang::QualType::addConst(), clang::Sema::AreConstraintExpressionsEqual(), clang::Sema::Context, clang::Sema::CUDA(), D, clang::SemaBase::Diag(), clang::DeclContext::Equals(), functionHasPassObjectSizeParams(), clang::Sema::FunctionParamTypesAreEqual(), clang::ASTContext::getCanonicalType(), clang::FunctionDecl::getDeclaredReturnType(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::CXXMethodDecl::getFunctionObjectParameterReferenceType(), clang::Sema::getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::TemplateDecl::getTemplateParameters(), clang::FunctionDecl::getTemplateSpecializationKind(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::ValueDecl::getType(), clang::ASTContext::getTypeDeclType(), clang::QualType::getTypePtr(), clang::TemplateParameterList::hasAssociatedConstraints(), clang::ASTContext::hasSameType(), clang::SemaCUDA::IdentifyTarget(), clang::InvalidTarget, clang::FunctionDecl::isConsteval(), clang::FunctionDecl::isConstexpr(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::FunctionDecl::isMain(), clang::FunctionDecl::isMemberLikeConstrainedFriend(), clang::FunctionDecl::isMSVCRTEntryPoint(), clang::Sema::LangOpts, clang::Stmt::Profile(), clang::SplitQualType::Quals, clang::Qualifiers::removeVolatile(), clang::RQ_None, clang::Decl::specific_attr_begin(), clang::Decl::specific_attr_end(), clang::Sema::TemplateParameterListsAreEqual(), clang::Sema::TPL_TemplateMatch, clang::TSK_ExplicitSpecialization, and clang::SplitQualType::Ty.
Referenced by clang::Sema::IsOverload(), and clang::Sema::IsOverride().
|
static |
Perform a single iteration of the loop for checking if a qualification conversion is valid.
Specifically, check whether any change between the qualifiers of FromType
and ToType
is permissible, given knowledge about whether every outer layer is const-qualified.
Definition at line 3608 of file SemaOverload.cpp.
References clang::Qualifiers::compatiblyIncludes(), clang::Qualifiers::compatiblyIncludesObjCLifetime(), clang::Qualifiers::getAddressSpace(), clang::Qualifiers::getCVRQualifiers(), clang::Qualifiers::getObjCGCAttr(), clang::Qualifiers::getObjCLifetime(), clang::QualType::getQualifiers(), clang::Qualifiers::hasConst(), clang::Qualifiers::hasObjCGCAttr(), clang::Qualifiers::isAddressSpaceSupersetOf(), clang::Type::isConstantArrayType(), clang::Type::isIncompleteArrayType(), isNonTrivialObjCLifetimeConversion(), clang::Qualifiers::removeObjCGCAttr(), clang::Qualifiers::removeObjCLifetime(), and clang::Qualifiers::removeUnaligned().
Referenced by clang::Sema::CompareReferenceRelationship(), and clang::Sema::IsQualificationConversion().
|
static |
IsStandardConversion - Determines whether there is a standard conversion sequence (C++ [conv], C++ [over.ics.scs]) from the expression From to the type ToType.
Standard conversion sequences only consider non-class types; for conversions that involve class types, use TryImplicitConversion. If a conversion exists, SCS will contain the standard conversion sequence required to perform this conversion and this routine will return true. Otherwise, this routine will return false and the value of SCS is unspecified.
Definition at line 2168 of file SemaOverload.cpp.
References clang::Atomic, clang::ASTContext::BoolTy, clang::Type::canDecayToPointerType(), clang::Sema::checkAddressOfFunctionIsAvailable(), clang::Sema::CheckSingleAssignmentConstraints(), clang::Sema::Compatible, clang::Sema::CompatiblePointerDiscardsQualifiers, clang::Sema::Context, clang::StandardConversionSequence::CopyConstructor, clang::StandardConversionSequence::DeprecatedStringLiteralToCharPtr, clang::StandardConversionSequence::Dimension, clang::Expr::EvaluateKnownConstInt(), clang::Sema::ExtractUnqualifiedFunctionType(), clang::StandardConversionSequence::First, clang::ASTContext::getArrayDecayedType(), clang::ASTContext::getArrayParameterType(), clang::Type::getAs(), clang::Sema::getASTContext(), clang::ASTContext::getCanonicalType(), clang::ArrayParameterType::getConstantArrayType(), clang::Sema::getLangOpts(), clang::QualType::getLocalQualifiers(), clang::QualType::getLocalUnqualifiedType(), clang::ASTContext::getMemberPointerType(), clang::CXXMethodDecl::getParent(), clang::ASTContext::getPointerType(), clang::Expr::getType(), clang::ASTContext::getTypeDeclType(), clang::QualType::getTypePtr(), clang::QualType::getUnqualifiedType(), clang::ASTContext::hasSameUnqualifiedType(), clang::ICK_Array_To_Pointer, clang::ICK_Block_Pointer_Conversion, clang::ICK_Boolean_Conversion, clang::ICK_C_Only_Conversion, clang::ICK_Compatible_Conversion, clang::ICK_Complex_Conversion, clang::ICK_Complex_Promotion, clang::ICK_Complex_Real, clang::ICK_Fixed_Point_Conversion, clang::ICK_Floating_Conversion, clang::ICK_Floating_Integral, clang::ICK_Floating_Promotion, clang::ICK_Function_Conversion, clang::ICK_Function_To_Pointer, clang::ICK_HLSL_Array_RValue, clang::ICK_Identity, clang::ICK_Incompatible_Pointer_Conversion, clang::ICK_Integral_Conversion, clang::ICK_Integral_Promotion, clang::ICK_Lvalue_To_Rvalue, clang::ICK_Pointer_Conversion, clang::ICK_Pointer_Member, clang::ICK_Qualification, clang::ICK_TransparentUnionConversion, clang::ICK_Writeback_Conversion, clang::ICK_Zero_Event_Conversion, clang::ICK_Zero_Queue_Conversion, clang::Expr::IgnoreParenCasts(), clang::Expr::IgnoreParens(), clang::StandardConversionSequence::IncompatibleObjC, clang::Sema::IncompatiblePointer, clang::Sema::IncompatiblePointerSign, clang::Type::isAnyComplexType(), clang::Type::isAnyPointerType(), clang::Type::isArithmeticType(), clang::Type::isArrayParameterType(), clang::Type::isArrayType(), clang::Sema::IsBlockPointerConversion(), clang::Type::isBlockPointerType(), clang::Type::isBooleanType(), clang::Sema::IsComplexPromotion(), clang::Type::isConstantArrayType(), clang::Type::isConvertibleToFixedPointType(), clang::Type::isEventT(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::Type::isFixedPointType(), IsFloatingPointConversion(), clang::Sema::IsFloatingPointPromotion(), clang::Sema::IsFunctionConversion(), clang::Type::isFunctionType(), clang::Expr::isGLValue(), clang::Expr::isIntegerConstantExpr(), clang::Type::isIntegralOrUnscopedEnumerationType(), clang::Sema::IsIntegralPromotion(), clang::Type::isIntegralType(), clang::Sema::IsMemberPointerConversion(), clang::Type::isMemberPointerType(), clang::SemaObjC::isObjCWritebackConversion(), clang::Sema::IsPointerConversion(), clang::Sema::IsQualificationConversion(), clang::Type::isQueueT(), clang::Type::isRealFloatingType(), clang::Type::isRecordType(), clang::Type::isSamplerT(), clang::CXXMethodDecl::isStatic(), clang::Sema::IsStringLiteralToNonConstPointerConversion(), IsTransparentUnionStandardConversion(), IsVectorConversion(), clang::Sema::ObjC(), clang::ASTContext::OverloadTy, clang::StandardConversionSequence::QualificationIncludesObjCLifetime, clang::Sema::ResolveAddressOfOverloadedFunction(), clang::StandardConversionSequence::Second, clang::StandardConversionSequence::setAllToTypes(), clang::StandardConversionSequence::setAsIdentityConversion(), clang::StandardConversionSequence::setFromType(), clang::StandardConversionSequence::setToType(), clang::StandardConversionSequence::Third, tryAtomicConversion(), and clang::ASTContext::typesAreCompatible().
Referenced by IsTransparentUnionStandardConversion(), tryAtomicConversion(), and TryImplicitConversion().
|
static |
Definition at line 2526 of file SemaOverload.cpp.
References clang::RecordDecl::fields(), clang::Type::getAsUnionType(), clang::RecordType::getDecl(), clang::Expr::getType(), clang::Decl::hasAttr(), and IsStandardConversion().
Referenced by IsStandardConversion().
|
static |
Determines whether there is a user-defined conversion sequence (C++ [over.ics.user]) that converts expression From to the type ToType.
If such a conversion exists, User will contain the user-defined conversion sequence that performs such a conversion and this routine will return true. Otherwise, this routine returns false and User is unspecified.
AllowExplicit | true if the conversion should consider C++0x "explicit" conversion functions as well as non-explicit conversion functions (C++0x [class.conv.fct]p2). |
AllowObjCConversionOnExplicit | true if the conversion should allow an extra Objective-C pointer conversion on uses of explicit constructors. Requires AllowExplicit to also be set. |
Definition at line 3831 of file SemaOverload.cpp.
References clang::Sema::AddConversionCandidate(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddTemplateConversionCandidate(), clang::Sema::AddTemplateOverloadCandidate(), clang::UserDefinedConversionSequence::After, clang::UserDefinedConversionSequence::Before, clang::OverloadCandidateSet::BestViableFunction(), clang::OverloadCandidateSet::clear(), clang::Sema::Context, clang::UserDefinedConversionSequence::ConversionFunction, clang::OverloadCandidateSet::CSK_InitByUserDefinedConversion, D, E, clang::UserDefinedConversionSequence::EllipsisConversion, clang::UserDefinedConversionSequence::FoundConversionFunction, clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::getConstructorInfo(), clang::Decl::getDeclContext(), clang::Expr::getExprLoc(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::Expr::getType(), clang::UserDefinedConversionSequence::HadMultipleCandidates, clang::ASTContext::hasSameUnqualifiedType(), clang::Sema::isCompleteType(), clang::Sema::IsDerivedFrom(), isFirstArgumentCompatibleWithType(), IsInitializerListConstructorConversion(), clang::Sema::LookupConstructors(), clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::Result, clang::StandardConversionSequence::setAllToTypes(), clang::StandardConversionSequence::setAsIdentityConversion(), clang::StandardConversionSequence::setFromType(), and clang::OverloadCandidateSet::size().
Referenced by clang::Sema::DiagnoseMultipleUserDefinedConversion(), and TryUserDefinedConversion().
|
static |
Determine whether the conversion from FromType to ToType is a valid vector conversion.
ICK | Will be set to the vector conversion kind, if this is a vector conversion. |
Definition at line 2046 of file SemaOverload.cpp.
References clang::Sema::anyAltivecTypes(), clang::ASTContext::areCompatibleRVVTypes(), clang::ASTContext::areCompatibleSveTypes(), clang::ASTContext::areCompatibleVectorTypes(), clang::ASTContext::areLaxCompatibleRVVTypes(), clang::ASTContext::areLaxCompatibleSveTypes(), clang::Sema::Context, clang::SemaBase::Diag(), clang::Type::getAs(), clang::Sema::getASTContext(), clang::Stmt::getBeginLoc(), clang::VectorType::getElementType(), clang::Sema::getLangOpts(), clang::VectorType::getNumElements(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::Type::hasAttr(), clang::ASTContext::hasSameUnqualifiedType(), clang::ICK_HLSL_Vector_Splat, clang::ICK_HLSL_Vector_Truncation, clang::ICK_Identity, clang::ICK_RVV_Vector_Conversion, clang::ICK_SVE_Vector_Conversion, clang::ICK_Vector_Conversion, clang::ICK_Vector_Splat, clang::Type::isArithmeticType(), clang::Sema::isLaxVectorConversion(), clang::Type::isRVVSizelessBuiltinType(), clang::Type::isSVESizelessBuiltinType(), IsVectorElementConversion(), and clang::Type::isVectorType().
Referenced by IsStandardConversion().
|
static |
Definition at line 1999 of file SemaOverload.cpp.
References clang::Sema::Context, clang::ASTContext::hasSameUnqualifiedType(), clang::ICK_Boolean_Conversion, clang::ICK_Floating_Conversion, clang::ICK_Floating_Integral, clang::ICK_Floating_Promotion, clang::ICK_Integral_Conversion, clang::ICK_Integral_Promotion, clang::Type::isArithmeticType(), clang::Type::isBooleanType(), IsFloatingPointConversion(), clang::Sema::IsFloatingPointPromotion(), clang::Type::isIntegralOrUnscopedEnumerationType(), clang::Sema::IsIntegralPromotion(), clang::Type::isIntegralType(), and clang::Type::isRealFloatingType().
Referenced by IsVectorConversion().
|
static |
|
static |
Definition at line 14136 of file SemaOverload.cpp.
References clang::OverloadCandidateSet::begin(), clang::Sema::checkAddressOfFunctionIsAvailable(), E, clang::OverloadCandidateSet::end(), and clang::ovl_fail_addr_not_available.
Referenced by clang::Sema::BuildOverloadedCallExpr().
|
static |
Definition at line 11132 of file SemaOverload.cpp.
References E, and clang::Sema::MaybeEmitAmbiguousAtomicConstraintsDiagnostic().
Referenced by clang::OverloadCandidateSet::NoteCandidates().
|
static |
Definition at line 12241 of file SemaOverload.cpp.
References clang::OverloadCandidate::Conversions, clang::ImplicitConversionSequence::DiagnoseAmbiguousConversion(), clang::ImplicitConversionSequence::isAmbiguous(), clang::ImplicitConversionSequence::isBad(), and clang::SemaBase::PDiag().
Referenced by clang::OverloadCandidateSet::NoteCandidates().
|
static |
Definition at line 12222 of file SemaOverload.cpp.
References clang::OverloadCandidate::BuiltinParamTypes, clang::OverloadCandidate::Conversions, clang::SemaBase::Diag(), and clang::QualType::getAsString().
Referenced by clang::OverloadCandidateSet::NoteCandidates().
|
static |
Generates a 'note' diagnostic for an overload candidate.
We've already generated a primary error at the call site.
It really does need to be a single diagnostic with its caret pointed at the candidate declaration. Yes, this creates some major challenges of technical writing. Yes, this makes pointing out problems with specific arguments quite awkward. It's still better than generating twenty screens of text for every failed overload.
It would be great to be able to express per-candidate problems more richly for those diagnostic clients that cared, but we'd still have to be just as careful with the default diagnostics.
CtorDestAS | Addr space of object being constructed (for ctor candidates only). |
Definition at line 12033 of file SemaOverload.cpp.
References checkAddressOfCandidateIsAvailable(), clang::Sema::CheckFunctionConstraints(), clang::OverloadCandidate::Conversions, clang::SemaBase::Diag(), DiagnoseArityMismatch(), DiagnoseBadConversion(), DiagnoseBadDeduction(), DiagnoseBadTarget(), DiagnoseFailedEnableIfAttr(), DiagnoseFailedExplicitSpec(), clang::Sema::DiagnoseUnsatisfiedConstraint(), clang::OverloadCandidate::FailureKind, clang::OverloadCandidate::FoundDecl, clang::OverloadCandidate::Function, clang::Sema::getLangOpts(), clang::OverloadCandidate::getRewriteKind(), clang::OverloadCandidate::IgnoreObjectArgument, NoteImplicitDeductionGuide(), clang::Sema::NoteOverloadCandidate(), clang::ovl_fail_addr_not_available, clang::ovl_fail_bad_conversion, clang::ovl_fail_bad_deduction, clang::ovl_fail_bad_final_conversion, clang::ovl_fail_bad_target, clang::ovl_fail_constraints_not_satisfied, clang::ovl_fail_enable_if, clang::ovl_fail_explicit, clang::ovl_fail_final_conversion_not_exact, clang::ovl_fail_illegal_constructor, clang::ovl_fail_inhctor_slice, clang::ovl_fail_object_addrspace_mismatch, clang::ovl_fail_too_few_arguments, clang::ovl_fail_too_many_arguments, clang::ovl_fail_trivial_conversion, clang::ovl_non_default_multiversion_function, clang::Qualifiers::setAddressSpace(), shouldSkipNotingLambdaConversionDecl(), clang::OverloadCandidate::TookAddressOfOverload, and clang::OverloadCandidate::Viable.
Referenced by clang::OverloadCandidateSet::NoteCandidates().
|
static |
Definition at line 11978 of file SemaOverload.cpp.
References clang::SemaBase::Diag(), clang::DeclarationName::getCXXDeductionGuideTemplate(), clang::NamedDecl::getDeclName(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::FunctionDecl::getTemplateInstantiationPattern(), clang::TemplateDecl::isTypeAlias(), and clang::Decl::print().
Referenced by NoteFunctionCandidate().
|
static |
Definition at line 12177 of file SemaOverload.cpp.
References clang::Sema::CheckFunctionConstraints(), clang::Sema::Context, clang::SemaBase::Diag(), clang::Sema::DiagnoseUnsatisfiedConstraint(), clang::OverloadCandidate::FailureKind, clang::Type::getAs(), clang::CXXConversionDecl::getConversionType(), clang::Decl::getLocation(), clang::ASTContext::getLValueReferenceType(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::ASTContext::getRValueReferenceType(), clang::ovl_fail_constraints_not_satisfied, shouldSkipNotingLambdaConversionDecl(), clang::OverloadCandidate::Surrogate, and clang::OverloadCandidate::Viable.
Referenced by clang::OverloadCandidateSet::NoteCandidates().
|
static |
Definition at line 15100 of file SemaOverload.cpp.
References clang::Sema::BuildCXXDefaultArgExpr(), clang::Type::castAs(), clang::Sema::Context, clang::ActionResult< PtrTy, Compress >::getAs(), clang::FunctionProtoType::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::ValueDecl::getType(), clang::InitializedEntity::InitializeParameter(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::Sema::PerformCopyInitialization().
Referenced by clang::Sema::BuildCallToObjectOfClassType(), and clang::Sema::CreateOverloadedArraySubscriptExpr().
|
static |
Definition at line 6480 of file SemaOverload.cpp.
References clang::Sema::DiagnoseInvalidExplicitObjectParameterInLambda(), GetExplicitObjectExpr(), and clang::CXXMethodDecl::isExplicitObjectMemberFunction().
Referenced by clang::Sema::BuildCallToMemberFunction(), and clang::Sema::BuildCallToObjectOfClassType().
|
static |
Definition at line 12260 of file SemaOverload.cpp.
References clang::AlreadyDiagnosed, clang::ConstraintsNotSatisfied, clang::CUDATargetMismatch, clang::DeducedMismatch, clang::DeducedMismatchNested, clang::Incomplete, clang::IncompletePack, clang::Inconsistent, clang::InstantiationDepth, clang::Invalid, clang::InvalidExplicitArguments, clang::MiscellaneousDeductionFailure, clang::NonDeducedMismatch, clang::NonDependentConversionFailure, clang::DeductionFailureInfo::Result, clang::SubstitutionFailure, clang::Success, clang::TooFewArguments, clang::TooManyArguments, and clang::Underqualified.
|
static |
Definition at line 6566 of file SemaOverload.cpp.
References clang::Sema::BuildCXXMemberCallExpr(), clang::Sema::CheckMemberOperatorAccess(), clang::Sema::Context, clang::ImplicitCastExpr::Create(), clang::Sema::CurFPFeatureOverrides(), clang::Sema::ContextualImplicitConverter::diagnoseConversion(), clang::Found, clang::CXXConversionDecl::getConversionType(), clang::Expr::getExprLoc(), clang::QualType::getNonReferenceType(), clang::Stmt::getSourceRange(), clang::Sema::isSFINAEContext(), Loc, clang::Result, clang::Sema::ContextualImplicitConverter::SuppressConversion, and clang::T.
Referenced by clang::Sema::PerformContextualImplicitConversion().
|
static |
We're allowed to use constraints partial ordering only if the candidates have the same parameter types: [over.match.best.general]p2.6 F1 and F2 are non-template functions with the same non-object-parameter-type-lists, and F1 is more constrained than F2 [...].
Definition at line 10301 of file SemaOverload.cpp.
References clang::OverloadCandidate::Function, clang::Sema::FunctionNonObjectParamTypesAreEqual(), clang::Sema::getASTContext(), clang::ASTContext::hasSameType(), clang::OverloadCandidate::isReversed(), and clang::FunctionDecl::isVariadic().
Referenced by clang::isBetterOverloadCandidate().
|
static |
Definition at line 1040 of file SemaOverload.cpp.
References clang::Sema::Context, clang::ASTContext::DeclarationNames, clang::declaresSameEntity(), FunctionsCorrespond(), clang::Type::getAs(), clang::Decl::getAsFunction(), clang::DeclarationNameTable::getCXXOperatorName(), clang::DeclContext::getEnclosingNamespaceContext(), clang::FunctionDecl::getOverloadedOperator(), clang::Expr::getType(), clang::Sema::isVisible(), clang::DeclContext::lookup(), clang::Sema::LookupMemberName, clang::Sema::LookupQualifiedName(), and clang::LookupResult::suppressAccessDiagnostics().
Referenced by clang::OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed().
|
static |
Definition at line 11085 of file SemaOverload.cpp.
References clang::Type::castAs(), clang::Type::getPointeeType(), and clang::ValueDecl::getType().
Referenced by NoteFunctionCandidate(), clang::Sema::NoteOverloadCandidate(), and NoteSurrogateCandidate().
|
static |
If successful, updates SCS's
second and third steps in the conversion sequence to finish the conversion.
Definition at line 3722 of file SemaOverload.cpp.
References clang::Type::getAs(), clang::StandardConversionSequence::getToType(), clang::AtomicType::getValueType(), IsStandardConversion(), clang::StandardConversionSequence::QualificationIncludesObjCLifetime, clang::StandardConversionSequence::Second, clang::StandardConversionSequence::setToType(), and clang::StandardConversionSequence::Third.
Referenced by IsStandardConversion().
|
static |
TryContextuallyConvertToBool - Attempt to contextually convert the expression From to bool (C++0x [conv]p3).
Definition at line 6019 of file SemaOverload.cpp.
References clang::ASTContext::BoolTy, clang::Sema::Context, clang::ImplicitConversionSequence::getNullptrToBool(), clang::Expr::getType(), clang::Expr::isGLValue(), clang::Type::isNullPtrType(), and TryImplicitConversion().
Referenced by clang::Sema::AddBuiltinCandidate(), BuildConvertedConstantExpression(), and clang::Sema::PerformContextuallyConvertToBool().
|
static |
TryContextuallyConvertToObjCPointer - Attempt to contextually convert the expression From to an Objective-C pointer type.
Definition at line 6394 of file SemaOverload.cpp.
References clang::UserDefinedConversionSequence::After, clang::ImplicitConversionSequence::AmbiguousConversion, clang::ImplicitConversionSequence::BadConversion, clang::Sema::Context, dropPointerConversion(), clang::ImplicitConversionSequence::EllipsisConversion, clang::ImplicitConversionSequence::getKind(), clang::ASTContext::getObjCIdType(), clang::ImplicitConversionSequence::Standard, clang::ImplicitConversionSequence::StandardConversion, clang::ImplicitConversionSequence::StaticObjectArgumentConversion, TryImplicitConversion(), clang::ImplicitConversionSequence::UserDefined, and clang::ImplicitConversionSequence::UserDefinedConversion.
Referenced by clang::Sema::PerformContextuallyConvertToObjCPointer().
|
static |
Definition at line 5747 of file SemaOverload.cpp.
References clang::ImplicitConversionSequence::isBad(), Loc, and TryCopyInitialization().
|
static |
TryCopyInitialization - Try to copy-initialize a value of type ToType from the expression From.
Return the implicit conversion sequence required to pass this argument, which may be a bad conversion sequence (meaning that the argument cannot be passed to a parameter of this type). If SuppressUserConversions
, then we do not permit any user-defined conversion sequences.
Definition at line 5724 of file SemaOverload.cpp.
References clang::Stmt::getBeginLoc(), clang::Type::isReferenceType(), TryImplicitConversion(), TryListConversion(), and TryReferenceInit().
Referenced by clang::Sema::AddBuiltinCandidate(), clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddSurrogateCandidate(), BuildConvertedConstantExpression(), clang::Sema::CheckNonDependentConversions(), CompleteNonViableCandidate(), clang::Sema::SelectBestMethod(), TryCopyInitialization(), TryListConversion(), and TryObjectArgumentInitialization().
|
static |
Attempts to get the FunctionProtoType from a Type.
Handles MemberFunctionPointers properly.
Definition at line 3252 of file SemaOverload.cpp.
References clang::Type::getAs(), and clang::Type::getPointeeType().
Referenced by clang::Sema::HandleFunctionTypeMismatch().
|
static |
TryImplicitConversion - Attempt to perform an implicit conversion from the given expression (Expr) to the given type (ToType).
This function returns an implicit conversion sequence that can be used to perform the initialization. Given
void f(float f); void g(int i) { f(i); }
this routine would produce an implicit conversion sequence to describe the initialization of f from i, which will be a standard conversion sequence containing an lvalue-to-rvalue conversion (C++ 4.1) followed by a floating-integral conversion (C++ 4.9). Note that this routine only determines how the conversion can be performed; it does not actually perform the conversion. As such, it will not produce any diagnostics if no conversion is available, but will instead return an implicit conversion sequence of kind "BadConversion".
If SuppressUserConversions
, then user-defined conversions are not permitted. If AllowExplicit
, then explicit user-defined conversions are permitted.
AllowObjCWritebackConversion | Whether we allow the Objective-C writeback conversion, which allows __autoreleasing id* parameters to be initialized with __strong id* or __weak id* arguments. |
Definition at line 1747 of file SemaOverload.cpp.
References clang::Sema::Context, clang::StandardConversionSequence::CopyConstructor, clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::Sema::getLangOpts(), clang::Expr::getType(), clang::ASTContext::hasSameUnqualifiedType(), clang::ICK_Derived_To_Base, clang::Sema::IsDerivedFrom(), clang::Type::isHLSLAttributedResourceType(), IsStandardConversion(), clang::BadConversionSequence::no_conversion, clang::StandardConversionSequence::Second, clang::StandardConversionSequence::setAllToTypes(), clang::StandardConversionSequence::setAsIdentityConversion(), clang::ImplicitConversionSequence::setBad(), clang::StandardConversionSequence::setFromType(), clang::ImplicitConversionSequence::setStandard(), clang::ImplicitConversionSequence::Standard, and TryUserDefinedConversion().
Referenced by clang::Sema::PerformImplicitConversion(), TryContextuallyConvertToBool(), TryContextuallyConvertToObjCPointer(), TryCopyInitialization(), and TryReferenceInit().
|
static |
TryListConversion - Try to copy-initialize a value of type ToType from the initializer list From.
Definition at line 5410 of file SemaOverload.cpp.
References clang::StandardConversionSequence::BindsImplicitObjectArgumentWithoutRefQualifier, clang::StandardConversionSequence::BindsToFunctionLvalue, clang::StandardConversionSequence::BindsToRvalue, clang::Sema::CanPerformAggregateInitializationForOverloadResolution(), clang::Sema::CanPerformCopyInitialization(), clang::Type::castAs(), CompareImplicitConversionSequences(), clang::Sema::CompareReferenceRelationship(), clang::Sema::Context, clang::Found, clang::ASTContext::getAsArrayType(), clang::InitListExpr::getBeginLoc(), clang::ASTContext::getCanonicalType(), clang::ASTContext::getConstantArrayType(), clang::ArrayType::getElementType(), clang::InitListExpr::getEndLoc(), clang::InitListExpr::getInit(), clang::Sema::getLangOpts(), clang::InitListExpr::getNumInits(), getPointeeType(), clang::ASTContext::getSizeType(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), clang::InitListExpr::hasDesignatedInit(), clang::ASTContext::hasSameUnqualifiedType(), clang::Init, clang::InitializedEntity::InitializeParameter(), clang::Type::isAggregateType(), clang::ImplicitConversionSequence::isBad(), clang::Sema::isCompleteType(), clang::QualType::isConstQualified(), clang::Sema::IsDerivedFrom(), clang::StandardConversionSequence::IsLvalueReference, clang::Type::isLValueReferenceType(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::Type::isRValueReferenceType(), clang::Sema::isStdInitializerList(), clang::Sema::IsStringInit(), clang::QualType::isVolatileQualified(), clang::BadConversionSequence::lvalue_ref_to_rvalue, clang::BadConversionSequence::no_conversion, clang::Normal, clang::StandardConversionSequence::ObjCLifetimeConversionBinding, clang::ASTContext::OverloadTy, clang::Sema::Ref_Related, clang::StandardConversionSequence::ReferenceBinding, clang::Sema::ResolveAddressOfOverloadedFunction(), clang::Result, clang::ImplicitConversionSequence::setBad(), clang::Expr::setType(), clang::BadConversionSequence::too_few_initializers, clang::BadConversionSequence::too_many_initializers, TryCopyInitialization(), TryListConversion(), TryReferenceInit(), TryUserDefinedConversion(), clang::ASTContext::VoidTy, and clang::ImplicitConversionSequence::Worse.
Referenced by TryCopyInitialization(), and TryListConversion().
|
static |
TryObjectArgumentInitialization - Try to initialize the object parameter of the given member function (Method
) from the expression From
.
Definition at line 5762 of file SemaOverload.cpp.
References clang::Qualifiers::addConst(), clang::Qualifiers::addVolatile(), clang::ImplicitConversionSequence::Bad, clang::BadConversionSequence::bad_qualifiers, clang::StandardConversionSequence::BindsImplicitObjectArgumentWithoutRefQualifier, clang::StandardConversionSequence::BindsToFunctionLvalue, clang::StandardConversionSequence::BindsToRvalue, clang::C, clang::Sema::Context, clang::StandardConversionSequence::DirectBinding, clang::BadConversionSequence::FromExpr, clang::Type::getAs(), clang::Sema::getASTContext(), clang::ASTContext::getCanonicalType(), clang::QualType::getCVRQualifiers(), clang::CXXMethodDecl::getFunctionObjectParameterReferenceType(), clang::QualType::getLocalCVRQualifiers(), clang::QualType::getLocalUnqualifiedType(), clang::CXXMethodDecl::getMethodQualifiers(), clang::QualType::getNonReferenceType(), clang::Type::getPointeeType(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::CXXMethodDecl::getRefQualifier(), clang::ASTContext::getTypeDeclType(), clang::QualType::hasAddressSpace(), clang::Qualifiers::hasOnlyConst(), clang::ICK_Derived_To_Base, clang::ICK_Identity, clang::Qualifiers::isAddressSpaceSupersetOf(), clang::QualType::isAtLeastAsQualifiedAs(), clang::ImplicitConversionSequence::isBad(), clang::Sema::IsDerivedFrom(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::Expr::Classification::isLValue(), clang::StandardConversionSequence::IsLvalueReference, clang::Type::isRecordType(), clang::Expr::Classification::isRValue(), clang::CXXMethodDecl::isStatic(), Loc, clang::BadConversionSequence::lvalue_ref_to_rvalue, clang::StandardConversionSequence::ReferenceBinding, clang::RQ_LValue, clang::RQ_None, clang::RQ_RValue, clang::BadConversionSequence::rvalue_ref_to_lvalue, clang::StandardConversionSequence::Second, clang::StandardConversionSequence::setAllToTypes(), clang::StandardConversionSequence::setAsIdentityConversion(), clang::ImplicitConversionSequence::setBad(), clang::StandardConversionSequence::setFromType(), clang::ImplicitConversionSequence::setStandard(), clang::ImplicitConversionSequence::Standard, TryCopyInitialization(), clang::BadConversionSequence::unrelated_class, clang::VK_LValue, clang::VK_PRValue, clang::VK_XValue, and withoutUnaligned().
Referenced by clang::Sema::AddConversionCandidate(), clang::Sema::AddMethodCandidate(), clang::Sema::AddSurrogateCandidate(), clang::Sema::CheckNonDependentConversions(), and clang::Sema::PerformImplicitObjectArgumentInitialization().
|
static |
Compute an implicit conversion sequence for reference initialization.
Definition at line 5136 of file SemaOverload.cpp.
References clang::UserDefinedConversionSequence::After, clang::StandardConversionSequence::BindsImplicitObjectArgumentWithoutRefQualifier, clang::StandardConversionSequence::BindsToFunctionLvalue, clang::StandardConversionSequence::BindsToRvalue, clang::Type::castAs(), clang::Sema::CompareReferenceRelationship(), clang::Qualifiers::compatiblyIncludes(), clang::Sema::Context, clang::UserDefinedConversionSequence::ConversionFunction, clang::StandardConversionSequence::CopyConstructor, clang::StandardConversionSequence::DeprecatedStringLiteralToCharPtr, clang::StandardConversionSequence::Dimension, clang::StandardConversionSequence::DirectBinding, FindConversionForRefInit(), clang::StandardConversionSequence::First, clang::Found, clang::Type::getAs(), clang::Sema::getASTContext(), clang::ASTContext::getCanonicalType(), clang::Sema::getLangOpts(), getPointeeType(), clang::QualType::getQualifiers(), clang::FunctionDecl::getReturnType(), clang::ICK_Compatible_Conversion, clang::ICK_Derived_To_Base, clang::ICK_Identity, clang::ICK_Lvalue_To_Rvalue, clang::ICK_Qualification, clang::Init, clang::Type::isArrayType(), clang::Sema::isCompleteType(), clang::QualType::isConstQualified(), clang::Type::isFunctionType(), clang::Expr::Classification::isLValue(), clang::StandardConversionSequence::IsLvalueReference, clang::Expr::Classification::isPRValue(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::Expr::Classification::isRValue(), clang::Type::isRValueReferenceType(), clang::ImplicitConversionSequence::isStandard(), clang::ImplicitConversionSequence::isUserDefined(), clang::QualType::isVolatileQualified(), clang::Expr::Classification::isXValue(), clang::BadConversionSequence::lvalue_ref_to_rvalue, clang::BadConversionSequence::no_conversion, clang::StandardConversionSequence::ObjCLifetimeConversionBinding, clang::ASTContext::OverloadTy, clang::Sema::Ref_Compatible, clang::Sema::Ref_Incompatible, clang::Sema::Ref_Related, clang::StandardConversionSequence::ReferenceBinding, clang::Qualifiers::removeObjCGCAttr(), clang::Qualifiers::removeObjCLifetime(), clang::Qualifiers::removeUnaligned(), clang::Sema::ResolveAddressOfOverloadedFunction(), clang::BadConversionSequence::rvalue_ref_to_lvalue, clang::StandardConversionSequence::Second, clang::ImplicitConversionSequence::setBad(), clang::StandardConversionSequence::setFromType(), clang::ImplicitConversionSequence::setStandard(), clang::StandardConversionSequence::setToType(), clang::ImplicitConversionSequence::Standard, clang::StandardConversionSequence::Third, TryImplicitConversion(), and clang::ImplicitConversionSequence::UserDefined.
Referenced by TryCopyInitialization(), and TryListConversion().
|
static |
Tries a user-defined conversion from From to ToType.
Produces an implicit conversion sequence for when a standard conversion is not an option. See TryImplicitConversion for more information.
Definition at line 1627 of file SemaOverload.cpp.
References clang::AmbiguousConversionSequence::addConversion(), clang::ImplicitConversionSequence::Ambiguous, clang::OverloadCandidateSet::begin(), clang::Sema::Context, clang::UserDefinedConversionSequence::ConversionFunction, clang::StandardConversionSequence::CopyConstructor, clang::OverloadCandidateSet::CSK_Normal, clang::OverloadCandidateSet::end(), clang::Found, clang::UserDefinedConversionSequence::FoundConversionFunction, clang::StandardConversionSequence::FoundCopyConstructor, clang::Stmt::getBeginLoc(), clang::ASTContext::getCanonicalType(), clang::Expr::getExprLoc(), clang::Expr::getType(), clang::CanQual< T >::getUnqualifiedType(), clang::QualType::getUnqualifiedType(), clang::ICK_Derived_To_Base, clang::Sema::IsDerivedFrom(), clang::Sema::isInitListConstructor(), IsUserDefinedConversion(), clang::BadConversionSequence::no_conversion, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::StandardConversionSequence::Second, clang::StandardConversionSequence::setAllToTypes(), clang::ImplicitConversionSequence::setAmbiguous(), clang::StandardConversionSequence::setAsIdentityConversion(), clang::ImplicitConversionSequence::setBad(), clang::StandardConversionSequence::setFromType(), clang::AmbiguousConversionSequence::setFromType(), clang::ImplicitConversionSequence::setStandard(), clang::AmbiguousConversionSequence::setToType(), clang::ImplicitConversionSequence::setUserDefined(), clang::ImplicitConversionSequence::Standard, and clang::ImplicitConversionSequence::UserDefined.
|
static |
Definition at line 4913 of file SemaOverload.cpp.
References clang::ASTContext::getQualifiedType(), clang::ASTContext::getUnqualifiedArrayType(), clang::Qualifiers::removeUnaligned(), and clang::T.
Referenced by clang::Sema::CompareReferenceRelationship(), and TryObjectArgumentInitialization().