clang
10.0.0git
|
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTLambda.h"
#include "clang/AST/ASTMutationListener.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/CharUnits.h"
#include "clang/AST/ComparisonCategories.h"
#include "clang/AST/EvaluatedExprVisitor.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/RecordLayout.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/AST/TypeLoc.h"
#include "clang/AST/TypeOrdering.h"
#include "clang/Basic/AttributeCommonInfo.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Lex/LiteralSupport.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/CXXFieldCollector.h"
#include "clang/Sema/DeclSpec.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/Template.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include <map>
#include <set>
#include "clang/AST/TypeLocNodes.def"
#include "clang/Basic/OperatorKinds.def"
Go to the source code of this file.
Classes | |
class | clang::Sema::InheritedConstructorInfo |
Macros | |
#define | ABSTRACT_TYPELOC(CLASS, PARENT) |
#define | TYPELOC(CLASS, PARENT) case TypeLoc::CLASS: Check(TL.castAs<CLASS##TypeLoc>(), Sel); break; |
#define | CheckPolymorphic(Type) |
#define | OVERLOADED_OPERATOR(Name, Spelling, Token, Unary, Binary, MemberOnly) , { Unary, Binary, MemberOnly } |
Typedefs | |
typedef llvm::SmallPtrSet< QualType, 4 > | IndirectBaseSet |
Use small set to collect indirect bases. More... | |
Enumerations | |
enum | IsTupleLike |
enum | ImplicitInitializerKind { IIK_Default, IIK_Copy, IIK_Move, IIK_Inherit } |
ImplicitInitializerKind - How an implicit base or member initializer should initialize its base or member. More... | |
enum | TrivialSubobjectKind { TSK_BaseClass, TSK_Field, TSK_CompleteObject } |
The kind of subobject we are checking for triviality. More... | |
enum | UnsupportedSTLSelect |
Functions | |
static bool | functionDeclHasDefaultArgument (const FunctionDecl *FD) |
static bool | checkSimpleDecomposition (Sema &S, ArrayRef< BindingDecl *> Bindings, ValueDecl *Src, QualType DecompType, const llvm::APSInt &NumElems, QualType ElemType, llvm::function_ref< ExprResult(SourceLocation, Expr *, unsigned)> GetInit) |
static bool | checkArrayLikeDecomposition (Sema &S, ArrayRef< BindingDecl *> Bindings, ValueDecl *Src, QualType DecompType, const llvm::APSInt &NumElems, QualType ElemType) |
static bool | checkArrayDecomposition (Sema &S, ArrayRef< BindingDecl *> Bindings, ValueDecl *Src, QualType DecompType, const ConstantArrayType *CAT) |
static bool | checkVectorDecomposition (Sema &S, ArrayRef< BindingDecl *> Bindings, ValueDecl *Src, QualType DecompType, const VectorType *VT) |
static bool | checkComplexDecomposition (Sema &S, ArrayRef< BindingDecl *> Bindings, ValueDecl *Src, QualType DecompType, const ComplexType *CT) |
static std::string | printTemplateArgs (const PrintingPolicy &PrintingPolicy, TemplateArgumentListInfo &Args) |
static bool | lookupStdTypeTraitMember (Sema &S, LookupResult &TraitMemberLookup, SourceLocation Loc, StringRef Trait, TemplateArgumentListInfo &Args, unsigned DiagID) |
static TemplateArgumentLoc | getTrivialIntegralTemplateArgument (Sema &S, SourceLocation Loc, QualType T, uint64_t I) |
static TemplateArgumentLoc | getTrivialTypeTemplateArgument (Sema &S, SourceLocation Loc, QualType T) |
static IsTupleLike | isTupleLike (Sema &S, SourceLocation Loc, QualType T, llvm::APSInt &Size) |
static QualType | getTupleLikeElementType (Sema &S, SourceLocation Loc, unsigned I, QualType T) |
static bool | checkTupleLikeDecomposition (Sema &S, ArrayRef< BindingDecl *> Bindings, VarDecl *Src, QualType DecompType, const llvm::APSInt &TupleSize) |
static DeclAccessPair | findDecomposableBaseClass (Sema &S, SourceLocation Loc, const CXXRecordDecl *RD, CXXCastPath &BasePath) |
Find the base class to decompose in a built-in decomposition of a class type. More... | |
static bool | checkMemberDecomposition (Sema &S, ArrayRef< BindingDecl *> Bindings, ValueDecl *Src, QualType DecompType, const CXXRecordDecl *OrigRD) |
template<typename... Ts> | |
static bool | CheckLiteralType (Sema &SemaRef, Sema::CheckConstexprKind Kind, SourceLocation Loc, QualType T, unsigned DiagID, Ts &&...DiagArgs) |
Check that the given type is a literal type. More... | |
static bool | CheckConstexprDestructorSubobjects (Sema &SemaRef, const CXXDestructorDecl *DD, Sema::CheckConstexprKind Kind) |
Determine whether a destructor cannot be constexpr due to. More... | |
static bool | CheckConstexprParameterTypes (Sema &SemaRef, const FunctionDecl *FD, Sema::CheckConstexprKind Kind) |
Check whether a function's parameter types are all literal types. More... | |
static bool | CheckConstexprReturnType (Sema &SemaRef, const FunctionDecl *FD, Sema::CheckConstexprKind Kind) |
Check whether a function's return type is a literal type. More... | |
static unsigned | getRecordDiagFromTagKind (TagTypeKind Tag) |
Get diagnostic select index for tag kind for record diagnostic message. More... | |
static bool | CheckConstexprFunctionBody (Sema &SemaRef, const FunctionDecl *Dcl, Stmt *Body, Sema::CheckConstexprKind Kind) |
Check the body for the given constexpr function declaration only contains the permitted types of statement. More... | |
static bool | CheckConstexprDeclStmt (Sema &SemaRef, const FunctionDecl *Dcl, DeclStmt *DS, SourceLocation &Cxx1yLoc, Sema::CheckConstexprKind Kind) |
Check the given declaration statement is legal within a constexpr function body. More... | |
static bool | CheckConstexprCtorInitializer (Sema &SemaRef, const FunctionDecl *Dcl, FieldDecl *Field, llvm::SmallSet< Decl *, 16 > &Inits, bool &Diagnosed, Sema::CheckConstexprKind Kind) |
Check that the given field is initialized within a constexpr constructor. More... | |
static bool | CheckConstexprFunctionStmt (Sema &SemaRef, const FunctionDecl *Dcl, Stmt *S, SmallVectorImpl< SourceLocation > &ReturnStmts, SourceLocation &Cxx1yLoc, SourceLocation &Cxx2aLoc, Sema::CheckConstexprKind Kind) |
Check the provided statement is allowed in a constexpr function definition. More... | |
static bool | findCircularInheritance (const CXXRecordDecl *Class, const CXXRecordDecl *Current) |
Determine whether the given class is a base class of the given class, including looking at dependent bases. More... | |
static void | NoteIndirectBases (ASTContext &Context, IndirectBaseSet &Set, const QualType &Type) |
Recursively add the bases of Type. Don't add Type itself. More... | |
static void | BuildBasePathArray (const CXXBasePath &Path, CXXCastPath &BasePathArray) |
static bool | InitializationHasSideEffects (const FieldDecl &FD) |
static const ParsedAttr * | getMSPropertyAttr (const ParsedAttributesView &list) |
static bool | FindBaseInitializer (Sema &SemaRef, CXXRecordDecl *ClassDecl, QualType BaseType, const CXXBaseSpecifier *&DirectBaseSpec, const CXXBaseSpecifier *&VirtualBaseSpec) |
Find the direct and/or virtual base specifiers that correspond to the given base type, for use in base initialization within a constructor. More... | |
static Expr * | CastForMoving (Sema &SemaRef, Expr *E, QualType T=QualType()) |
static bool | BuildImplicitBaseInitializer (Sema &SemaRef, CXXConstructorDecl *Constructor, ImplicitInitializerKind ImplicitInitKind, CXXBaseSpecifier *BaseSpec, bool IsInheritedVirtualBase, CXXCtorInitializer *&CXXBaseInit) |
static bool | RefersToRValueRef (Expr *MemRef) |
static bool | BuildImplicitMemberInitializer (Sema &SemaRef, CXXConstructorDecl *Constructor, ImplicitInitializerKind ImplicitInitKind, FieldDecl *Field, IndirectFieldDecl *Indirect, CXXCtorInitializer *&CXXMemberInit) |
static bool | isIncompleteOrZeroLengthArrayType (ASTContext &Context, QualType T) |
Determine whether the given type is an incomplete or zero-lenfgth array type. More... | |
static bool | CollectFieldInitializer (Sema &SemaRef, BaseAndFieldInfo &Info, FieldDecl *Field, IndirectFieldDecl *Indirect=nullptr) |
static void | PopulateKeysForFields (FieldDecl *Field, SmallVectorImpl< const void *> &IdealInits) |
static const void * | GetKeyForBase (ASTContext &Context, QualType BaseType) |
static const void * | GetKeyForMember (ASTContext &Context, CXXCtorInitializer *Member) |
static void | DiagnoseBaseOrMemInitializerOrder (Sema &SemaRef, const CXXConstructorDecl *Constructor, ArrayRef< CXXCtorInitializer *> Inits) |
static void | CheckAbstractClassUsage (AbstractUsageInfo &Info, CXXMethodDecl *MD) |
Check for invalid uses of an abstract type in a method declaration. More... | |
static void | CheckAbstractClassUsage (AbstractUsageInfo &Info, CXXRecordDecl *RD) |
Check for invalid uses of an abstract type within a class definition. More... | |
static void | ReferenceDllExportedMembers (Sema &S, CXXRecordDecl *Class) |
static void | checkForMultipleExportedDefaultConstructors (Sema &S, CXXRecordDecl *Class) |
static void | DefineImplicitSpecialMember (Sema &S, CXXMethodDecl *MD, SourceLocation DefaultLoc) |
static bool | canPassInRegisters (Sema &S, CXXRecordDecl *D, TargetInfo::CallingConvKind CCK) |
Determine whether a type is permitted to be passed or returned in registers, per C++ [class.temporary]p3. More... | |
static Sema::SpecialMemberOverloadResult | lookupCallFromSpecialMember (Sema &S, CXXRecordDecl *Class, Sema::CXXSpecialMember CSM, unsigned FieldQuals, bool ConstRHS) |
Look up the special member function that would be called by a special member function for a subobject of class type. More... | |
static bool | specialMemberIsConstexpr (Sema &S, CXXRecordDecl *ClassDecl, Sema::CXXSpecialMember CSM, unsigned Quals, bool ConstRHS, CXXConstructorDecl *InheritedCtor=nullptr, Sema::InheritedConstructorInfo *Inherited=nullptr) |
Is the special member function which would be selected to perform the specified operation on the specified class type a constexpr constructor? More... | |
static bool | defaultedSpecialMemberIsConstexpr (Sema &S, CXXRecordDecl *ClassDecl, Sema::CXXSpecialMember CSM, bool ConstArg, CXXConstructorDecl *InheritedCtor=nullptr, Sema::InheritedConstructorInfo *Inherited=nullptr) |
Determine whether the specified special member function would be constexpr if it were implicitly defined. More... | |
static Sema::ImplicitExceptionSpecification | ComputeDefaultedSpecialMemberExceptionSpec (Sema &S, SourceLocation Loc, CXXMethodDecl *MD, Sema::CXXSpecialMember CSM, Sema::InheritedConstructorInfo *ICI) |
static Sema::ImplicitExceptionSpecification | ComputeDefaultedComparisonExceptionSpec (Sema &S, SourceLocation Loc, FunctionDecl *FD, Sema::DefaultedComparisonKind DCK) |
static Sema::ImplicitExceptionSpecification | computeImplicitExceptionSpec (Sema &S, SourceLocation Loc, FunctionDecl *FD) |
static FunctionProtoType::ExtProtoInfo | getImplicitMethodEPI (Sema &S, CXXMethodDecl *MD) |
static void | lookupOperatorsForDefaultedComparison (Sema &Self, Scope *S, UnresolvedSetImpl &Operators, OverloadedOperatorKind Op) |
Perform the unqualified lookups that might be needed to form a defaulted comparison function for the given operator. More... | |
static bool | findTrivialSpecialMember (Sema &S, CXXRecordDecl *RD, Sema::CXXSpecialMember CSM, unsigned Quals, bool ConstRHS, Sema::TrivialABIHandling TAH, CXXMethodDecl **Selected) |
Perform lookup for a special member of the specified kind, and determine whether it is trivial. More... | |
static CXXConstructorDecl * | findUserDeclaredCtor (CXXRecordDecl *RD) |
static bool | checkTrivialSubobjectCall (Sema &S, SourceLocation SubobjLoc, QualType SubType, bool ConstRHS, Sema::CXXSpecialMember CSM, TrivialSubobjectKind Kind, Sema::TrivialABIHandling TAH, bool Diagnose) |
Check whether the special member selected for a given type would be trivial. More... | |
static bool | checkTrivialClassMembers (Sema &S, CXXRecordDecl *RD, Sema::CXXSpecialMember CSM, bool ConstArg, Sema::TrivialABIHandling TAH, bool Diagnose) |
Check whether the members of a class type allow a special member to be trivial. More... | |
static void | AddMostOverridenMethods (const CXXMethodDecl *MD, llvm::SmallPtrSetImpl< const CXXMethodDecl *> &Methods) |
Add the most overriden methods from MD to Methods. More... | |
static void | findImplicitlyDeclaredEqualityComparisons (ASTContext &Ctx, CXXRecordDecl *RD, llvm::SmallVectorImpl< FunctionDecl *> &Spaceships) |
Find the equality comparison functions that should be implicitly declared in a given class definition, per C++2a [class.compare.default]p3. More... | |
static void | checkMethodTypeQualifiers (Sema &S, Declarator &D, unsigned DiagID) |
static void | extendLeft (SourceRange &R, SourceRange Before) |
static void | extendRight (SourceRange &R, SourceRange After) |
static void | DiagnoseNamespaceInlineMismatch (Sema &S, SourceLocation KeywordLoc, SourceLocation Loc, IdentifierInfo *II, bool *IsInline, NamespaceDecl *PrevNS) |
Diagnose a mismatch in 'inline' qualifiers when a namespace is reopened. More... | |
static NamespaceDecl * | getNamespaceDecl (NamedDecl *D) |
getNamespaceDecl - Returns the namespace a decl represents. More... | |
static ClassTemplateDecl * | LookupStdInitializerList (Sema &S, SourceLocation Loc) |
static bool | IsUsingDirectiveInToplevelContext (DeclContext *CurContext) |
Determine whether a using statement is in a context where it will be apply in all contexts. More... | |
static bool | TryNamespaceTypoCorrection (Sema &S, LookupResult &R, Scope *Sc, CXXScopeSpec &SS, SourceLocation IdentLoc, IdentifierInfo *Ident) |
static bool | IsEquivalentForUsingDecl (ASTContext &Context, NamedDecl *D1, NamedDecl *D2) |
Determine whether a using declaration considers the given declarations as "equivalent", e.g., if they are redeclarations of the same entity or are both typedefs of the same type. More... | |
static bool | isVirtualDirectBase (CXXRecordDecl *Derived, CXXRecordDecl *Base) |
Determine whether a direct base class is a virtual base class. More... | |
static CXXBaseSpecifier * | findDirectBaseWithType (CXXRecordDecl *Derived, QualType DesiredBase, bool &AnyDependentBases) |
Find the base specifier for a base class with the given type. More... | |
static StmtResult | buildMemcpyForAssignmentOp (Sema &S, SourceLocation Loc, QualType T, const ExprBuilder &ToB, const ExprBuilder &FromB) |
When generating a defaulted copy or move assignment operator, if a field should be copied with __builtin_memcpy rather than via explicit assignments, do so. More... | |
static StmtResult | buildSingleCopyAssignRecursively (Sema &S, SourceLocation Loc, QualType T, const ExprBuilder &To, const ExprBuilder &From, bool CopyingBaseSubobject, bool Copying, unsigned Depth=0) |
Builds a statement that copies/moves the given entity from From to To . More... | |
static StmtResult | buildSingleCopyAssign (Sema &S, SourceLocation Loc, QualType T, const ExprBuilder &To, const ExprBuilder &From, bool CopyingBaseSubobject, bool Copying) |
static void | diagnoseDeprecatedCopyOperation (Sema &S, CXXMethodDecl *CopyOp) |
Diagnose an implicit copy operation for a class which is odr-used, but which is deprecated because the class has a user-declared copy constructor, copy assignment operator, or destructor. More... | |
static void | checkMoveAssignmentForRepeatedMove (Sema &S, CXXRecordDecl *Class, SourceLocation CurrentLocation) |
Check if we're implicitly defining a move assignment operator for a class with virtual bases. More... | |
static bool | hasOneRealArgument (MultiExprArg Args) |
Determine whether the given list arguments contains exactly one "real" (non-default) argument. More... | |
static bool | CheckOperatorNewDeleteDeclarationScope (Sema &SemaRef, const FunctionDecl *FnDecl) |
static QualType | RemoveAddressSpaceFromPtr (Sema &SemaRef, const PointerType *PtrTy) |
static bool | CheckOperatorNewDeleteTypes (Sema &SemaRef, const FunctionDecl *FnDecl, CanQualType ExpectedResultType, CanQualType ExpectedFirstParamType, unsigned DependentParamTypeDiag, unsigned InvalidParamTypeDiag) |
static bool | CheckOperatorNewDeclaration (Sema &SemaRef, const FunctionDecl *FnDecl) |
static bool | CheckOperatorDeleteDeclaration (Sema &SemaRef, FunctionDecl *FnDecl) |
static bool | checkLiteralOperatorTemplateParameterList (Sema &SemaRef, FunctionTemplateDecl *TpDecl) |
static void | SearchForReturnInStmt (Sema &Self, Stmt *S) |
static bool | isNonlocalVariable (const Decl *D) |
Determine whether the given declaration is a global variable or static data member. More... | |
static void | DelegatingCycleHelper (CXXConstructorDecl *Ctor, llvm::SmallPtrSet< CXXConstructorDecl *, 4 > &Valid, llvm::SmallPtrSet< CXXConstructorDecl *, 4 > &Invalid, llvm::SmallPtrSet< CXXConstructorDecl *, 4 > &Current, Sema &S) |
#define ABSTRACT_TYPELOC | ( | CLASS, | |
PARENT | |||
) |
#define CheckPolymorphic | ( | Type | ) |
Definition at line 5678 of file SemaDeclCXX.cpp.
#define OVERLOADED_OPERATOR | ( | Name, | |
Spelling, | |||
Token, | |||
Unary, | |||
Binary, | |||
MemberOnly | |||
) | , { Unary, Binary, MemberOnly } |
#define TYPELOC | ( | CLASS, | |
PARENT | |||
) | case TypeLoc::CLASS: Check(TL.castAs<CLASS##TypeLoc>(), Sel); break; |
typedef llvm::SmallPtrSet<QualType, 4> IndirectBaseSet |
Use small set to collect indirect bases.
As this is only used locally, there's no need to abstract the small size parameter.
Definition at line 2602 of file SemaDeclCXX.cpp.
ImplicitInitializerKind - How an implicit base or member initializer should initialize its base or member.
Enumerator | |
---|---|
IIK_Default | |
IIK_Copy | |
IIK_Move | |
IIK_Inherit |
Definition at line 4525 of file SemaDeclCXX.cpp.
|
strong |
Definition at line 1027 of file SemaDeclCXX.cpp.
enum TrivialSubobjectKind |
The kind of subobject we are checking for triviality.
The values of this enumeration are used in diagnostics.
Enumerator | |
---|---|
TSK_BaseClass | The subobject is a base class. |
TSK_Field | The subobject is a non-static data member. |
TSK_CompleteObject | The object is actually the complete object. |
Definition at line 9066 of file SemaDeclCXX.cpp.
enum UnsupportedSTLSelect |
Definition at line 10696 of file SemaDeclCXX.cpp.
|
static |
Add the most overriden methods from MD to Methods.
Definition at line 9396 of file SemaDeclCXX.cpp.
References clang::CXXMethodDecl::getCanonicalDecl(), clang::CXXMethodDecl::overridden_methods(), and clang::CXXMethodDecl::size_overridden_methods().
|
static |
Definition at line 2790 of file SemaDeclCXX.cpp.
|
static |
Definition at line 4533 of file SemaDeclCXX.cpp.
References CastForMoving(), clang::Sema::Context, clang::DeclRefExpr::Create(), clang::InitializationKind::CreateDefault(), clang::InitializationKind::CreateDirect(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::ActionResult< PtrTy, CompressInvalid >::getAs(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), clang::FunctionDecl::getParamDecl(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::CXXBaseSpecifier::getType(), clang::ValueDecl::getType(), clang::QualType::getUnqualifiedType(), IIK_Copy, IIK_Default, IIK_Inherit, IIK_Move, clang::Sema::ImpCastExprToType(), clang::InitializedEntity::InitializeBase(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::CXXBaseSpecifier::isVirtual(), clang::Sema::MarkDeclRefReferenced(), clang::Sema::MaybeCreateExprWithCleanups(), clang::None, clang::VK_LValue, and clang::VK_XValue.
|
static |
Definition at line 4616 of file SemaDeclCXX.cpp.
References clang::LookupResult::addDecl(), clang::AS_public, clang::Sema::BuildMemberReferenceExpr(), CastForMoving(), clang::Sema::Context, clang::DeclRefExpr::Create(), clang::InitializationKind::CreateDefault(), clang::InitializationKind::CreateDirect(), clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::ActionResult< PtrTy, CompressInvalid >::getAs(), clang::ASTContext::getBaseElementType(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::FieldDecl::getParent(), clang::ASTContext::getTagDeclType(), clang::ValueDecl::getType(), clang::QualType::hasNonTrivialObjCLifetime(), IIK_Copy, IIK_Default, IIK_Inherit, IIK_Move, clang::InitializedEntity::InitializeMember(), clang::QualType::isConstQualified(), clang::Decl::isImplicit(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Decl::isInvalidDecl(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::TagDecl::isUnion(), clang::FieldDecl::isZeroLengthBitField(), clang::Sema::LookupMemberName, clang::Sema::MarkDeclRefReferenced(), clang::Sema::MaybeCreateExprWithCleanups(), clang::None, clang::InitializationSequence::Perform(), RefersToRValueRef(), and clang::VK_LValue.
Referenced by CollectFieldInitializer().
|
static |
When generating a defaulted copy or move assignment operator, if a field should be copied with __builtin_memcpy rather than via explicit assignments, do so.
This optimization only applies for arrays of scalars, and for arrays of class type where the selected copy/move-assignment operator is trivial.
Definition at line 13212 of file SemaDeclCXX.cpp.
References clang::Sema::BuildCallExpr(), clang::Sema::BuildDeclRefExpr(), clang::ASTContext::BuiltinFnTy, clang::Type::castAs(), clang::Sema::Context, clang::IntegerLiteral::Create(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::IdentifierTable::get(), clang::ActionResult< PtrTy, CompressInvalid >::getAs(), clang::Type::getBaseElementTypeUnsafe(), clang::ASTContext::getPointerType(), clang::CharUnits::getQuantity(), clang::ASTContext::getSizeType(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), clang::ASTContext::getTypeSizeInChars(), clang::ASTContext::Idents, clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Type::isRecordType(), clang::ActionResult< PtrTy, CompressInvalid >::isUsable(), clang::Sema::LookupName(), clang::Sema::LookupOrdinaryName, clang::OK_Ordinary, clang::StmtError(), clang::Sema::TUScope, and clang::VK_RValue.
Referenced by buildSingleCopyAssign().
|
static |
Definition at line 13484 of file SemaDeclCXX.cpp.
References buildMemcpyForAssignmentOp(), buildSingleCopyAssignRecursively(), clang::Sema::Context, clang::Type::isArrayType(), clang::QualType::isConstQualified(), clang::QualType::isTriviallyCopyableType(), clang::QualType::isVolatileQualified(), and clang::Result.
|
static |
Builds a statement that copies/moves the given entity from From
to To
.
This routine is used to copy/move the members of a class with an implicitly-declared copy/move assignment operator. When the entities being copied are arrays, this routine builds for loops to copy them.
S | The Sema object used for type-checking. |
Loc | The location where the implicit copy/move is being generated. |
T | The type of the expressions being copied/moved. Both expressions must have this type. |
To | The expression we are copying/moving to. |
From | The expression we are copying/moving from. |
CopyingBaseSubobject | Whether we're copying/moving a base subobject. Otherwise, it's a non-static member subobject. |
Copying | Whether we're copying or moving. |
Depth | Internal parameter recording the depth of the recursion. |
Definition at line 13292 of file SemaDeclCXX.cpp.
References clang::Type::getAs().
Referenced by buildSingleCopyAssign().
|
static |
Determine whether a type is permitted to be passed or returned in registers, per C++ [class.temporary]p3.
Definition at line 6204 of file SemaDeclCXX.cpp.
References clang::TargetInfo::CCK_ClangABI4OrPS4, clang::TargetInfo::CCK_MicrosoftWin64, clang::Sema::Context, clang::CXXRecordDecl::ctors(), clang::CXXRecordDecl::defaultedCopyConstructorIsDeleted(), clang::CXXRecordDecl::defaultedDestructorIsDeleted(), clang::CXXRecordDecl::defaultedMoveConstructorIsDeleted(), clang::Sema::getASTContext(), clang::CXXRecordDecl::getDestructor(), clang::Sema::getLangOpts(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::TypeDecl::getTypeForDecl(), clang::ASTContext::getTypeSize(), clang::CXXRecordDecl::hasNonTrivialCopyConstructorForCall(), clang::CXXRecordDecl::hasNonTrivialDestructorForCall(), clang::CXXRecordDecl::hasTrivialCopyConstructor(), clang::CXXRecordDecl::hasTrivialCopyConstructorForCall(), clang::CXXRecordDecl::hasTrivialDestructorForCall(), clang::CXXRecordDecl::hasTrivialMoveConstructorForCall(), clang::TagDecl::isDependentType(), clang::Decl::isInvalidDecl(), clang::CXXRecordDecl::methods(), clang::CXXRecordDecl::needsImplicitCopyConstructor(), clang::CXXRecordDecl::needsImplicitDestructor(), and clang::CXXRecordDecl::needsImplicitMoveConstructor().
Referenced by clang::Sema::checkIllFormedTrivialABIStruct(), createDestructorDefinitionData(), and clang::TextNodeDumper::VisitCXXRecordDecl().
Definition at line 4510 of file SemaDeclCXX.cpp.
References clang::Sema::BuildCXXNamedCast(), clang::Sema::BuildReferenceType(), clang::Sema::Context, clang::Stmt::getBeginLoc(), clang::Stmt::getSourceRange(), clang::ASTContext::getTrivialTypeSourceInfo(), and clang::Expr::getType().
Referenced by BuildImplicitBaseInitializer(), and BuildImplicitMemberInitializer().
|
static |
Check for invalid uses of an abstract type in a method declaration.
Definition at line 5730 of file SemaDeclCXX.cpp.
References clang::Sema::AbstractNone, clang::FunctionDecl::doesThisDeclarationHaveABody(), and clang::DeclaratorDecl::getTypeSourceInfo().
Referenced by CheckAbstractClassUsage(), and clang::Sema::CheckCompletedCXXClass().
|
static |
Check for invalid uses of an abstract type within a class definition.
Definition at line 5745 of file SemaDeclCXX.cpp.
References clang::Sema::AbstractFieldType, clang::Sema::AbstractVariableType, CheckAbstractClassUsage(), clang::DeclContext::decls(), and clang::DeclaratorDecl::getTypeSourceInfo().
|
static |
Definition at line 914 of file SemaDeclCXX.cpp.
References checkArrayLikeDecomposition(), clang::ArrayType::getElementType(), and clang::ConstantArrayType::getSize().
|
static |
Definition at line 899 of file SemaDeclCXX.cpp.
References clang::Sema::ActOnIntegerConstant(), checkSimpleDecomposition(), clang::Sema::CreateBuiltinArraySubscriptExpr(), clang::ExprError(), clang::ActionResult< PtrTy, CompressInvalid >::get(), and clang::ActionResult< PtrTy, CompressInvalid >::isInvalid().
Referenced by checkArrayDecomposition(), and checkVectorDecomposition().
|
static |
Definition at line 931 of file SemaDeclCXX.cpp.
References checkSimpleDecomposition(), clang::Sema::Context, clang::Sema::CreateBuiltinUnaryOp(), clang::ComplexType::getElementType(), clang::ASTContext::getQualifiedType(), and clang::QualType::getQualifiers().
|
static |
Check that the given field is initialized within a constexpr constructor.
Dcl | The constexpr constructor being checked. |
Field | The field being checked. This may be a member of an anonymous struct or union nested within the class being checked. |
Inits | All declarations, including anonymous struct/union members and indirect members, for which any initialization was provided. |
Diagnosed | Whether we've emitted the error message yet. Used to attach multiple notes for different members to the same error. |
Kind | Whether we're diagnosing a constructor as written or determining whether the formal requirements are satisfied. |
false
if we're checking for validity and the constructor does not satisfy the requirements on a constexpr constructor. Definition at line 1914 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), clang::Sema::CheckValid, clang::Sema::Diag(), clang::Sema::Diagnose, clang::RecordDecl::fields(), clang::Type::getAsCXXRecordDecl(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::CXXRecordDecl::hasVariantMembers(), clang::FieldDecl::isAnonymousStructOrUnion(), clang::CXXRecordDecl::isEmpty(), clang::Decl::isInvalidDecl(), clang::TagDecl::isUnion(), clang::Type::isUnionType(), and clang::FieldDecl::isUnnamedBitfield().
Referenced by CheckConstexprFunctionBody().
|
static |
Check the given declaration statement is legal within a constexpr function body.
C++11 [dcl.constexpr]p3,p4, and C++1y [dcl.constexpr]p3.
Definition at line 1773 of file SemaDeclCXX.cpp.
References CheckLiteralType(), clang::DeclStmt::decls(), clang::Sema::Diag(), clang::Sema::Diagnose, clang::XRayInstrKind::Function, clang::TypeLoc::getBeginLoc(), clang::DeclStmt::getBeginLoc(), clang::Sema::getLangOpts(), clang::TypeLoc::getSourceRange(), clang::TypeLoc::getType(), clang::FunctionDecl::isConsteval(), clang::SourceLocation::isValid(), and clang::VarDecl::TLS_Dynamic.
Referenced by CheckConstexprFunctionStmt().
|
static |
Determine whether a destructor cannot be constexpr due to.
Definition at line 1601 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), clang::Sema::Diag(), clang::Sema::Diagnose, clang::RecordDecl::fields(), clang::FunctionDecl::getConstexprKind(), clang::Decl::getLocation(), clang::CXXMethodDecl::getParent(), and clang::CXXRecordDecl::hasConstexprDestructor().
Referenced by clang::Sema::CheckConstexprFunctionDefinition().
|
static |
Check the body for the given constexpr function declaration only contains the permitted types of statement.
C++11 [dcl.constexpr]p3,p4.
Definition at line 2115 of file SemaDeclCXX.cpp.
References CheckConstexprCtorInitializer(), CheckConstexprFunctionStmt(), clang::Sema::CheckValid, clang::Stmt::children(), clang::Sema::Diag(), clang::Sema::Diagnose, clang::RecordDecl::field_begin(), clang::RecordDecl::field_end(), clang::RecordDecl::fields(), clang::Stmt::getBeginLoc(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::CXXRecordDecl::getNumBases(), clang::CXXRecordDecl::getNumVBases(), clang::FunctionDecl::getReturnType(), clang::CXXRecordDecl::hasVariantMembers(), Inits, clang::FunctionDecl::isConsteval(), clang::Type::isDependentType(), clang::Expr::isPotentialConstantExpr(), clang::TagDecl::isUnion(), clang::SourceLocation::isValid(), and clang::Type::isVoidType().
Referenced by clang::Sema::CheckConstexprFunctionDefinition(), and getRecordDiagFromTagKind().
|
static |
Check the provided statement is allowed in a constexpr function definition.
Definition at line 1970 of file SemaDeclCXX.cpp.
References CheckConstexprDeclStmt(), clang::Stmt::getBeginLoc(), clang::Stmt::getStmtClass(), and clang::SourceLocation::isValid().
Referenced by CheckConstexprFunctionBody().
|
static |
Check whether a function's parameter types are all literal types.
If so, return true. If not, produce a suitable diagnostic and return false.
Definition at line 1632 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), CheckLiteralType(), clang::Decl::getLocation(), clang::FunctionDecl::getParamDecl(), clang::ParmVarDecl::getSourceRange(), clang::ValueDecl::getType(), and clang::FunctionDecl::isConsteval().
Referenced by clang::Sema::CheckConstexprFunctionDefinition().
|
static |
Check whether a function's return type is a literal type.
If so, return true. If not, produce a suitable diagnostic and return false.
Definition at line 1653 of file SemaDeclCXX.cpp.
References CheckLiteralType(), clang::Decl::getLocation(), clang::FunctionDecl::getReturnType(), and clang::FunctionDecl::isConsteval().
Referenced by clang::Sema::CheckConstexprFunctionDefinition().
|
static |
Definition at line 5842 of file SemaDeclCXX.cpp.
References clang::Sema::CheckCXXDefaultArgExpr(), clang::Sema::Context, clang::DeclContext::decls(), clang::Sema::Diag(), clang::Sema::DiscardCleanupsInEvaluationContext(), clang::TargetInfo::getCXXABI(), clang::Attr::getLocation(), clang::Decl::getLocation(), clang::ASTContext::getTargetInfo(), clang::DeclContext::isDependentContext(), and clang::TargetCXXABI::isMicrosoft().
Referenced by clang::Sema::ActOnFinishCXXMemberDecls().
|
static |
Definition at line 15162 of file SemaDeclCXX.cpp.
References clang::ASTContext::CharTy, clang::Sema::Context, clang::Sema::Diag(), clang::Type::getAs(), clang::SourceRange::getBegin(), clang::TemplateTypeParmDecl::getDepth(), clang::TemplateTypeParmType::getDepth(), clang::TemplateTypeParmDecl::getIndex(), clang::TemplateTypeParmType::getIndex(), clang::Decl::getLocation(), clang::TemplateParameterList::getParam(), clang::TemplateParameterList::getSourceRange(), clang::TemplateDecl::getTemplateParameters(), clang::ValueDecl::getType(), clang::ASTContext::hasSameType(), clang::Sema::inTemplateInstantiation(), clang::Decl::isTemplateParameterPack(), and clang::TemplateParameterList::size().
Referenced by clang::Sema::CheckLiteralOperatorDeclaration().
|
static |
Check that the given type is a literal type.
Issue a diagnostic if not, if Kind is Diagnose.
true
if a problem has been found (and optionally diagnosed). Definition at line 1582 of file SemaDeclCXX.cpp.
References clang::Sema::CheckValid, clang::Sema::Context, clang::Sema::Diagnose, clang::Type::isDependentType(), clang::Type::isLiteralType(), and clang::Sema::RequireLiteralType().
Referenced by CheckConstexprDeclStmt(), CheckConstexprParameterTypes(), and CheckConstexprReturnType().
|
static |
Definition at line 1326 of file SemaDeclCXX.cpp.
References clang::Sema::BuildDeclRefExpr(), clang::Sema::BuildFieldReferenceExpr(), clang::Sema::BuildQualifiedType(), clang::Sema::CheckStructuredBindingMemberAccess(), clang::Sema::Context, clang::Sema::Diag(), findDecomposableBaseClass(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::DeclAccessPair::getAccess(), clang::DeclAccessPair::getDecl(), clang::Decl::getLocation(), clang::ASTContext::getQualifiedType(), clang::QualType::getQualifiers(), clang::ASTContext::getRecordType(), clang::Sema::ImpCastExprToType(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Type::isUnionType(), clang::DeclAccessPair::make(), clang::CXXRecordDecl::MergeAccess(), clang::Qualifiers::removeConst(), clang::Sema::RequireCompleteType(), and clang::VK_LValue.
|
static |
Definition at line 9798 of file SemaDeclCXX.cpp.
References clang::Sema::Diag(), clang::DeclSpec::forEachQualifier(), clang::Declarator::getFunctionTypeInfo(), clang::DeclaratorChunk::FunctionTypeInfo::hasMethodTypeQualifiers(), clang::Declarator::isInvalidType(), clang::DeclaratorChunk::FunctionTypeInfo::MethodQualifiers, and clang::Declarator::setInvalidType().
Referenced by clang::Sema::CheckConstructorDeclarator(), and clang::Sema::CheckDestructorDeclarator().
|
static |
Check if we're implicitly defining a move assignment operator for a class with virtual bases.
Such a move assignment might move-assign the virtual base multiple times.
Definition at line 13913 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), clang::Sema::CXXMoveAssignment, clang::Sema::Diag(), clang::Type::getAsCXXRecordDecl(), clang::CXXRecordDecl::getCanonicalDecl(), clang::Sema::SpecialMemberOverloadResult::getMethod(), clang::CXXRecordDecl::getNumBases(), clang::CXXRecordDecl::getNumVBases(), clang::CXXBaseSpecifier::getType(), clang::CXXRecordDecl::hasNonTrivialMoveAssignment(), clang::CXXRecordDecl::hasTrivialMoveAssignment(), clang::DeclContext::isDependentContext(), clang::CXXMethodDecl::isMoveAssignmentOperator(), clang::FunctionDecl::isTrivial(), clang::CXXBaseSpecifier::isVirtual(), and clang::Sema::LookupSpecialMember().
Referenced by clang::Sema::DefineImplicitMoveAssignment().
|
static |
Definition at line 14983 of file SemaDeclCXX.cpp.
References CheckOperatorNewDeleteDeclarationScope(), CheckOperatorNewDeleteTypes(), clang::Sema::Context, clang::Sema::Diag(), clang::ASTContext::getCanonicalType(), clang::Decl::getLocation(), clang::CXXMethodDecl::getParent(), clang::ASTContext::getPointerType(), clang::ASTContext::getRecordType(), clang::if(), clang::DeclContext::isDependentContext(), clang::FunctionDecl::isDestroyingOperatorDelete(), clang::Sema::isUsualDeallocationFunction(), clang::ASTContext::VoidPtrTy, and clang::ASTContext::VoidTy.
Referenced by clang::Sema::CheckOverloadedOperatorDeclaration().
|
static |
Definition at line 14952 of file SemaDeclCXX.cpp.
References CheckOperatorNewDeleteDeclarationScope(), CheckOperatorNewDeleteTypes(), clang::Sema::Context, clang::Sema::Diag(), clang::ASTContext::getCanonicalType(), clang::NamedDecl::getDeclName(), clang::ParmVarDecl::getDefaultArgRange(), clang::Decl::getLocation(), clang::FunctionDecl::getParamDecl(), clang::ASTContext::getSizeType(), clang::ParmVarDecl::hasDefaultArg(), and clang::ASTContext::VoidPtrTy.
Referenced by clang::Sema::CheckOverloadedOperatorDeclaration().
|
inlinestatic |
Definition at line 14863 of file SemaDeclCXX.cpp.
References clang::Sema::Diag(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::DeclContext::getRedeclContext(), clang::FunctionDecl::getStorageClass(), and clang::SC_Static.
Referenced by CheckOperatorDeleteDeclaration(), and CheckOperatorNewDeclaration().
|
inlinestatic |
Definition at line 14890 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), clang::Sema::Context, clang::Sema::Diag(), clang::Type::getAs(), clang::ASTContext::getCanonicalType(), clang::NamedDecl::getDeclName(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::ValueDecl::getType(), clang::CanQual< T >::getUnqualifiedType(), clang::Type::isDependentType(), and RemoveAddressSpaceFromPtr().
Referenced by CheckOperatorDeleteDeclaration(), and CheckOperatorNewDeclaration().
|
static |
Definition at line 873 of file SemaDeclCXX.cpp.
Referenced by checkArrayLikeDecomposition(), and checkComplexDecomposition().
|
static |
Check whether the members of a class type allow a special member to be trivial.
Definition at line 9127 of file SemaDeclCXX.cpp.
References checkTrivialSubobjectCall(), clang::Sema::Context, clang::Sema::CXXDefaultConstructor, clang::Sema::Diag(), clang::RecordDecl::fields(), clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getBaseElementType(), clang::QualType::getObjCLifetime(), clang::QualType::hasNonTrivialObjCLifetime(), and TSK_Field.
|
static |
Check whether the special member selected for a given type would be trivial.
Definition at line 9076 of file SemaDeclCXX.cpp.
References clang::QualType::addConst(), clang::Sema::CXXDefaultConstructor, clang::Sema::Diag(), findTrivialSpecialMember(), findUserDeclaredCtor(), clang::Type::getAsCXXRecordDecl(), clang::QualType::getCVRQualifiers(), clang::Decl::getLocation(), clang::QualType::getUnqualifiedType(), clang::FunctionDecl::isUserProvided(), clang::Sema::SpecialMemberIsTrivial(), clang::Sema::TAH_IgnoreTrivialABI, and TSK_CompleteObject.
Referenced by checkTrivialClassMembers().
|
static |
Definition at line 1117 of file SemaDeclCXX.cpp.
References clang::Sema::ActOnFinishFullExpr(), clang::TemplateArgumentListInfo::addArgument(), clang::Sema::BuildCallExpr(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::BuildDeclRefExpr(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::BuildReferenceType(), clang::Sema::Context, clang::VarDecl::Create(), clang::UnresolvedLookupExpr::Create(), clang::ImplicitCastExpr::Create(), clang::InitializationKind::CreateCopy(), clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Type::getAsCXXRecordDecl(), clang::Decl::getDeclContext(), clang::Preprocessor::getIdentifierInfo(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::TemplateParameterList::getParam(), clang::ASTContext::getSizeType(), clang::VarDecl::getStorageClass(), getTrivialIntegralTemplateArgument(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::VarDecl::getTSCSpec(), getTupleLikeElementType(), clang::ValueDecl::getType(), clang::InitializedEntity::InitializeBinding(), clang::Sema::isCompleteType(), clang::VarDecl::isInlineSpecified(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Type::isLValueReferenceType(), clang::QualType::isNull(), clang::Sema::LookupMemberName, clang::Sema::LookupQualifiedName(), clang::None, clang::InitializationSequence::Perform(), clang::Sema::PP, clang::Decl::setLexicalDeclContext(), clang::TemplateParameterList::size(), clang::VK_LValue, and clang::VK_XValue.
|
static |
Definition at line 922 of file SemaDeclCXX.cpp.
References checkArrayLikeDecomposition(), clang::Sema::Context, clang::VectorType::getElementType(), clang::VectorType::getNumElements(), clang::ASTContext::getQualifiedType(), and clang::QualType::getQualifiers().
|
static |
Definition at line 4880 of file SemaDeclCXX.cpp.
References clang::Sema::BuildCXXDefaultInitExpr(), BuildImplicitMemberInitializer(), clang::Sema::checkInitializerLifetime(), clang::Sema::Context, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::FieldDecl::getCanonicalDecl(), clang::ValueDecl::getType(), clang::FieldDecl::hasInClassInitializer(), clang::InitializedEntity::InitializeMember(), isIncompleteOrZeroLengthArrayType(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), and clang::Decl::isInvalidDecl().
|
static |
Definition at line 8246 of file SemaDeclCXX.cpp.
References clang::Sema::ImplicitExceptionSpecification::CalledStmt(), clang::FunctionDecl::getBody(), clang::FunctionDecl::hasBody(), and clang::Decl::isInvalidDecl().
Referenced by computeImplicitExceptionSpec().
|
static |
Definition at line 12494 of file SemaDeclCXX.cpp.
References clang::Sema::Context, clang::Decl::getLocation(), clang::CXXMethodDecl::getParent(), clang::ASTContext::getRecordType(), clang::if(), clang::Decl::isInvalidDecl(), and clang::Sema::RequireCompleteType().
Referenced by computeImplicitExceptionSpec().
|
static |
Definition at line 6868 of file SemaDeclCXX.cpp.
References ComputeDefaultedComparisonExceptionSpec(), ComputeDefaultedSpecialMemberExceptionSpec(), clang::Sema::CXXDefaultConstructor, and clang::Sema::getDefaultedFunctionKind().
Referenced by clang::Sema::EvaluateImplicitExceptionSpec().
|
static |
Determine whether the specified special member function would be constexpr if it were implicitly defined.
Definition at line 6731 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), clang::Sema::Context, clang::Sema::CXXCopyAssignment, clang::Sema::CXXCopyConstructor, clang::Sema::CXXDefaultConstructor, clang::Sema::CXXDestructor, clang::Sema::CXXInvalid, clang::Sema::CXXMoveAssignment, clang::Sema::CXXMoveConstructor, clang::CXXRecordDecl::defaultedDefaultConstructorIsConstexpr(), clang::CXXRecordDecl::defaultedDestructorIsConstexpr(), clang::RecordDecl::fields(), clang::Type::getAs(), clang::ASTContext::getBaseElementType(), clang::QualType::getCVRQualifiers(), clang::RecordType::getDecl(), clang::Sema::getLangOpts(), clang::CXXRecordDecl::getNumVBases(), clang::CXXRecordDecl::hasInClassInitializer(), clang::CXXRecordDecl::hasVariantMembers(), clang::CXXRecordDecl::isLiteral(), clang::TagDecl::isUnion(), and specialMemberIsConstexpr().
Referenced by clang::Sema::DeclareImplicitDefaultConstructor(), and clang::Sema::DeclareImplicitDestructor().
|
static |
Definition at line 6175 of file SemaDeclCXX.cpp.
References clang::Sema::CXXCopyAssignment, clang::Sema::CXXCopyConstructor, clang::Sema::CXXDefaultConstructor, clang::Sema::CXXDestructor, clang::Sema::CXXInvalid, clang::Sema::CXXMoveAssignment, clang::Sema::CXXMoveConstructor, clang::Sema::DefineImplicitCopyAssignment(), clang::Sema::DefineImplicitCopyConstructor(), clang::Sema::DefineImplicitDefaultConstructor(), clang::Sema::DefineImplicitDestructor(), clang::Sema::DefineImplicitMoveAssignment(), clang::Sema::DefineImplicitMoveConstructor(), and clang::Sema::getSpecialMember().
Referenced by clang::Sema::ActOnFinishCXXNonNestedClass(), and clang::Sema::SetDeclDefaulted().
|
static |
Definition at line 17031 of file SemaDeclCXX.cpp.
|
static |
Definition at line 5170 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), clang::Sema::Context, clang::Sema::Diag(), clang::Sema::Diags, clang::RecordDecl::fields(), clang::CXXCtorInitializer::getAnyMember(), clang::CXXCtorInitializer::getBaseClass(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), GetKeyForBase(), GetKeyForMember(), clang::CXXMethodDecl::getParent(), clang::FieldDecl::getParent(), clang::CXXCtorInitializer::getSourceLocation(), clang::CXXCtorInitializer::getSourceRange(), clang::TypeSourceInfo::getType(), clang::CXXCtorInitializer::getTypeSourceInfo(), clang::RecordDecl::isAnonymousStructOrUnion(), clang::CXXCtorInitializer::isAnyMemberInitializer(), clang::DeclContext::isDependentContext(), clang::DiagnosticsEngine::isIgnored(), clang::TagDecl::isUnion(), Parent, PopulateKeysForFields(), and clang::CXXRecordDecl::vbases().
|
static |
Diagnose an implicit copy operation for a class which is odr-used, but which is deprecated because the class has a user-declared copy constructor, copy assignment operator, or destructor.
Definition at line 13585 of file SemaDeclCXX.cpp.
References clang::Sema::Diag(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::CXXMethodDecl::getParent(), clang::Decl::isImplicit(), and clang::FunctionDecl::isUserProvided().
Referenced by clang::Sema::DefineImplicitCopyAssignment(), and clang::Sema::DefineImplicitCopyConstructor().
|
static |
Diagnose a mismatch in 'inline' qualifiers when a namespace is reopened.
Definition at line 10461 of file SemaDeclCXX.cpp.
References clang::FixItHint::CreateInsertion(), clang::DeclContext::decls(), clang::Sema::Diag(), clang::Decl::getLocation(), clang::NamedDecl::getMostRecentDecl(), clang::IdentifierInfo::getName(), clang::DeclContext::getParent(), clang::Decl::getPreviousDecl(), clang::Sema::getSourceManager(), clang::NamespaceDecl::isInline(), clang::SourceManager::isInSystemHeader(), and clang::DeclContext::makeDeclVisibleInContext().
Referenced by clang::Sema::ActOnStartNamespaceDef().
|
static |
Definition at line 10078 of file SemaDeclCXX.cpp.
References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::SourceLocation::isInvalid(), clang::SourceRange::isInvalid(), clang::SourceRange::setBegin(), and clang::SourceRange::setEnd().
Referenced by clang::Sema::CheckConversionDeclarator().
|
static |
Definition at line 10086 of file SemaDeclCXX.cpp.
References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::SourceLocation::isInvalid(), clang::SourceRange::isInvalid(), clang::SourceRange::setBegin(), and clang::SourceRange::setEnd().
Referenced by clang::Sema::CheckConversionDeclarator().
|
static |
Find the direct and/or virtual base specifiers that correspond to the given base type, for use in base initialization within a constructor.
Definition at line 3952 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), clang::Sema::Context, and clang::ASTContext::hasSameUnqualifiedType().
|
static |
Determine whether the given class is a base class of the given class, including looking at dependent bases.
Definition at line 2379 of file SemaDeclCXX.cpp.
Referenced by clang::Sema::CheckBaseSpecifier().
|
static |
Find the base class to decompose in a built-in decomposition of a class type.
This base class search is, unfortunately, not quite like any other that we perform anywhere else in C++.
Definition at line 1255 of file SemaDeclCXX.cpp.
References clang::AS_public, clang::Type::getAsCXXRecordDecl(), clang::CXXBaseSpecifier::getType(), clang::CXXRecordDecl::hasDirectFields(), and Specifier.
Referenced by checkMemberDecomposition().
|
static |
Find the base specifier for a base class with the given type.
Definition at line 11491 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), clang::Type::getCanonicalTypeUnqualified(), clang::CXXBaseSpecifier::getType(), and clang::CanQual< T >::getUnqualifiedType().
Referenced by clang::Sema::CheckInheritingConstructorUsingDecl().
|
static |
Find the equality comparison functions that should be implicitly declared in a given class definition, per C++2a [class.compare.default]p3.
Definition at line 9534 of file SemaDeclCXX.cpp.
References clang::ASTContext::DeclarationNames, clang::DeclContextLookupResult::empty(), clang::CXXRecordDecl::friends(), clang::DeclarationNameTable::getCXXOperatorName(), clang::FunctionDecl::getOverloadedOperator(), clang::FunctionDecl::isExplicitlyDefaulted(), and clang::DeclContext::lookup().
|
static |
Perform lookup for a special member of the specified kind, and determine whether it is trivial.
If the triviality can be determined without the lookup, skip it. This is intended for use when determining whether a special member of a containing object is trivial, and thus does not ever perform overload resolution for default constructors.
If Selected
is not NULL
, *Selected
will be filled in with the member that was most likely to be intended to be trivial, if any.
If ForCall
is true, look at CXXRecord::HasTrivialSpecialMembersForCall to determine whether the special member is trivial.
Definition at line 8921 of file SemaDeclCXX.cpp.
References clang::Sema::SpecialMemberOverloadResult::Ambiguous, clang::Qualifiers::Const, clang::CXXRecordDecl::ctors(), clang::Sema::CXXCopyAssignment, clang::Sema::CXXCopyConstructor, clang::Sema::CXXDefaultConstructor, clang::Sema::CXXDestructor, clang::Sema::CXXInvalid, clang::Sema::CXXMoveAssignment, clang::Sema::CXXMoveConstructor, clang::Sema::DeclareImplicitDefaultConstructor(), clang::Sema::DeclareImplicitDestructor(), clang::CXXRecordDecl::getDestructor(), clang::Sema::SpecialMemberOverloadResult::getKind(), clang::Sema::SpecialMemberOverloadResult::getMethod(), clang::CXXRecordDecl::hasTrivialCopyAssignment(), clang::CXXRecordDecl::hasTrivialCopyConstructor(), clang::CXXRecordDecl::hasTrivialCopyConstructorForCall(), clang::CXXRecordDecl::hasTrivialDefaultConstructor(), clang::CXXRecordDecl::hasTrivialDestructor(), clang::CXXRecordDecl::hasTrivialDestructorForCall(), clang::FunctionDecl::isTrivial(), clang::FunctionDecl::isTrivialForCall(), clang::FunctionDecl::isUserProvided(), lookupCallFromSpecialMember(), clang::CXXRecordDecl::needsImplicitDefaultConstructor(), clang::CXXRecordDecl::needsImplicitDestructor(), clang::Sema::SpecialMemberOverloadResult::NoMemberOrDeleted, and clang::Sema::TAH_ConsiderTrivialABI.
Referenced by checkTrivialSubobjectCall().
|
static |
Definition at line 9048 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::ctors(), clang::DeclContext::decls_begin(), and clang::DeclContext::decls_end().
Referenced by checkTrivialSubobjectCall().
|
static |
Definition at line 421 of file SemaDeclCXX.cpp.
References clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::ParmVarDecl::hasDefaultArg(), and clang::ParmVarDecl::hasInheritedDefaultArg().
|
static |
Definition at line 6887 of file SemaDeclCXX.cpp.
References clang::Sema::Context, clang::EST_Unevaluated, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::FunctionProtoType::ExtProtoInfo::ExtInfo, clang::ASTContext::getDefaultCallingConvention(), clang::FunctionProtoType::ExceptionSpecInfo::SourceDecl, clang::FunctionProtoType::ExceptionSpecInfo::Type, and clang::FunctionType::ExtInfo::withCallingConv().
|
static |
Definition at line 5158 of file SemaDeclCXX.cpp.
Referenced by DiagnoseBaseOrMemInitializerOrder().
|
static |
Definition at line 5162 of file SemaDeclCXX.cpp.
Referenced by clang::Sema::ActOnMemInitializers(), and DiagnoseBaseOrMemInitializerOrder().
|
static |
Definition at line 3087 of file SemaDeclCXX.cpp.
References clang::AS_none, clang::AS_private, clang::ParsedAttributesView::end(), clang::Type::getAsCXXRecordDecl(), clang::CXXBaseSpecifier::getType(), clang::ParsedAttr::isDeclspecPropertyAttribute(), and Specifier.
|
inlinestatic |
getNamespaceDecl - Returns the namespace a decl represents.
If the decl is a namespace alias, returns the namespace it points to.
Definition at line 10646 of file SemaDeclCXX.cpp.
Referenced by clang::Sema::ActOnNamespaceAliasDef().
|
static |
Get diagnostic select index for tag kind for record diagnostic message.
WARNING: Indexes apply to particular diagnostics only!
Definition at line 1667 of file SemaDeclCXX.cpp.
References CheckConstexprFunctionBody(), clang::TTK_Class, clang::TTK_Interface, and clang::TTK_Struct.
Referenced by clang::Sema::CheckConstexprFunctionDefinition().
|
static |
Definition at line 1016 of file SemaDeclCXX.cpp.
References clang::Sema::Context, clang::Sema::getTrivialTemplateArgumentLoc(), and clang::ASTContext::MakeIntValue().
Referenced by checkTupleLikeDecomposition(), and getTupleLikeElementType().
|
static |
Definition at line 1023 of file SemaDeclCXX.cpp.
References clang::Sema::getTrivialTemplateArgumentLoc().
Referenced by getTupleLikeElementType(), and isTupleLike().
|
static |
Definition at line 1074 of file SemaDeclCXX.cpp.
References clang::TemplateArgumentListInfo::addArgument(), clang::Sema::Context, clang::Sema::Diag(), clang::LookupResult::empty(), clang::LookupResult::getAsSingle(), clang::Preprocessor::getIdentifierInfo(), clang::Decl::getLocation(), clang::ASTContext::getPrintingPolicy(), clang::LookupResult::getRepresentativeDecl(), clang::ASTContext::getSizeType(), getTrivialIntegralTemplateArgument(), getTrivialTypeTemplateArgument(), clang::ASTContext::getTypeDeclType(), clang::Sema::LookupOrdinaryName, lookupStdTypeTraitMember(), clang::Sema::PP, printTemplateArgs(), and clang::LookupResult::suppressDiagnostics().
Referenced by checkTupleLikeDecomposition().
|
static |
Determine whether the given list arguments contains exactly one "real" (non-default) argument.
Definition at line 14586 of file SemaDeclCXX.cpp.
Definition at line 3077 of file SemaDeclCXX.cpp.
References clang::Type::getAsCXXRecordDecl(), clang::Type::getBaseElementTypeUnsafe(), and clang::ValueDecl::getType().
|
static |
Determine whether a using declaration considers the given declarations as "equivalent", e.g., if they are redeclarations of the same entity or are both typedefs of the same type.
Definition at line 11216 of file SemaDeclCXX.cpp.
Referenced by clang::Sema::CheckUsingShadowDecl().
|
static |
Determine whether the given type is an incomplete or zero-lenfgth array type.
Definition at line 4866 of file SemaDeclCXX.cpp.
Referenced by CollectFieldInitializer(), and clang::Sema::MarkBaseAndMemberDestructorsReferenced().
Determine whether the given declaration is a global variable or static data member.
Definition at line 16682 of file SemaDeclCXX.cpp.
Referenced by clang::Sema::ActOnCXXEnterDeclInitializer(), and clang::Sema::ActOnCXXExitDeclInitializer().
|
static |
Definition at line 1029 of file SemaDeclCXX.cpp.
References clang::TemplateArgumentListInfo::addArgument(), clang::Sema::BuildDeclarationNameExpr(), clang::Sema::ConstantEvaluated, clang::Sema::Context, clang::Sema::Diag(), clang::LookupResult::empty(), clang::Error, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Preprocessor::getIdentifierInfo(), clang::ASTContext::getPrintingPolicy(), getTrivialTypeTemplateArgument(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Sema::LookupOrdinaryName, lookupStdTypeTraitMember(), clang::Sema::PP, printTemplateArgs(), and clang::Sema::VerifyIntegerConstantExpression().
|
static |
Determine whether a using statement is in a context where it will be apply in all contexts.
Definition at line 10976 of file SemaDeclCXX.cpp.
References clang::TypoCorrection::getCorrectionDecl(), clang::DeclContext::getDeclKind(), and clang::DeclContext::getParent().
|
static |
Determine whether a direct base class is a virtual base class.
Definition at line 11389 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), and clang::CXXRecordDecl::getNumVBases().
Referenced by clang::Sema::BuildUsingShadowDecl().
|
static |
Look up the special member function that would be called by a special member function for a subobject of class type.
Class | The class type of the subobject. |
CSM | The kind of special member function. |
FieldQuals | If the subobject is a field, its cv-qualifiers. |
ConstRHS | True if this is a copy operation with a const object on its RHS, that is, if the argument to the outer special member function is 'const' and this is not a field marked 'mutable'. |
Definition at line 6595 of file SemaDeclCXX.cpp.
References clang::Qualifiers::Const, clang::Sema::CXXCopyAssignment, clang::Sema::CXXDefaultConstructor, clang::Sema::CXXDestructor, clang::Sema::CXXMoveAssignment, clang::Sema::LookupSpecialMember(), and clang::Qualifiers::Volatile.
Referenced by findTrivialSpecialMember(), and specialMemberIsConstexpr().
|
static |
Perform the unqualified lookups that might be needed to form a defaulted comparison function for the given operator.
Definition at line 7961 of file SemaDeclCXX.cpp.
References clang::getRewrittenOverloadedOperator(), and clang::Sema::LookupOverloadedOperatorName().
Referenced by clang::Sema::CheckExplicitlyDefaultedComparison().
|
static |
Definition at line 10908 of file SemaDeclCXX.cpp.
References clang::Sema::Diag(), clang::IdentifierTable::get(), clang::Preprocessor::getIdentifierTable(), clang::Decl::getLocation(), clang::TemplateParameterList::getMinRequiredArguments(), clang::TemplateParameterList::getParam(), clang::Sema::getStdNamespace(), clang::TemplateDecl::getTemplateParameters(), clang::Sema::LookupOrdinaryName, clang::Sema::LookupQualifiedName(), clang::Sema::PP, clang::Result, and Std.
Referenced by clang::Sema::BuildStdInitializerList().
|
static |
Definition at line 958 of file SemaDeclCXX.cpp.
References clang::Sema::CheckTemplateIdType(), clang::Sema::Context, clang::Sema::Diag(), clang::IdentifierTable::get(), clang::Type::getAsCXXRecordDecl(), clang::Preprocessor::getIdentifierTable(), clang::Decl::getLocation(), clang::ASTContext::getPrintingPolicy(), clang::Sema::getStdNamespace(), clang::LookupResult::isAmbiguous(), clang::Sema::isCompleteType(), clang::QualType::isNull(), clang::Sema::LookupOrdinaryName, clang::Sema::LookupQualifiedName(), clang::Sema::PP, printTemplateArgs(), clang::Sema::RequireCompleteType(), clang::Result, and Std.
Referenced by getTupleLikeElementType(), and isTupleLike().
|
static |
Recursively add the bases of Type. Don't add Type itself.
Definition at line 2606 of file SemaDeclCXX.cpp.
|
static |
Definition at line 5146 of file SemaDeclCXX.cpp.
References clang::RecordDecl::fields(), clang::Type::getAs(), clang::FieldDecl::getCanonicalDecl(), clang::ValueDecl::getType(), and clang::RecordDecl::isAnonymousStructOrUnion().
Referenced by DiagnoseBaseOrMemInitializerOrder().
|
static |
Definition at line 944 of file SemaDeclCXX.cpp.
References clang::TemplateArgumentListInfo::arguments(), and clang::First.
Referenced by getTupleLikeElementType(), isTupleLike(), and lookupStdTypeTraitMember().
|
static |
Definition at line 5777 of file SemaDeclCXX.cpp.
References clang::Sema::Consumer, clang::Sema::Context, clang::DeclContext::decls(), clang::Sema::Diag(), clang::Sema::Diags, clang::getDLLAttr(), clang::Attr::getKind(), clang::Sema::getLangOpts(), clang::Attr::getLocation(), clang::Decl::getLocation(), clang::ASTContext::getTargetInfo(), clang::CXXRecordDecl::getTemplateSpecializationKind(), clang::TargetInfo::getTriple(), clang::ASTConsumer::HandleTopLevelDecl(), clang::DiagnosticErrorTrap::hasErrorOccurred(), clang::Attr::isInherited(), clang::Sema::MarkFunctionReferenced(), clang::Sema::MarkVariableReferenced(), clang::Sema::MarkVTableUsed(), clang::SC_Static, clang::TSK_ExplicitInstantiationDeclaration, and clang::TSK_ImplicitInstantiation.
Referenced by clang::Sema::referenceDLLExportedClassMethods().
Definition at line 4610 of file SemaDeclCXX.cpp.
References clang::ValueDecl::getType(), and clang::Type::isRValueReferenceType().
Referenced by BuildImplicitMemberInitializer().
|
static |
Definition at line 14883 of file SemaDeclCXX.cpp.
References clang::Sema::Context, clang::PointerType::getPointeeType(), clang::ASTContext::getPointerType(), and clang::ASTContext::removeAddrSpaceQualType().
Referenced by CheckOperatorNewDeleteTypes().
Definition at line 16477 of file SemaDeclCXX.cpp.
References clang::Stmt::children(), and clang::Sema::Diag().
Referenced by clang::Sema::DiagnoseReturnInConstructorExceptionHandler().
|
static |
Is the special member function which would be selected to perform the specified operation on the specified class type a constexpr constructor?
Definition at line 6700 of file SemaDeclCXX.cpp.
References clang::Sema::CXXDefaultConstructor, clang::Sema::CXXDestructor, clang::Sema::SpecialMemberOverloadResult::getMethod(), clang::CXXRecordDecl::hasConstexprDefaultConstructor(), clang::CXXRecordDecl::hasConstexprDestructor(), clang::FunctionDecl::isConstexpr(), and lookupCallFromSpecialMember().
Referenced by defaultedSpecialMemberIsConstexpr().
|
static |
Definition at line 11005 of file SemaDeclCXX.cpp.
References clang::LookupResult::addDecl(), clang::LookupResult::clear(), clang::Sema::computeDeclContext(), clang::Sema::CorrectTypo(), clang::Sema::CTK_ErrorRecovery, clang::Sema::diagnoseTypo(), clang::Sema::getLangOpts(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupNameInfo(), clang::IdentifierInfo::getName(), and clang::Sema::PDiag().
Referenced by clang::Sema::ActOnNamespaceAliasDef(), and clang::Sema::ActOnUsingDirective().