clang API Documentation
#include "clang/Sema/SemaInternal.h"
#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/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/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/Template.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include <map>
#include <set>
#include "clang/AST/TypeLocNodes.def"
#include "clang/Basic/OperatorKinds.def"
Go to the source code of this file.
Defines | |
#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 } |
Enumerations | |
enum | ImplicitInitializerKind { IIK_Default, IIK_Copy, IIK_Move, IIK_Inherit } |
enum | TrivialSubobjectKind { TSK_BaseClass, TSK_Field, TSK_CompleteObject } |
Functions | |
static bool | functionDeclHasDefaultArgument (const FunctionDecl *FD) |
static bool | CheckConstexprParameterTypes (Sema &SemaRef, const FunctionDecl *FD) |
static unsigned | getRecordDiagFromTagKind (TagTypeKind Tag) |
Get diagnostic select index for tag kind for record diagnostic message. WARNING: Indexes apply to particular diagnostics only! | |
static bool | CheckConstexprDeclStmt (Sema &SemaRef, const FunctionDecl *Dcl, DeclStmt *DS, SourceLocation &Cxx1yLoc) |
static void | CheckConstexprCtorInitializer (Sema &SemaRef, const FunctionDecl *Dcl, FieldDecl *Field, llvm::SmallSet< Decl *, 16 > &Inits, bool &Diagnosed) |
static bool | CheckConstexprFunctionStmt (Sema &SemaRef, const FunctionDecl *Dcl, Stmt *S, SmallVectorImpl< SourceLocation > &ReturnStmts, SourceLocation &Cxx1yLoc) |
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. | |
static void | propagateDLLAttrToBaseClassTemplate (Sema &S, CXXRecordDecl *Class, Attr *ClassAttr, ClassTemplateSpecializationDecl *BaseTemplateSpec, SourceLocation BaseLoc) |
Perform propagation of DLL attributes from a derived class to a templated base class for MS compatibility. | |
static bool | InitializationHasSideEffects (const FieldDecl &FD) |
static AttributeList * | getMSPropertyAttr (AttributeList *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. | |
static void | CheckForDanglingReferenceOrPointer (Sema &S, ValueDecl *Member, Expr *Init, SourceLocation IdLoc) |
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. | |
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. | |
static void | CheckAbstractClassUsage (AbstractUsageInfo &Info, CXXRecordDecl *RD) |
Check for invalid uses of an abstract type within a class definition. | |
static void | checkDLLAttribute (Sema &S, CXXRecordDecl *Class) |
Check class-level dllimport/dllexport attribute. | |
static Sema::SpecialMemberOverloadResult * | lookupCallFromSpecialMember (Sema &S, CXXRecordDecl *Class, Sema::CXXSpecialMember CSM, unsigned FieldQuals, bool ConstRHS) |
static bool | specialMemberIsConstexpr (Sema &S, CXXRecordDecl *ClassDecl, Sema::CXXSpecialMember CSM, unsigned Quals, bool ConstRHS) |
static bool | defaultedSpecialMemberIsConstexpr (Sema &S, CXXRecordDecl *ClassDecl, Sema::CXXSpecialMember CSM, bool ConstArg) |
static Sema::ImplicitExceptionSpecification | computeImplicitExceptionSpec (Sema &S, SourceLocation Loc, CXXMethodDecl *MD) |
static FunctionProtoType::ExtProtoInfo | getImplicitMethodEPI (Sema &S, CXXMethodDecl *MD) |
static bool | findTrivialSpecialMember (Sema &S, CXXRecordDecl *RD, Sema::CXXSpecialMember CSM, unsigned Quals, bool ConstRHS, CXXMethodDecl **Selected) |
static CXXConstructorDecl * | findUserDeclaredCtor (CXXRecordDecl *RD) |
static bool | checkTrivialSubobjectCall (Sema &S, SourceLocation SubobjLoc, QualType SubType, bool ConstRHS, Sema::CXXSpecialMember CSM, TrivialSubobjectKind Kind, bool Diagnose) |
Check whether the special member selected for a given type would be trivial. | |
static bool | checkTrivialClassMembers (Sema &S, CXXRecordDecl *RD, Sema::CXXSpecialMember CSM, bool ConstArg, bool Diagnose) |
static bool | CheckMostOverridenMethods (const CXXMethodDecl *MD, const llvm::SmallPtrSetImpl< const CXXMethodDecl * > &Methods) |
Check whether any most overriden method from MD in Methods. | |
static bool | FindHiddenVirtualMethod (const CXXBaseSpecifier *Specifier, CXXBasePath &Path, void *UserData) |
Member lookup function that determines whether a given C++ method overloads virtual methods in a base class without overriding any, to be used with CXXRecordDecl::lookupInBases(). | |
static void | AddMostOverridenMethods (const CXXMethodDecl *MD, llvm::SmallPtrSetImpl< const CXXMethodDecl * > &Methods) |
Add the most overriden methods from MD to Methods. | |
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. | |
static NamespaceDecl * | getNamespaceDecl (NamedDecl *D) |
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. | |
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. | |
static CXXBaseSpecifier * | findDirectBaseWithType (CXXRecordDecl *Derived, QualType DesiredBase, bool &AnyDependentBases) |
Find the base specifier for a base class with the given type. | |
static StmtResult | buildMemcpyForAssignmentOp (Sema &S, SourceLocation Loc, QualType T, const ExprBuilder &ToB, const ExprBuilder &FromB) |
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 . | |
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, SourceLocation UseLoc) |
static void | checkMoveAssignmentForRepeatedMove (Sema &S, CXXRecordDecl *Class, SourceLocation CurrentLocation) |
static bool | hasOneRealArgument (MultiExprArg Args) |
Determine whether the given list arguments contains exactly one "real" (non-default) argument. | |
static bool | CheckOperatorNewDeleteDeclarationScope (Sema &SemaRef, const FunctionDecl *FnDecl) |
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 void | SearchForReturnInStmt (Sema &Self, Stmt *S) |
static bool | isStaticDataMember (const Decl *D) |
Determine whether the given declaration is a static data member. | |
static void | DelegatingCycleHelper (CXXConstructorDecl *Ctor, llvm::SmallSet< CXXConstructorDecl *, 4 > &Valid, llvm::SmallSet< CXXConstructorDecl *, 4 > &Invalid, llvm::SmallSet< CXXConstructorDecl *, 4 > &Current, Sema &S) |
#define ABSTRACT_TYPELOC | ( | CLASS, | |
PARENT | |||
) |
#define CheckPolymorphic | ( | Type | ) |
void Check(Type TL, Sema::AbstractDiagSelID Sel) { \ Visit(TL.getNextTypeLoc(), Sema::AbstractNone); \ }
Definition at line 4521 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; |
ImplicitInitializerKind - How an implicit base or member initializer should initialize its base or member.
Definition at line 3258 of file SemaDeclCXX.cpp.
enum TrivialSubobjectKind |
The kind of subobject we are checking for triviality. The values of this enumeration are used in diagnostics.
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 5915 of file SemaDeclCXX.cpp.
static void AddMostOverridenMethods | ( | const CXXMethodDecl * | MD, |
llvm::SmallPtrSetImpl< const CXXMethodDecl * > & | Methods | ||
) | [static] |
Add the most overriden methods from MD to Methods.
Definition at line 6246 of file SemaDeclCXX.cpp.
References clang::CXXMethodDecl::begin_overridden_methods(), clang::CXXMethodDecl::end_overridden_methods(), clang::CXXMethodDecl::getCanonicalDecl(), and clang::CXXMethodDecl::size_overridden_methods().
Referenced by clang::Sema::FindHiddenVirtualMethods().
static bool BuildImplicitBaseInitializer | ( | Sema & | SemaRef, |
CXXConstructorDecl * | Constructor, | ||
ImplicitInitializerKind | ImplicitInitKind, | ||
CXXBaseSpecifier * | BaseSpec, | ||
bool | IsInheritedVirtualBase, | ||
CXXCtorInitializer *& | CXXBaseInit | ||
) | [static] |
Definition at line 3266 of file SemaDeclCXX.cpp.
References clang::Sema::BuildDeclRefExpr(), CastForMoving(), clang::CK_UncheckedDerivedToBase, clang::Sema::Context, clang::DeclRefExpr::Create(), clang::InitializationKind::CreateDefault(), clang::InitializationKind::CreateDirect(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::ActionResult< PtrTy, CompressInvalid >::getAs(), clang::Type::getAsCXXRecordDecl(), clang::CXXRecordDecl::getCanonicalDecl(), clang::CXXConstructorDecl::getInheritedConstructor(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), 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::VK_LValue, and clang::VK_XValue.
Referenced by clang::Sema::SetCtorInitializers().
static bool BuildImplicitMemberInitializer | ( | Sema & | SemaRef, |
CXXConstructorDecl * | Constructor, | ||
ImplicitInitializerKind | ImplicitInitKind, | ||
FieldDecl * | Field, | ||
IndirectFieldDecl * | Indirect, | ||
CXXCtorInitializer *& | CXXMemberInit | ||
) | [static] |
Definition at line 3376 of file SemaDeclCXX.cpp.
References clang::LookupResult::addDecl(), clang::AS_public, clang::Sema::BuildDeclRefExpr(), clang::Sema::BuildMemberReferenceExpr(), CastForMoving(), clang::Sema::Context, clang::VarDecl::Create(), clang::DeclRefExpr::Create(), clang::CXXCtorInitializer::Create(), clang::Sema::CreateBuiltinArraySubscriptExpr(), clang::InitializationKind::CreateDefault(), clang::InitializationKind::CreateDirect(), clang::Sema::CurContext, clang::Sema::DefaultLvalueConversion(), clang::Sema::Diag(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::IdentifierTable::get(), clang::ActionResult< PtrTy, CompressInvalid >::getAs(), clang::ASTContext::getAsConstantArrayType(), clang::ASTContext::getBaseElementType(), clang::FieldDecl::getBitWidthValue(), clang::NamedDecl::getDeclName(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), clang::QualType::getObjCLifetime(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::FieldDecl::getParent(), clang::ASTContext::getSizeType(), clang::ASTContext::getTagDeclType(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::ValueDecl::getType(), clang::ASTContext::Idents, IIK_Copy, IIK_Default, IIK_Inherit, IIK_Move, clang::InitializedEntity::InitializeElement(), clang::InitializedEntity::InitializeMember(), clang::FieldDecl::isBitField(), clang::QualType::isConstQualified(), clang::Decl::isImplicit(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Decl::isInvalidDecl(), clang::Type::isObjCRetainableType(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::TagDecl::isUnion(), clang::Sema::LookupMemberName, clang::Sema::MarkDeclRefReferenced(), clang::Sema::MaybeCreateExprWithCleanups(), clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::InitializationSequence::Perform(), RefersToRValueRef(), clang::SC_None, and clang::VK_LValue.
Referenced by CollectFieldInitializer().
static StmtResult buildMemcpyForAssignmentOp | ( | Sema & | S, |
SourceLocation | Loc, | ||
QualType | T, | ||
const ExprBuilder & | ToB, | ||
const ExprBuilder & | FromB | ||
) | [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 9442 of file SemaDeclCXX.cpp.
References clang::Sema::ActOnCallExpr(), clang::Sema::BuildDeclRefExpr(), clang::ASTContext::BuiltinFnTy, clang::Sema::Context, clang::IntegerLiteral::Create(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::IdentifierTable::get(), clang::ActionResult< PtrTy, CompressInvalid >::getAs(), clang::Type::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, clang::UO_AddrOf, and clang::VK_RValue.
Referenced by buildSingleCopyAssign().
static StmtResult buildSingleCopyAssign | ( | Sema & | S, |
SourceLocation | Loc, | ||
QualType | T, | ||
const ExprBuilder & | To, | ||
const ExprBuilder & | From, | ||
bool | CopyingBaseSubobject, | ||
bool | Copying | ||
) | [static] |
Definition at line 9711 of file SemaDeclCXX.cpp.
References buildMemcpyForAssignmentOp(), buildSingleCopyAssignRecursively(), clang::Sema::Context, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Type::isArrayType(), clang::QualType::isConstQualified(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::QualType::isTriviallyCopyableType(), and clang::QualType::isVolatileQualified().
Referenced by clang::Sema::DefineImplicitCopyAssignment(), and clang::Sema::DefineImplicitMoveAssignment().
static StmtResult buildSingleCopyAssignRecursively | ( | Sema & | S, |
SourceLocation | Loc, | ||
QualType | T, | ||
const ExprBuilder & | To, | ||
const ExprBuilder & | From, | ||
bool | CopyingBaseSubobject, | ||
bool | Copying, | ||
unsigned | Depth = 0 |
||
) | [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 9521 of file SemaDeclCXX.cpp.
References clang::Sema::ActOnExprStmt(), clang::Sema::ActOnForStmt(), clang::AS_protected, clang::AS_public, clang::prec::Assignment, clang::LookupResult::begin(), clang::BO_Assign, clang::BO_NE, clang::ASTContext::BoolTy, clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildMemberReferenceExpr(), clang::Sema::Context, clang::NestedNameSpecifier::Create(), clang::VarDecl::Create(), clang::IntegerLiteral::Create(), clang::Sema::CreateBuiltinBinOp(), clang::Sema::CurContext, clang::ASTContext::DeclarationNames, Depth, clang::LookupResult::Filter::done(), clang::LookupResult::end(), clang::LookupResult::Filter::erase(), clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::IdentifierTable::get(), clang::ActionResult< PtrTy, CompressInvalid >::getAs(), clang::Type::getAs(), clang::ASTContext::getAsConstantArrayType(), clang::ASTContext::getCanonicalType(), clang::DeclarationNameTable::getCXXOperatorName(), clang::ArrayType::getElementType(), clang::Sema::getLangOpts(), clang::CXXMemberCallExpr::getMethodDecl(), clang::ConstantArrayType::getSize(), clang::ASTContext::getSizeType(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::QualType::getTypePtr(), clang::ASTContext::getTypeSize(), clang::LookupResult::Filter::hasNext(), clang::ASTContext::Idents, clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::FunctionDecl::isTrivial(), clang::Sema::LookupOrdinaryName, clang::Sema::LookupQualifiedName(), clang::LookupResult::makeFilter(), clang::Sema::MakeFullDiscardedValueExpr(), clang::Sema::MakeFullExpr(), clang::CXXScopeSpec::MakeTrivial(), clang::LookupResult::Filter::next(), clang::OK_Ordinary, clang::SC_None, clang::VarDecl::setInit(), clang::StmtError(), clang::UO_PreInc, clang::VK_LValue, and clang::VK_RValue.
Referenced by buildSingleCopyAssign().
Definition at line 3243 of file SemaDeclCXX.cpp.
References clang::Sema::BuildCXXNamedCast(), clang::Sema::BuildReferenceType(), clang::Sema::Context, clang::Stmt::getLocStart(), clang::Stmt::getSourceRange(), clang::ASTContext::getTrivialTypeSourceInfo(), and clang::Expr::getType().
Referenced by BuildImplicitBaseInitializer(), and BuildImplicitMemberInitializer().
static void CheckAbstractClassUsage | ( | AbstractUsageInfo & | Info, |
CXXMethodDecl * | MD | ||
) | [static] |
Check for invalid uses of an abstract type in a method declaration.
Definition at line 4573 of file SemaDeclCXX.cpp.
References clang::Sema::AbstractNone, clang::FunctionDecl::doesThisDeclarationHaveABody(), clang::TypeSourceInfo::getTypeLoc(), and clang::DeclaratorDecl::getTypeSourceInfo().
Referenced by CheckAbstractClassUsage(), and clang::Sema::CheckCompletedCXXClass().
static void CheckAbstractClassUsage | ( | AbstractUsageInfo & | Info, |
CXXRecordDecl * | RD | ||
) | [static] |
Check for invalid uses of an abstract type within a class definition.
Definition at line 4588 of file SemaDeclCXX.cpp.
References clang::Sema::AbstractFieldType, clang::Sema::AbstractVariableType, CheckAbstractClassUsage(), clang::DeclContext::decls(), clang::TypeSourceInfo::getTypeLoc(), and clang::DeclaratorDecl::getTypeSourceInfo().
static void CheckConstexprCtorInitializer | ( | Sema & | SemaRef, |
const FunctionDecl * | Dcl, | ||
FieldDecl * | Field, | ||
llvm::SmallSet< Decl *, 16 > & | Inits, | ||
bool & | Diagnosed | ||
) | [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 | Set to true if an error is produced. |
Definition at line 939 of file SemaDeclCXX.cpp.
References clang::Type::castAs(), clang::Sema::Diag(), clang::Type::getAsCXXRecordDecl(), 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 clang::Sema::CheckConstexprFunctionBody().
static bool CheckConstexprDeclStmt | ( | Sema & | SemaRef, |
const FunctionDecl * | Dcl, | ||
DeclStmt * | DS, | ||
SourceLocation & | Cxx1yLoc | ||
) | [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 826 of file SemaDeclCXX.cpp.
References clang::DeclStmt::decls(), clang::Sema::Diag(), clang::TypeLoc::getBeginLoc(), clang::Sema::getLangOpts(), clang::DeclStmt::getLocStart(), clang::TypeLoc::getSourceRange(), clang::TypeLoc::getType(), clang::SourceLocation::isValid(), clang::Sema::RequireLiteralType(), and clang::VarDecl::TLS_Dynamic.
Referenced by CheckConstexprFunctionStmt().
static bool CheckConstexprFunctionStmt | ( | Sema & | SemaRef, |
const FunctionDecl * | Dcl, | ||
Stmt * | S, | ||
SmallVectorImpl< SourceLocation > & | ReturnStmts, | ||
SourceLocation & | Cxx1yLoc | ||
) | [static] |
Check the provided statement is allowed in a constexpr function definition.
Definition at line 978 of file SemaDeclCXX.cpp.
References clang::CompoundStmt::body(), CheckConstexprDeclStmt(), clang::Stmt::children(), clang::Sema::Diag(), clang::IfStmt::getElse(), clang::Sema::getLangOpts(), clang::Stmt::getLocStart(), clang::Stmt::getStmtClass(), clang::IfStmt::getThen(), clang::SourceLocation::isValid(), and S.
Referenced by clang::Sema::CheckConstexprFunctionBody().
static bool CheckConstexprParameterTypes | ( | Sema & | SemaRef, |
const FunctionDecl * | FD | ||
) | [static] |
Definition at line 728 of file SemaDeclCXX.cpp.
References clang::Type::getAs(), clang::Decl::getLocation(), clang::FunctionDecl::getParamDecl(), clang::ParmVarDecl::getSourceRange(), clang::ValueDecl::getType(), clang::FunctionProtoType::param_type_begin(), clang::FunctionProtoType::param_type_end(), and clang::Sema::RequireLiteralType().
Referenced by clang::Sema::CheckConstexprFunctionDecl().
static void checkDLLAttribute | ( | Sema & | S, |
CXXRecordDecl * | Class | ||
) | [static] |
Check class-level dllimport/dllexport attribute.
Definition at line 4621 of file SemaDeclCXX.cpp.
References clang::Sema::ActOnFinishInlineMethodDef(), clang::Attr::clone(), clang::Sema::Context, clang::DeclContext::decls(), clang::Sema::Diag(), clang::Sema::ForceDeclarationOfImplicitMembers(), clang::Sema::getASTContext(), clang::TargetInfo::getCXXABI(), clang::CXXRecordDecl::getDescribedClassTemplate(), clang::getDLLAttr(), clang::Attr::getKind(), clang::Attr::getLocation(), clang::Decl::getLocation(), clang::ASTContext::getTargetInfo(), clang::CXXRecordDecl::getTemplateSpecializationKind(), clang::NamedDecl::isExternallyVisible(), clang::Attr::isInherited(), clang::TargetCXXABI::isMicrosoft(), clang::Sema::MarkFunctionReferenced(), clang::Sema::ResolveExceptionSpec(), clang::TSK_ExplicitInstantiationDeclaration, and clang::TSK_ImplicitInstantiation.
Referenced by clang::Sema::CheckCompletedCXXClass().
static void CheckForDanglingReferenceOrPointer | ( | Sema & | S, |
ValueDecl * | Member, | ||
Expr * | Init, | ||
SourceLocation | IdLoc | ||
) | [static] |
Checks a member initializer expression for cases where reference (or pointer) members are bound to by-value parameters (or their addresses).
Definition at line 2934 of file SemaDeclCXX.cpp.
References clang::Sema::Diag(), clang::DeclRefExpr::getDecl(), clang::Expr::getExprLoc(), clang::Decl::getLocation(), clang::Stmt::getSourceRange(), clang::ValueDecl::getType(), clang::Expr::IgnoreParenImpCasts(), clang::Expr::IgnoreParens(), clang::Type::isPointerType(), clang::Type::isReferenceType(), and clang::UO_AddrOf.
Referenced by clang::Sema::BuildMemberInitializer().
static bool CheckMostOverridenMethods | ( | const CXXMethodDecl * | MD, |
const llvm::SmallPtrSetImpl< const CXXMethodDecl * > & | Methods | ||
) | [static] |
Check whether any most overriden method from MD in Methods.
Definition at line 6184 of file SemaDeclCXX.cpp.
References clang::CXXMethodDecl::begin_overridden_methods(), clang::CXXMethodDecl::end_overridden_methods(), clang::CXXMethodDecl::getCanonicalDecl(), and clang::CXXMethodDecl::size_overridden_methods().
Referenced by FindHiddenVirtualMethod().
static void checkMoveAssignmentForRepeatedMove | ( | Sema & | S, |
CXXRecordDecl * | Class, | ||
SourceLocation | CurrentLocation | ||
) | [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 10256 of file SemaDeclCXX.cpp.
References clang::CodeGen::Base, clang::CXXRecordDecl::bases(), clang::Sema::CXXMoveAssignment, clang::Sema::Diag(), clang::Type::getAsCXXRecordDecl(), clang::CXXRecordDecl::getCanonicalDecl(), clang::CXXBaseSpecifier::getLocStart(), clang::Sema::SpecialMemberOverloadResult::getMethod(), clang::CXXRecordDecl::getNumBases(), clang::CXXRecordDecl::getNumVBases(), clang::CXXBaseSpecifier::getSourceRange(), clang::CXXBaseSpecifier::getType(), clang::CXXRecordDecl::hasNonTrivialMoveAssignment(), clang::CXXRecordDecl::hasTrivialMoveAssignment(), clang::FunctionDecl::isDefaulted(), clang::DeclContext::isDependentContext(), clang::CXXMethodDecl::isMoveAssignmentOperator(), clang::FunctionDecl::isTrivial(), clang::CXXBaseSpecifier::isVirtual(), and clang::Sema::LookupSpecialMember().
Referenced by clang::Sema::DefineImplicitMoveAssignment().
static bool CheckOperatorDeleteDeclaration | ( | Sema & | SemaRef, |
FunctionDecl * | FnDecl | ||
) | [static] |
Definition at line 11339 of file SemaDeclCXX.cpp.
References CheckOperatorNewDeleteDeclarationScope(), CheckOperatorNewDeleteTypes(), clang::Sema::Context, clang::ASTContext::VoidPtrTy, and clang::ASTContext::VoidTy.
static bool CheckOperatorNewDeclaration | ( | Sema & | SemaRef, |
const FunctionDecl * | FnDecl | ||
) | [static] |
Definition at line 11308 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.
static bool CheckOperatorNewDeleteDeclarationScope | ( | Sema & | SemaRef, |
const FunctionDecl * | FnDecl | ||
) | [inline, static] |
Definition at line 11240 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().
static bool CheckOperatorNewDeleteTypes | ( | Sema & | SemaRef, |
const FunctionDecl * | FnDecl, | ||
CanQualType | ExpectedResultType, | ||
CanQualType | ExpectedFirstParamType, | ||
unsigned | DependentParamTypeDiag, | ||
unsigned | InvalidParamTypeDiag | ||
) | [inline, static] |
Definition at line 11260 of file SemaDeclCXX.cpp.
References clang::Sema::Context, clang::Sema::Diag(), clang::Type::getAs(), clang::ASTContext::getCanonicalType(), clang::NamedDecl::getDeclName(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::Decl::getLocation(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::ValueDecl::getType(), clang::CanQual< T >::getUnqualifiedType(), and clang::Type::isDependentType().
Referenced by CheckOperatorDeleteDeclaration(), and CheckOperatorNewDeclaration().
static bool checkTrivialClassMembers | ( | Sema & | S, |
CXXRecordDecl * | RD, | ||
Sema::CXXSpecialMember | CSM, | ||
bool | ConstArg, | ||
bool | Diagnose | ||
) | [static] |
Check whether the members of a class type allow a special member to be trivial.
Definition at line 5975 of file SemaDeclCXX.cpp.
References checkTrivialSubobjectCall(), clang::Sema::Context, clang::Sema::CXXDefaultConstructor, clang::Sema::Diag(), clang::Type::getAsCXXRecordDecl(), clang::ASTContext::getBaseElementType(), clang::Sema::getLangOpts(), clang::QualType::getObjCLifetime(), clang::QualType::hasNonTrivialObjCLifetime(), and TSK_Field.
Referenced by clang::Sema::SpecialMemberIsTrivial().
static bool checkTrivialSubobjectCall | ( | Sema & | S, |
SourceLocation | SubobjLoc, | ||
QualType | SubType, | ||
bool | ConstRHS, | ||
Sema::CXXSpecialMember | CSM, | ||
TrivialSubobjectKind | Kind, | ||
bool | Diagnose | ||
) | [static] |
Check whether the special member selected for a given type would be trivial.
Definition at line 5925 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::CXXMethodDecl::isUserProvided(), clang::Sema::SpecialMemberIsTrivial(), and TSK_CompleteObject.
Referenced by checkTrivialClassMembers(), clang::Sema::DiagnoseNontrivial(), and clang::Sema::SpecialMemberIsTrivial().
static bool CollectFieldInitializer | ( | Sema & | SemaRef, |
BaseAndFieldInfo & | Info, | ||
FieldDecl * | Field, | ||
IndirectFieldDecl * | Indirect = nullptr |
||
) | [static] |
Definition at line 3707 of file SemaDeclCXX.cpp.
References clang::Sema::BuildCXXDefaultInitExpr(), BuildImplicitMemberInitializer(), clang::Sema::Context, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::FieldDecl::getCanonicalDecl(), clang::ValueDecl::getType(), clang::FieldDecl::hasInClassInitializer(), isIncompleteOrZeroLengthArrayType(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), and clang::Decl::isInvalidDecl().
Referenced by clang::Sema::SetCtorInitializers().
static Sema::ImplicitExceptionSpecification computeImplicitExceptionSpec | ( | Sema & | S, |
SourceLocation | Loc, | ||
CXXMethodDecl * | MD | ||
) | [static] |
Definition at line 5059 of file SemaDeclCXX.cpp.
References clang::Sema::ComputeDefaultedCopyAssignmentExceptionSpec(), clang::Sema::ComputeDefaultedCopyCtorExceptionSpec(), clang::Sema::ComputeDefaultedDefaultCtorExceptionSpec(), clang::Sema::ComputeDefaultedDtorExceptionSpec(), clang::Sema::ComputeDefaultedMoveAssignmentExceptionSpec(), clang::Sema::ComputeDefaultedMoveCtorExceptionSpec(), clang::Sema::ComputeInheritingCtorExceptionSpec(), clang::Sema::CXXCopyAssignment, clang::Sema::CXXCopyConstructor, clang::Sema::CXXDefaultConstructor, clang::Sema::CXXDestructor, clang::Sema::CXXInvalid, clang::Sema::CXXMoveAssignment, clang::Sema::CXXMoveConstructor, and clang::Sema::getSpecialMember().
Referenced by clang::Sema::CheckExplicitlyDefaultedMemberExceptionSpec(), and clang::Sema::EvaluateImplicitExceptionSpec().
static bool defaultedSpecialMemberIsConstexpr | ( | Sema & | S, |
CXXRecordDecl * | ClassDecl, | ||
Sema::CXXSpecialMember | CSM, | ||
bool | ConstArg | ||
) | [static] |
Determine whether the specified special member function would be constexpr if it were implicitly defined.
Definition at line 4965 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::Type::getAs(), clang::ASTContext::getBaseElementType(), clang::QualType::getCVRQualifiers(), clang::RecordType::getDecl(), clang::Sema::getLangOpts(), clang::CXXRecordDecl::getNumVBases(), clang::CXXRecordDecl::isLiteral(), clang::TagDecl::isUnion(), and specialMemberIsConstexpr().
Referenced by clang::Sema::CheckExplicitlyDefaultedSpecialMember(), clang::Sema::DeclareImplicitCopyAssignment(), clang::Sema::DeclareImplicitCopyConstructor(), clang::Sema::DeclareImplicitDefaultConstructor(), clang::Sema::DeclareImplicitMoveAssignment(), and clang::Sema::DeclareImplicitMoveConstructor().
static void DelegatingCycleHelper | ( | CXXConstructorDecl * | Ctor, |
llvm::SmallSet< CXXConstructorDecl *, 4 > & | Valid, | ||
llvm::SmallSet< CXXConstructorDecl *, 4 > & | Invalid, | ||
llvm::SmallSet< CXXConstructorDecl *, 4 > & | Current, | ||
Sema & | S | ||
) | [static] |
Definition at line 13154 of file SemaDeclCXX.cpp.
References AttributeLangSupport::C, clang::Sema::Diag(), clang::CXXConstructorDecl::getCanonicalDecl(), clang::Decl::getLocation(), clang::CXXConstructorDecl::getTargetConstructor(), clang::FunctionDecl::hasBody(), clang::CXXConstructorDecl::init_begin(), clang::CXXConstructorDecl::isDelegatingConstructor(), and clang::Decl::isInvalidDecl().
Referenced by clang::Sema::CheckDelegatingCtorCycles().
static void DiagnoseBaseOrMemInitializerOrder | ( | Sema & | SemaRef, |
const CXXConstructorDecl * | Constructor, | ||
ArrayRef< CXXCtorInitializer * > | Inits | ||
) | [static] |
Definition at line 3993 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), clang::Sema::Context, clang::Sema::Diag(), clang::Sema::Diags, clang::CXXCtorInitializer::getAnyMember(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), GetKeyForBase(), GetKeyForMember(), clang::CXXMethodDecl::getParent(), clang::CXXCtorInitializer::getSourceLocation(), clang::TypeSourceInfo::getType(), clang::Expr::getType(), clang::CXXCtorInitializer::getTypeSourceInfo(), clang::CXXCtorInitializer::isAnyMemberInitializer(), clang::DeclContext::isDependentContext(), clang::DiagnosticsEngine::isIgnored(), clang::FieldDecl::isUnnamedBitfield(), PopulateKeysForFields(), and clang::CXXRecordDecl::vbases().
Referenced by clang::Sema::ActOnMemInitializers().
static void diagnoseDeprecatedCopyOperation | ( | Sema & | S, |
CXXMethodDecl * | CopyOp, | ||
SourceLocation | UseLoc | ||
) | [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 9865 of file SemaDeclCXX.cpp.
References clang::Sema::CXXCopyAssignment, clang::Sema::CXXCopyConstructor, clang::Sema::Diag(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::CXXMethodDecl::getParent(), and clang::Decl::isImplicit().
Referenced by clang::Sema::DefineImplicitCopyAssignment(), and clang::Sema::DefineImplicitCopyConstructor().
static void DiagnoseNamespaceInlineMismatch | ( | Sema & | S, |
SourceLocation | KeywordLoc, | ||
SourceLocation | Loc, | ||
IdentifierInfo * | II, | ||
bool * | IsInline, | ||
NamespaceDecl * | PrevNS | ||
) | [static] |
Diagnose a mismatch in 'inline' qualifiers when a namespace is reopened.
Definition at line 6942 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 bool FindBaseInitializer | ( | Sema & | SemaRef, |
CXXRecordDecl * | ClassDecl, | ||
QualType | BaseType, | ||
const CXXBaseSpecifier *& | DirectBaseSpec, | ||
const CXXBaseSpecifier *& | VirtualBaseSpec | ||
) | [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 2676 of file SemaDeclCXX.cpp.
References clang::CodeGen::Base, clang::CXXRecordDecl::bases(), clang::CXXBasePaths::begin(), clang::Sema::Context, clang::CXXBasePaths::end(), clang::Expr::getType(), clang::ASTContext::getTypeDeclType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Sema::IsDerivedFrom(), and clang::CXXBaseSpecifier::isVirtual().
Referenced by clang::Sema::BuildBaseInitializer(), and clang::Sema::BuildMemInitializer().
static bool findCircularInheritance | ( | const CXXRecordDecl * | Class, |
const CXXRecordDecl * | Current | ||
) | [static] |
Determine whether the given class is a base class of the given class, including looking at dependent bases.
Definition at line 1279 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases(), clang::CXXRecordDecl::getCanonicalDecl(), and clang::CXXRecordDecl::getDefinition().
Referenced by clang::Sema::CheckBaseSpecifier().
static CXXBaseSpecifier* findDirectBaseWithType | ( | CXXRecordDecl * | Derived, |
QualType | DesiredBase, | ||
bool & | AnyDependentBases | ||
) | [static] |
Find the base specifier for a base class with the given type.
Definition at line 7762 of file SemaDeclCXX.cpp.
References clang::CodeGen::Base, clang::CXXRecordDecl::bases(), clang::Type::getCanonicalTypeUnqualified(), and clang::CXXBaseSpecifier::getType().
Referenced by clang::Sema::CheckInheritingConstructorUsingDecl().
static bool FindHiddenVirtualMethod | ( | const CXXBaseSpecifier * | Specifier, |
CXXBasePath & | Path, | ||
void * | UserData | ||
) | [static] |
Member lookup function that determines whether a given C++ method overloads virtual methods in a base class without overriding any, to be used with CXXRecordDecl::lookupInBases().
Definition at line 6199 of file SemaDeclCXX.cpp.
References CheckMostOverridenMethods(), clang::CXXBasePath::Decls, clang::Type::getAs(), clang::CXXMethodDecl::getCanonicalDecl(), clang::DeclarationName::getNameKind(), clang::CXXBaseSpecifier::getType(), clang::DeclarationName::Identifier, clang::CXXMethodDecl::isVirtual(), and clang::DeclContext::lookup().
Referenced by clang::Sema::FindHiddenVirtualMethods().
static bool findTrivialSpecialMember | ( | Sema & | S, |
CXXRecordDecl * | RD, | ||
Sema::CXXSpecialMember | CSM, | ||
unsigned | Quals, | ||
bool | ConstRHS, | ||
CXXMethodDecl ** | Selected | ||
) | [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.
Definition at line 5780 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::hasTrivialDefaultConstructor(), clang::CXXRecordDecl::hasTrivialDestructor(), clang::FunctionDecl::isTrivial(), clang::CXXMethodDecl::isUserProvided(), lookupCallFromSpecialMember(), clang::CXXRecordDecl::needsImplicitDefaultConstructor(), clang::CXXRecordDecl::needsImplicitDestructor(), and clang::Sema::SpecialMemberOverloadResult::NoMemberOrDeleted.
Referenced by checkTrivialSubobjectCall().
static CXXConstructorDecl* findUserDeclaredCtor | ( | CXXRecordDecl * | RD | ) | [static] |
Definition at line 5897 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::ctors(), clang::DeclContext::decls_begin(), and clang::DeclContext::decls_end().
Referenced by checkTrivialSubobjectCall().
static bool functionDeclHasDefaultArgument | ( | const FunctionDecl * | FD | ) | [static] |
Definition at line 408 of file SemaDeclCXX.cpp.
References clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::ParmVarDecl::hasDefaultArg(), and clang::ParmVarDecl::hasInheritedDefaultArg().
Referenced by clang::Sema::ActOnFriendFunctionDecl(), and clang::Sema::MergeCXXFunctionDecl().
static FunctionProtoType::ExtProtoInfo getImplicitMethodEPI | ( | Sema & | S, |
CXXMethodDecl * | MD | ||
) | [static] |
Definition at line 5081 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().
Referenced by clang::Sema::DeclareImplicitCopyAssignment(), clang::Sema::DeclareImplicitCopyConstructor(), clang::Sema::DeclareImplicitDefaultConstructor(), clang::Sema::DeclareImplicitDestructor(), clang::Sema::DeclareImplicitMoveAssignment(), and clang::Sema::DeclareImplicitMoveConstructor().
static const void* GetKeyForBase | ( | ASTContext & | Context, |
QualType | BaseType | ||
) | [static] |
Definition at line 3981 of file SemaDeclCXX.cpp.
References clang::ASTContext::getCanonicalType(), and clang::CanQual< T >::getTypePtr().
Referenced by DiagnoseBaseOrMemInitializerOrder(), and GetKeyForMember().
static const void* GetKeyForMember | ( | ASTContext & | Context, |
CXXCtorInitializer * | Member | ||
) | [static] |
Definition at line 3985 of file SemaDeclCXX.cpp.
References clang::CXXCtorInitializer::getAnyMember(), clang::CXXCtorInitializer::getBaseClass(), clang::FieldDecl::getCanonicalDecl(), GetKeyForBase(), and clang::CXXCtorInitializer::isAnyMemberInitializer().
Referenced by clang::Sema::ActOnMemInitializers(), and DiagnoseBaseOrMemInitializerOrder().
static AttributeList* getMSPropertyAttr | ( | AttributeList * | list | ) | [static] |
Definition at line 1951 of file SemaDeclCXX.cpp.
References clang::AttributeList::getNext().
Referenced by clang::Sema::ActOnCXXMemberDeclarator().
static NamespaceDecl* getNamespaceDecl | ( | NamedDecl * | D | ) | [inline, static] |
getNamespaceDecl - Returns the namespace a decl represents. If the decl is a namespace alias, returns the namespace it points to.
Definition at line 7138 of file SemaDeclCXX.cpp.
Referenced by clang::Sema::ActOnNamespaceAliasDef(), and clang::Sema::ActOnUsingDirective().
static unsigned getRecordDiagFromTagKind | ( | TagTypeKind | Tag | ) | [static] |
Get diagnostic select index for tag kind for record diagnostic message. WARNING: Indexes apply to particular diagnostics only!
Definition at line 752 of file SemaDeclCXX.cpp.
References clang::TTK_Class, clang::TTK_Interface, and clang::TTK_Struct.
Referenced by clang::Sema::AttachBaseSpecifiers(), and clang::Sema::CheckConstexprFunctionDecl().
static bool hasOneRealArgument | ( | MultiExprArg | Args | ) | [static] |
Determine whether the given list arguments contains exactly one "real" (non-default) argument.
Definition at line 11041 of file SemaDeclCXX.cpp.
Referenced by clang::Sema::BuildCXXConstructExpr().
static bool InitializationHasSideEffects | ( | const FieldDecl & | FD | ) | [static] |
Definition at line 1941 of file SemaDeclCXX.cpp.
References clang::Type::getAsCXXRecordDecl(), clang::Type::getBaseElementTypeUnsafe(), and clang::ValueDecl::getType().
Referenced by clang::Sema::ActOnCXXMemberDeclarator().
static bool IsEquivalentForUsingDecl | ( | ASTContext & | Context, |
NamedDecl * | D1, | ||
NamedDecl * | D2 | ||
) | [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 7537 of file SemaDeclCXX.cpp.
References clang::Decl::getCanonicalDecl(), and clang::ASTContext::hasSameType().
Referenced by clang::Sema::CheckUsingShadowDecl().
static bool isIncompleteOrZeroLengthArrayType | ( | ASTContext & | Context, |
QualType | T | ||
) | [static] |
Determine whether the given type is an incomplete or zero-lenfgth array type.
Definition at line 3693 of file SemaDeclCXX.cpp.
References clang::ASTContext::getAsConstantArrayType(), and clang::Type::isIncompleteArrayType().
Referenced by CollectFieldInitializer(), and clang::Sema::MarkBaseAndMemberDestructorsReferenced().
static bool isStaticDataMember | ( | const Decl * | D | ) | [static] |
Determine whether the given declaration is a static data member.
Definition at line 12825 of file SemaDeclCXX.cpp.
Referenced by clang::Sema::ActOnCXXEnterDeclInitializer(), clang::Sema::ActOnCXXExitDeclInitializer(), and clang::VarDecl::isFileVarDecl().
static bool IsUsingDirectiveInToplevelContext | ( | DeclContext * | CurContext | ) | [static] |
Determine whether a using statement is in a context where it will be apply in all contexts.
Definition at line 7310 of file SemaDeclCXX.cpp.
References clang::DeclContext::getDeclKind(), and clang::DeclContext::getParent().
Referenced by clang::Sema::ActOnUsingDirective().
static Sema::SpecialMemberOverloadResult* lookupCallFromSpecialMember | ( | Sema & | S, |
CXXRecordDecl * | Class, | ||
Sema::CXXSpecialMember | CSM, | ||
unsigned | FieldQuals, | ||
bool | ConstRHS | ||
) | [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 4928 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 ClassTemplateDecl* LookupStdInitializerList | ( | Sema & | S, |
SourceLocation | Loc | ||
) | [static] |
Definition at line 7242 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(), and clang::Sema::PP.
Referenced by clang::Sema::BuildStdInitializerList().
static void PopulateKeysForFields | ( | FieldDecl * | Field, |
SmallVectorImpl< const void * > & | IdealInits | ||
) | [static] |
Definition at line 3969 of file SemaDeclCXX.cpp.
References clang::Type::getAs(), clang::FieldDecl::getCanonicalDecl(), clang::ValueDecl::getType(), and clang::RecordDecl::isAnonymousStructOrUnion().
Referenced by DiagnoseBaseOrMemInitializerOrder().
static void propagateDLLAttrToBaseClassTemplate | ( | Sema & | S, |
CXXRecordDecl * | Class, | ||
Attr * | ClassAttr, | ||
ClassTemplateSpecializationDecl * | BaseTemplateSpec, | ||
SourceLocation | BaseLoc | ||
) | [static] |
Perform propagation of DLL attributes from a derived class to a templated base class for MS compatibility.
Definition at line 1311 of file SemaDeclCXX.cpp.
References clang::Decl::addAttr(), clang::Attr::clone(), clang::Sema::Diag(), clang::Sema::getASTContext(), clang::getDLLAttr(), clang::Attr::getKind(), clang::Attr::getLocation(), clang::Decl::getLocation(), clang::ClassTemplateSpecializationDecl::getPointOfInstantiation(), clang::ClassTemplateSpecializationDecl::getSpecializationKind(), clang::ClassTemplateSpecializationDecl::getSpecializedTemplate(), clang::ClassTemplateDecl::getTemplatedDecl(), clang::ClassTemplateSpecializationDecl::isExplicitSpecialization(), and clang::TSK_Undeclared.
Referenced by clang::Sema::CheckBaseSpecifier().
static bool RefersToRValueRef | ( | Expr * | MemRef | ) | [static] |
Definition at line 3370 of file SemaDeclCXX.cpp.
References clang::ValueDecl::getType(), and clang::Type::isRValueReferenceType().
Referenced by BuildImplicitMemberInitializer().
static void SearchForReturnInStmt | ( | Sema & | Self, |
Stmt * | S | ||
) | [static] |
Definition at line 12653 of file SemaDeclCXX.cpp.
References clang::Stmt::children(), clang::Sema::Diag(), and clang::Stmt::getLocStart().
Referenced by clang::Sema::DiagnoseReturnInConstructorExceptionHandler().
static bool specialMemberIsConstexpr | ( | Sema & | S, |
CXXRecordDecl * | ClassDecl, | ||
Sema::CXXSpecialMember | CSM, | ||
unsigned | Quals, | ||
bool | ConstRHS | ||
) | [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 4951 of file SemaDeclCXX.cpp.
References clang::Sema::SpecialMemberOverloadResult::getMethod(), clang::FunctionDecl::isConstexpr(), and lookupCallFromSpecialMember().
Referenced by defaultedSpecialMemberIsConstexpr().
static bool TryNamespaceTypoCorrection | ( | Sema & | S, |
LookupResult & | R, | ||
Scope * | Sc, | ||
CXXScopeSpec & | SS, | ||
SourceLocation | IdentLoc, | ||
IdentifierInfo * | Ident | ||
) | [static] |
Definition at line 7335 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().