clang 18.0.0git
|
Implements semantic analysis for C++ expressions. More...
#include "TreeTransform.h"
#include "TypeLocBuilder.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTLambda.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/CharUnits.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprConcepts.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/Type.h"
#include "clang/AST/TypeLoc.h"
#include "clang/Basic/AlignedAllocation.h"
#include "clang/Basic/DiagnosticSema.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Basic/TokenKinds.h"
#include "clang/Basic/TypeTraits.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/DeclSpec.h"
#include "clang/Sema/EnterExpressionEvaluationContext.h"
#include "clang/Sema/Initialization.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/ParsedTemplate.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/SemaLambda.h"
#include "clang/Sema/Template.h"
#include "clang/Sema/TemplateDeduction.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/TypeSize.h"
#include <optional>
Go to the source code of this file.
Enumerations | |
enum class | TypeTraitReturnType { Bool } |
Functions | |
static void | getUuidAttrOfType (Sema &SemaRef, QualType QT, llvm::SmallSetVector< const UuidAttr *, 1 > &UuidAttrs) |
Grabs __declspec(uuid()) off a type, or returns 0 if we cannot resolve to a single GUID. | |
static void | collectPublicBases (CXXRecordDecl *RD, llvm::DenseMap< CXXRecordDecl *, unsigned > &SubobjectsSeen, llvm::SmallPtrSetImpl< CXXRecordDecl * > &VBases, llvm::SetVector< CXXRecordDecl * > &PublicSubobjectsSeen, bool ParentIsPublic) |
static void | getUnambiguousPublicSubobjects (CXXRecordDecl *RD, llvm::SmallVectorImpl< CXXRecordDecl * > &Objects) |
static QualType | adjustCVQualifiersForCXXThisWithinLambda (ArrayRef< FunctionScopeInfo * > FunctionScopes, QualType ThisTy, DeclContext *CurSemaContext, ASTContext &ASTCtx) |
static void | buildLambdaThisCaptureFixit (Sema &Sema, LambdaScopeInfo *LSI) |
static bool | isNonPlacementDeallocationFunction (Sema &S, FunctionDecl *FD) |
Determine whether the given function is a non-placement deallocation function. | |
static bool | hasNewExtendedAlignment (Sema &S, QualType AllocType) |
Determine whether a type has new-extended alignment. | |
static UsualDeallocFnInfo | resolveDeallocationOverload (Sema &S, LookupResult &R, bool WantSize, bool WantAlign, llvm::SmallVectorImpl< UsualDeallocFnInfo > *BestFns=nullptr) |
Select the correct "usual" deallocation function to use from a selection of deallocation functions (either global or class-scope). | |
static bool | doesUsualArrayDeleteWantSize (Sema &S, SourceLocation loc, QualType allocType) |
Determine whether a given type is a class for which 'delete[]' would call a member 'operator delete[]' with a 'size_t' parameter. | |
static bool | isLegalArrayNewInitializer (CXXNewExpr::InitializationStyle Style, Expr *Init) |
static bool | resolveAllocationOverload (Sema &S, LookupResult &R, SourceRange Range, SmallVectorImpl< Expr * > &Args, bool &PassAlignment, FunctionDecl *&Operator, OverloadCandidateSet *AlignedCandidates, Expr *AlignArg, bool Diagnose) |
static void | DiagnoseMismatchedNewDelete (Sema &SemaRef, SourceLocation DeleteLoc, const MismatchingNewDeleteDetector &Detector) |
static bool | resolveBuiltinNewDeleteOverload (Sema &S, CallExpr *TheCall, bool IsDelete, FunctionDecl *&Operator) |
static ExprResult | BuildCXXCastArgument (Sema &S, SourceLocation CastLoc, QualType Ty, CastKind Kind, CXXMethodDecl *Method, DeclAccessPair FoundDecl, bool HadMultipleCandidates, Expr *From) |
static bool | CheckUnaryTypeTraitTypeCompleteness (Sema &S, TypeTrait UTT, SourceLocation Loc, QualType ArgTy) |
Check the completeness of a type in a unary type trait. | |
static bool | HasNoThrowOperator (const RecordType *RT, OverloadedOperatorKind Op, Sema &Self, SourceLocation KeyLoc, ASTContext &C, bool(CXXRecordDecl::*HasTrivial)() const, bool(CXXRecordDecl::*HasNonTrivial)() const, bool(CXXMethodDecl::*IsDesiredOp)() const) |
static bool | EvaluateUnaryTypeTrait (Sema &Self, TypeTrait UTT, SourceLocation KeyLoc, QualType T) |
static bool | EvaluateBinaryTypeTrait (Sema &Self, TypeTrait BTT, QualType LhsT, QualType RhsT, SourceLocation KeyLoc) |
static bool | EvaluateBooleanTypeTrait (Sema &S, TypeTrait Kind, SourceLocation KWLoc, ArrayRef< TypeSourceInfo * > Args, SourceLocation RParenLoc, bool IsDependent) |
static TypeTraitReturnType | GetReturnType (TypeTrait Kind) |
static uint64_t | EvaluateArrayTypeTrait (Sema &Self, ArrayTypeTrait ATT, QualType T, Expr *DimExpr, SourceLocation KeyLoc) |
static bool | EvaluateExpressionTrait (ExpressionTrait ET, Expr *E) |
static bool | TryClassUnification (Sema &Self, Expr *From, Expr *To, SourceLocation QuestionLoc, bool &HaveConversion, QualType &ToType) |
Try to convert a type to another according to C++11 5.16p3. | |
static bool | FindConditionalOverload (Sema &Self, ExprResult &LHS, ExprResult &RHS, SourceLocation QuestionLoc) |
Try to find a common type for two according to C++0x 5.16p5. | |
static bool | ConvertForConditional (Sema &Self, ExprResult &E, QualType T) |
Perform an "extended" implicit conversion as returned by TryClassUnification. | |
static bool | isValidVectorForConditionalCondition (ASTContext &Ctx, QualType CondTy) |
static bool | isValidSizelessVectorForConditionalCondition (ASTContext &Ctx, QualType CondTy) |
static void | noteOperatorArrows (Sema &S, ArrayRef< FunctionDecl * > OperatorArrows) |
Note a set of 'operator->' functions that were used for a member access. | |
static bool | CheckArrow (Sema &S, QualType &ObjectType, Expr *&Base, tok::TokenKind &OpKind, SourceLocation OpLoc) |
static bool | canRecoverDotPseudoDestructorCallsOnPointerObjects (Sema &SemaRef, QualType DestructedType) |
Check if it's ok to try and recover dot pseudo destructor calls on pointer objects. | |
static void | MaybeDecrementCount (Expr *E, llvm::DenseMap< const VarDecl *, int > &RefsMinusAssignments) |
static bool | VariableCanNeverBeAConstantExpression (VarDecl *Var, ASTContext &Context) |
static void | CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures (Expr *const FE, LambdaScopeInfo *const CurrentLSI, Sema &S) |
Check if the current lambda has any potential captures that must be captured by any of its enclosing lambdas that are ready to capture. | |
static ExprResult | attemptRecovery (Sema &SemaRef, const TypoCorrectionConsumer &Consumer, const TypoCorrection &TC) |
Implements semantic analysis for C++ expressions.
Definition in file SemaExprCXX.cpp.
|
strong |
Enumerator | |
---|---|
Bool |
Definition at line 5590 of file SemaExprCXX.cpp.
|
static |
Definition at line 1106 of file SemaExprCXX.cpp.
References clang::QualType::addConst(), clang::C, clang::sema::LambdaScopeInfo::CallOperator, clang::CXXRecordDecl::captures(), clang::sema::CapturingScopeInfo::getCXXThisCapture(), clang::Decl::getDeclContext(), clang::getLambdaAwareParentOfDeclContext(), clang::CXXRecordDecl::getLambdaCallOperator(), clang::DeclContext::getParent(), clang::Type::getPointeeType(), clang::ASTContext::getPointerType(), clang::CXXMethodDecl::isConst(), clang::sema::CapturingScopeInfo::isCXXThisCaptured(), clang::isGenericLambdaCallOperatorSpecialization(), clang::isLambdaCallOperator(), clang::sema::LambdaScopeInfo::Lambda, clang::LCK_StarThis, and clang::sema::LambdaScopeInfo::Mutable.
Referenced by clang::Sema::getCurrentThisType().
|
static |
Definition at line 8403 of file SemaExprCXX.cpp.
References clang::LookupResult::addDecl(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildPossibleImplicitMemberExpr(), clang::Sema::Consumer, clang::Sema::Context, clang::TypoCorrection::getCorrectionRange(), clang::TypoCorrection::getCorrectionSpecifier(), clang::TypoCorrection::getFoundDecl(), clang::CXXScopeSpec::isEmpty(), clang::LookupResult::isOverloadedResult(), clang::LookupResult::isUnresolvableResult(), clang::Sema::LookupInObjCMethod(), clang::CXXScopeSpec::MakeTrivial(), clang::LookupResult::setLookupName(), clang::LookupResult::setNamingClass(), and clang::TypoCorrection::WillReplaceSpecifier().
|
static |
Definition at line 4104 of file SemaExprCXX.cpp.
References clang::Sema::BuildCXXConstructExpr(), clang::Sema::BuildCXXMemberCallExpr(), clang::Sema::CheckConstructorAccess(), clang::Sema::CheckMemberOperatorAccess(), clang::CXXConstructExpr::CK_Complete, clang::Sema::CompleteConstructorCall(), clang::Sema::Context, clang::ImplicitCastExpr::Create(), clang::Sema::CurFPFeatureOverrides(), clang::Sema::DiagnoseUseOfDecl(), clang::ExprError(), clang::Expr::getType(), clang::InitializedEntity::InitializeTemporary(), clang::Type::isPointerType(), clang::Sema::MaybeBindToTemporary(), clang::Sema::RequireNonAbstractType(), and clang::Result.
Referenced by clang::Sema::PerformImplicitConversion().
|
static |
Definition at line 1275 of file SemaExprCXX.cpp.
References clang::FixItHint::CreateInsertion(), clang::Sema::Diag(), clang::SourceRange::getEnd(), clang::Sema::getLangOpts(), clang::sema::CapturingScopeInfo::ImpCap_LambdaByval, clang::sema::CapturingScopeInfo::ImpCaptureStyle, clang::sema::LambdaScopeInfo::IntroducerRange, clang::sema::CapturingScopeInfo::isCXXThisCaptured(), and clang::sema::LambdaScopeInfo::NumExplicitCaptures.
Referenced by clang::Sema::CheckCXXThisCapture().
|
static |
Check if it's ok to try and recover dot pseudo destructor calls on pointer objects.
Definition at line 7748 of file SemaExprCXX.cpp.
References clang::Sema::CanUseDecl(), clang::Type::getAsCXXRecordDecl(), clang::CXXRecordDecl::hasDefinition(), clang::Type::isDependentType(), clang::Type::isScalarType(), clang::Type::isVectorType(), and clang::Sema::LookupDestructor().
Referenced by clang::Sema::BuildPseudoDestructorExpr().
|
static |
Definition at line 7700 of file SemaExprCXX.cpp.
References clang::Sema::CheckPlaceholderExpr(), clang::FixItHint::CreateReplacement(), clang::Sema::DefaultFunctionArrayLvalueConversion(), clang::Sema::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Type::getPointeeType(), clang::Type::isArrayType(), clang::Type::isFunctionType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isPointerType(), and clang::Sema::isSFINAEContext().
Referenced by clang::Sema::ActOnPseudoDestructorExpr(), and clang::Sema::BuildPseudoDestructorExpr().
|
static |
Check if the current lambda has any potential captures that must be captured by any of its enclosing lambdas that are ready to capture.
If there is a lambda that can capture a nested potential-capture, go ahead and do so. Also, check to see if any variables are uncaptureable or do not involve an odr-use so do not need to be captured.
Definition at line 8315 of file SemaExprCXX.cpp.
References clang::sema::LambdaScopeInfo::CallOperator, clang::Sema::CheckCXXThisCapture(), clang::sema::LambdaScopeInfo::clearPotentialCaptures(), clang::Sema::Context, clang::Sema::CurContext, clang::Sema::FunctionScopes, clang::Expr::getExprLoc(), clang::DeclContext::getParent(), clang::ValueDecl::getPotentiallyDecomposedVarDecl(), clang::getStackIndexOfNearestEnclosingCaptureCapableLambda(), clang::sema::LambdaScopeInfo::hasPotentialThisCapture(), clang::if(), clang::DeclContext::isDependentContext(), clang::Expr::isInstantiationDependent(), clang::Sema::isUnevaluatedContext(), clang::sema::LambdaScopeInfo::isVariableExprMarkedAsNonODRUsed(), clang::Sema::MarkCaptureUsedInEnclosingContext(), clang::sema::LambdaScopeInfo::PotentialThisCaptureLocation, clang::Sema::TryCapture_Implicit, clang::Sema::tryCaptureVariable(), VariableCanNeverBeAConstantExpression(), and clang::sema::LambdaScopeInfo::visitPotentialCaptures().
Referenced by clang::Sema::ActOnFinishFullExpr().
|
static |
Check the completeness of a type in a unary type trait.
If the particular type trait requires a complete type, tries to complete it. If completing the type fails, a diagnostic is emitted and false returned. If completing the type succeeds or no completion was required, returns true.
Definition at line 4798 of file SemaExprCXX.cpp.
References clang::Type::getAsCXXRecordDecl(), clang::Type::getBaseElementTypeUnsafe(), clang::Type::isArrayType(), clang::Type::isIncompleteArrayType(), clang::TagDecl::isUnion(), clang::Type::isVoidType(), and clang::Sema::RequireCompleteType().
Referenced by clang::Sema::BuildTypeTrait().
|
static |
Definition at line 931 of file SemaExprCXX.cpp.
References clang::AS_public, clang::CXXRecordDecl::bases(), and collectPublicBases().
Referenced by collectPublicBases(), and getUnambiguousPublicSubobjects().
|
static |
Perform an "extended" implicit conversion as returned by TryClassUnification.
Definition at line 6294 of file SemaExprCXX.cpp.
References clang::InitializationKind::CreateCopy(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::InitializedEntity::InitializeTemporary(), clang::InitializationSequence::Perform(), and clang::Result.
Referenced by clang::Sema::CXXCheckConditionalOperands().
|
static |
Definition at line 3523 of file SemaExprCXX.cpp.
References clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::Sema::Diag(), clang::Lexer::findLocationAfterToken(), clang::Sema::getLangOpts(), clang::Sema::getLocForEndOfToken(), clang::Sema::getSourceManager(), and clang::SourceLocation::isValid().
|
static |
Determine whether a given type is a class for which 'delete[]' would call a member 'operator delete[]' with a 'size_t' parameter.
This implies that we need to store the array size (even if the type is trivially-destructible).
Definition at line 1803 of file SemaExprCXX.cpp.
References clang::Sema::Context, clang::ASTContext::DeclarationNames, clang::LookupResult::empty(), clang::Type::getAs(), clang::Type::getBaseElementTypeUnsafe(), clang::DeclarationNameTable::getCXXOperatorName(), clang::RecordType::getDecl(), hasNewExtendedAlignment(), clang::LookupResult::isAmbiguous(), clang::Sema::LookupOrdinaryName, clang::Sema::LookupQualifiedName(), resolveDeallocationOverload(), and clang::LookupResult::suppressDiagnostics().
Referenced by clang::Sema::ActOnCXXDelete(), and clang::Sema::BuildCXXNew().
|
static |
Definition at line 5868 of file SemaExprCXX.cpp.
References clang::Sema::Context, clang::Sema::Diag(), clang::ASTContext::getAsArrayType(), clang::ASTContext::getAsConstantArrayType(), clang::Stmt::getSourceRange(), clang::Type::isArrayType(), clang::Type::isDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::Sema::VerifyIntegerConstantExpression().
Referenced by clang::Sema::BuildArrayTypeTrait().
|
static |
Definition at line 5647 of file SemaExprCXX.cpp.
References clang::Sema::BuildBinOp(), clang::Sema::canThrow(), clang::Sema::CheckUnusedVolatileAssignment(), clang::Sema::Context, clang::InitializationKind::CreateCopy(), clang::CT_Cannot, clang::Type::getAs(), clang::Sema::getASTContext(), clang::RecordType::getDecl(), clang::ObjCObjectType::getInterface(), clang::QualType::getNonLValueExprType(), clang::QualType::getNonReferenceType(), clang::ASTContext::getRValueReferenceType(), clang::ASTContext::getTranslationUnitDecl(), clang::ASTContext::getUnqualifiedArrayType(), clang::Expr::getValueKindForType(), clang::Sema::SFINAETrap::hasErrorOccurred(), clang::QualType::hasNonTrivialObjCLifetime(), clang::ASTContext::hasSameType(), clang::ASTContext::hasSameUnqualifiedType(), clang::InitializedEntity::InitializeTemporary(), clang::Sema::isAbstractType(), clang::Type::isArrayType(), clang::Sema::isCompleteType(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::Type::isIncompleteArrayType(), clang::Type::isObjectType(), clang::ObjCInterfaceDecl::isSuperClassOf(), clang::TagDecl::isUnion(), clang::Type::isVoidType(), clang::Sema::RequireCompleteType(), clang::Result, clang::ASTContext::typesAreCompatible(), and clang::Sema::Unevaluated.
Referenced by EvaluateBooleanTypeTrait().
|
static |
Definition at line 5402 of file SemaExprCXX.cpp.
References clang::BTT_Last, clang::Sema::BuiltinRemoveReference(), clang::Sema::canThrow(), clang::Sema::Context, clang::InitializationKind::CreateDirect(), clang::CT_Cannot, EvaluateBinaryTypeTrait(), EvaluateUnaryTypeTrait(), clang::Type::getAsCXXRecordDecl(), clang::QualType::getNonLValueExprType(), clang::QualType::getNonReferenceType(), clang::ASTContext::getPointerType(), clang::ASTContext::getRValueReferenceType(), clang::ASTContext::getTranslationUnitDecl(), clang::Expr::getValueKindForType(), clang::Sema::SFINAETrap::hasErrorOccurred(), clang::QualType::hasNonTrivialObjCLifetime(), clang::InitializedEntity::InitializeTemporary(), clang::CXXRecordDecl::isAbstract(), clang::Type::isFunctionType(), clang::Type::isIncompleteArrayType(), clang::Type::isIncompleteType(), clang::Type::isObjectType(), clang::Type::isReferenceType(), clang::Type::isVoidType(), clang::Sema::RequireCompleteType(), clang::Result, clang::Sema::Unevaluated, and clang::UTT_Last.
Referenced by clang::Sema::BuildTypeTrait().
|
static |
Definition at line 5957 of file SemaExprCXX.cpp.
References clang::Expr::isLValue(), and clang::Expr::isPRValue().
Referenced by clang::Sema::BuildExpressionTrait().
|
static |
Definition at line 4967 of file SemaExprCXX.cpp.
References clang::AS_public, clang::C, clang::RecordDecl::canPassInRegisters(), clang::Sema::Context, clang::Sema::Diag(), clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), clang::FunctionProtoType::getNumParams(), clang::QualType::getObjCLifetime(), clang::Decl::hasAttr(), clang::CXXRecordDecl::hasNonTrivialCopyAssignment(), clang::CXXRecordDecl::hasNonTrivialCopyConstructor(), clang::CXXRecordDecl::hasNonTrivialDefaultConstructor(), clang::CXXRecordDecl::hasNonTrivialMoveAssignment(), clang::CXXRecordDecl::hasNonTrivialMoveConstructor(), HasNoThrowOperator(), clang::QualType::hasQualifiers(), clang::CXXRecordDecl::hasTrivialCopyAssignment(), clang::CXXRecordDecl::hasTrivialCopyConstructor(), clang::CXXRecordDecl::hasTrivialDefaultConstructor(), clang::CXXRecordDecl::hasTrivialDestructor(), clang::CXXRecordDecl::hasTrivialMoveAssignment(), clang::CXXRecordDecl::hasTrivialMoveConstructor(), clang::CXXRecordDecl::isAbstract(), clang::Type::isAggregateType(), clang::Type::isAnyComplexType(), clang::Type::isAnyPointerType(), clang::Type::isArithmeticType(), clang::Type::isArrayType(), clang::Type::isClassType(), clang::Type::isCompoundType(), clang::QualType::isConstQualified(), clang::CXXMethodDecl::isCopyAssignmentOperator(), clang::Type::isDependentType(), clang::QualType::isDestructedType(), clang::CXXRecordDecl::isEmpty(), clang::Type::isEnumeralType(), clang::Type::isExtVectorType(), clang::Type::isFloatingType(), clang::Type::isFunctionType(), clang::Type::isFundamentalType(), clang::Type::isIncompleteArrayType(), clang::Type::isIncompleteType(), clang::Type::isIntegralType(), clang::Type::isInterfaceType(), clang::Type::isLiteralType(), clang::Type::isLValueReferenceType(), clang::Type::isMemberDataPointerType(), clang::Type::isMemberFunctionPointerType(), clang::Type::isMemberPointerType(), clang::CXXMethodDecl::isMoveAssignmentOperator(), clang::FunctionProtoType::isNothrow(), clang::Type::isNullPtrType(), clang::Type::isObjCLifetimeType(), clang::Type::isObjectType(), clang::QualType::isPODType(), clang::CXXRecordDecl::isPolymorphic(), clang::QualType::isReferenceable(), clang::Type::isReferenceType(), clang::Type::isRValueReferenceType(), clang::Type::isScalarType(), clang::Type::isScopedEnumeralType(), clang::Type::isSignedIntegerType(), clang::Type::isStandardLayoutType(), clang::Type::isStructureType(), clang::QualType::isTriviallyCopyableType(), clang::QualType::isTriviallyEqualityComparableType(), clang::QualType::isTriviallyRelocatableType(), clang::QualType::isTrivialType(), clang::TagDecl::isUnion(), clang::Type::isUnionType(), clang::Type::isUnsignedIntegerType(), clang::Type::isVariableArrayType(), clang::Type::isVectorType(), clang::Type::isVoidType(), clang::QualType::isVolatileQualified(), clang::Sema::LookupConstructors(), clang::Sema::LookupDestructor(), clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, and clang::Sema::ResolveExceptionSpec().
Referenced by EvaluateBooleanTypeTrait().
|
static |
Try to find a common type for two according to C++0x 5.16p5.
This is part of the parameter validation for the ? operator. If either value operand is a class type, overload resolution is used to find a conversion to a common type.
Definition at line 6235 of file SemaExprCXX.cpp.
References clang::Sema::AA_Converting, clang::Sema::AddBuiltinOperatorCandidates(), clang::OverloadCandidateSet::BestViableFunction(), clang::OverloadCandidateSet::CSK_Operator, clang::Sema::Diag(), clang::Sema::DiagnoseConditionalForNull(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Sema::MarkFunctionReferenced(), clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, and clang::Sema::PerformImplicitConversion().
Referenced by clang::Sema::CXXCheckConditionalOperands().
|
static |
Definition at line 5594 of file SemaExprCXX.cpp.
|
static |
Definition at line 960 of file SemaExprCXX.cpp.
References collectPublicBases().
Referenced by clang::Sema::CheckCXXThrowOperand().
|
static |
Grabs __declspec(uuid()) off a type, or returns 0 if we cannot resolve to a single GUID.
Definition at line 711 of file SemaExprCXX.cpp.
References clang::TemplateArgumentList::asArray(), clang::TemplateArgument::Declaration, clang::Type::getAsTagDecl(), clang::Type::getBaseElementTypeUnsafe(), clang::Type::getPointeeType(), clang::QualType::getTypePtr(), getUuidAttrOfType(), clang::Type::isArrayType(), clang::Type::isPointerType(), clang::Type::isReferenceType(), and clang::TemplateArgument::Type.
Referenced by clang::Sema::BuildCXXUuidof(), and getUuidAttrOfType().
Determine whether a type has new-extended alignment.
This may be called when the type is incomplete (for a delete-expression with an incomplete pointee type), in which case it will conservatively return false if the alignment is not known.
Definition at line 1757 of file SemaExprCXX.cpp.
References clang::Sema::getASTContext(), clang::Sema::getLangOpts(), clang::TargetInfo::getNewAlign(), clang::ASTContext::getTargetInfo(), and clang::ASTContext::getTypeAlignIfKnown().
Referenced by clang::Sema::ActOnCXXDelete(), doesUsualArrayDeleteWantSize(), clang::Sema::FindAllocationFunctions(), clang::Sema::FindDeallocationFunction(), and clang::Sema::FindDeallocationFunctionForDestructor().
|
static |
Definition at line 4932 of file SemaExprCXX.cpp.
References clang::LookupResult::begin(), clang::C, clang::Type::castAs(), clang::LookupResult::end(), clang::RecordType::getDecl(), clang::ValueDecl::getType(), clang::FunctionProtoType::isNothrow(), clang::Sema::LookupOrdinaryName, clang::Sema::LookupQualifiedName(), clang::Sema::ResolveExceptionSpec(), and clang::LookupResult::suppressDiagnostics().
Referenced by EvaluateUnaryTypeTrait().
|
static |
Definition at line 1923 of file SemaExprCXX.cpp.
References clang::CXXNewExpr::ListInit.
Referenced by clang::Sema::BuildCXXNew().
|
static |
Determine whether the given function is a non-placement deallocation function.
Definition at line 1661 of file SemaExprCXX.cpp.
References clang::Sema::Context, clang::Sema::getLangOpts(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getOverloadedOperator(), clang::FunctionDecl::getParamDecl(), clang::ASTContext::getSizeType(), clang::Sema::getStdAlignValT(), clang::ValueDecl::getType(), clang::ASTContext::getTypeDeclType(), clang::ASTContext::hasSameUnqualifiedType(), and clang::Sema::isUsualDeallocationFunction().
Referenced by clang::Sema::FindAllocationFunctions(), and resolveDeallocationOverload().
|
static |
Definition at line 6320 of file SemaExprCXX.cpp.
References clang::QualType::getCanonicalType(), clang::Type::getSveEltType(), clang::Type::isEnumeralType(), clang::Type::isIntegralType(), and clang::Type::isSveVLSBuiltinType().
Referenced by clang::Sema::CXXCheckConditionalOperands().
|
static |
Definition at line 6310 of file SemaExprCXX.cpp.
References clang::QualType::getCanonicalType(), clang::Type::isEnumeralType(), clang::Type::isExtVectorType(), clang::Type::isIntegralType(), and clang::Type::isVectorType().
Referenced by clang::Sema::CXXCheckConditionalOperands().
|
static |
Definition at line 8149 of file SemaExprCXX.cpp.
References clang::DeclRefExpr::getDecl(), clang::ValueDecl::getType(), clang::QualType::isVolatileQualified(), and clang::Sema::RefsMinusAssignments.
Referenced by clang::Sema::IgnoredValueConversions().
|
static |
Note a set of 'operator->' functions that were used for a member access.
Definition at line 7531 of file SemaExprCXX.cpp.
References clang::Sema::Diag().
Referenced by clang::Sema::ActOnStartCXXMemberReference().
|
static |
Definition at line 2490 of file SemaExprCXX.cpp.
References clang::Sema::AddOverloadCandidate(), clang::Sema::AddTemplateOverloadCandidate(), clang::Sema::AR_inaccessible, clang::LookupResult::begin(), clang::OverloadCandidateSet::BestViableFunction(), clang::C, clang::Sema::CheckAllocationAccess(), clang::LookupResult::clear(), clang::OverloadCandidateSet::CompleteCandidates(), clang::Sema::Context, clang::OverloadCandidateSet::CSK_Normal, clang::ASTContext::DeclarationNames, clang::Sema::Diag(), clang::Sema::Diagnose, clang::LookupResult::end(), clang::DeclarationNameTable::getCXXOperatorName(), clang::DeclarationName::getCXXOverloadedOperator(), clang::ASTContext::getLangOpts(), clang::LookupResult::getLookupName(), clang::LookupResult::getNameLoc(), clang::LookupResult::getNamingClass(), clang::ASTContext::getTranslationUnitDecl(), clang::NamedDecl::getUnderlyingDecl(), clang::LookupResult::isClassLookup(), clang::Sema::LookupQualifiedName(), clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::Sema::PDiag(), resolveAllocationOverload(), and clang::LookupResult::setLookupName().
Referenced by clang::Sema::FindAllocationFunctions(), and resolveAllocationOverload().
|
static |
Definition at line 3809 of file SemaExprCXX.cpp.
References clang::Sema::AddOverloadCandidate(), clang::Sema::AddTemplateOverloadCandidate(), clang::CallExpr::arguments(), clang::LookupResult::begin(), clang::OverloadCandidateSet::BestViableFunction(), clang::Sema::Context, clang::OverloadCandidateSet::CSK_Normal, clang::ASTContext::DeclarationNames, clang::Sema::Diag(), clang::LookupResult::empty(), clang::LookupResult::end(), clang::CallExpr::getBeginLoc(), clang::DeclarationNameTable::getCXXOperatorName(), clang::Decl::getLocation(), clang::LookupResult::getLookupName(), clang::LookupResult::getNameLoc(), clang::LookupResult::getNamingClass(), clang::Stmt::getSourceRange(), clang::FunctionDecl::getSourceRange(), clang::ASTContext::getTranslationUnitDecl(), clang::LookupResult::isAmbiguous(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), clang::Sema::LookupOrdinaryName, clang::Sema::LookupQualifiedName(), clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::Sema::PDiag(), and clang::LookupResult::suppressDiagnostics().
|
static |
Select the correct "usual" deallocation function to use from a selection of deallocation functions (either global or class-scope).
Definition at line 1765 of file SemaExprCXX.cpp.
References clang::LookupResult::begin(), clang::Sema::CFP_Never, clang::LookupResult::end(), and isNonPlacementDeallocationFunction().
Referenced by doesUsualArrayDeleteWantSize(), clang::Sema::FindAllocationFunctions(), clang::Sema::FindDeallocationFunction(), and clang::Sema::FindUsualDeallocationFunction().
|
static |
Try to convert a type to another according to C++11 5.16p3.
This is part of the parameter validation for the ? operator. If either value operand is a class type, the two operands are attempted to be converted to each other. This function does the conversion in one direction. It returns true if the program is ill-formed and has already been diagnosed as such.
Definition at line 6145 of file SemaExprCXX.cpp.
References clang::Sema::Context, clang::InitializationKind::CreateCopy(), clang::InitializationSequence::Diagnose(), clang::InitializationSequence::Failed(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::QualType::getNonLValueExprType(), clang::ASTContext::getReferenceQualifiedType(), clang::Expr::getType(), clang::InitializedEntity::InitializeTemporary(), clang::InitializationSequence::isAmbiguous(), clang::QualType::isAtLeastAsQualifiedAs(), clang::Sema::IsDerivedFrom(), clang::InitializationSequence::isDirectReferenceBinding(), and clang::Expr::isGLValue().
Referenced by clang::Sema::CXXCheckConditionalOperands().
|
inlinestatic |
Definition at line 8285 of file SemaExprCXX.cpp.
References clang::Sema::Context, clang::VarDecl::getAnyInitializer(), clang::ValueDecl::getType(), clang::Type::isDependentType(), clang::VarDecl::isUsableInConstantExpressions(), and clang::ValueDecl::isWeak().
Referenced by CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures().