clang API Documentation
#include "clang/Sema/SemaInternal.h"#include "clang/Sema/CXXFieldCollector.h"#include "clang/Sema/Scope.h"#include "clang/Sema/Initialization.h"#include "clang/Sema/Lookup.h"#include "clang/AST/ASTConsumer.h"#include "clang/AST/ASTContext.h"#include "clang/AST/ASTMutationListener.h"#include "clang/AST/CharUnits.h"#include "clang/AST/CXXInheritance.h"#include "clang/AST/DeclVisitor.h"#include "clang/AST/ExprCXX.h"#include "clang/AST/RecordLayout.h"#include "clang/AST/StmtVisitor.h"#include "clang/AST/TypeLoc.h"#include "clang/AST/TypeOrdering.h"#include "clang/Sema/DeclSpec.h"#include "clang/Sema/ParsedTemplate.h"#include "clang/Basic/PartialDiagnostic.h"#include "clang/Lex/Preprocessor.h"#include "llvm/ADT/DenseSet.h"#include "llvm/ADT/SmallString.h"#include "llvm/ADT/STLExtras.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(cast<CLASS##TypeLoc>(TL), 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 } |
Functions | |
| static bool | CheckConstexprParameterTypes (Sema &SemaRef, const FunctionDecl *FD, Sema::CheckConstexprKind CCK) |
| static bool | CheckConstexprDeclStmt (Sema &SemaRef, const FunctionDecl *Dcl, DeclStmt *DS) |
| static void | CheckConstexprCtorInitializer (Sema &SemaRef, const FunctionDecl *Dcl, FieldDecl *Field, llvm::SmallSet< Decl *, 16 > &Inits, bool &Diagnosed) |
| static CXXRecordDecl * | GetClassForType (QualType T) |
| 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 bool | InitExprContainsUninitializedFields (const Stmt *S, const ValueDecl *LhsField, SourceLocation *L) |
| static Expr * | CastForMoving (Sema &SemaRef, Expr *E) |
| 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 | isWithinAnonymousUnion (IndirectFieldDecl *F) |
| Determine whether the given indirect field declaration is somewhere within an anonymous union. | |
| 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=0) |
| static void * | GetKeyForTopLevelField (FieldDecl *Field) |
| static void * | GetKeyForBase (ASTContext &Context, QualType BaseType) |
| static void * | GetKeyForMember (ASTContext &Context, CXXCtorInitializer *Member) |
| static void | DiagnoseBaseOrMemInitializerOrder (Sema &SemaRef, const CXXConstructorDecl *Constructor, CXXCtorInitializer **Inits, unsigned NumInits) |
| 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 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 bool | FTIHasSingleVoidArgument (DeclaratorChunk::FunctionTypeInfo &FTI) |
| 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, bool &SuppressRedeclaration) |
| 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 CXXConstructorDecl * | getDefaultedDefaultConstructorUnsafe (Sema &Self, CXXRecordDecl *D) |
| static StmtResult | BuildSingleCopyAssign (Sema &S, SourceLocation Loc, QualType T, Expr *To, Expr *From, bool CopyingBaseSubobject, bool Copying, unsigned Depth=0) |
Builds a statement that copies/moves the given entity from From to To. | |
| 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, const FunctionDecl *FnDecl) |
| static void | SearchForReturnInStmt (Sema &Self, Stmt *S) |
| 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 3518 of file SemaDeclCXX.cpp.
| #define OVERLOADED_OPERATOR | ( | Name, | |
| Spelling, | |||
| Token, | |||
| Unary, | |||
| Binary, | |||
| MemberOnly | |||
| ) | , { Unary, Binary, MemberOnly } |
| #define TYPELOC | ( | CLASS, | |
| PARENT | |||
| ) | case TypeLoc::CLASS: Check(cast<CLASS##TypeLoc>(TL), Sel); break; |
ImplicitInitializerKind - How an implicit base or member initializer should initialize its base or member.
Definition at line 2363 of file SemaDeclCXX.cpp.
| static bool BuildImplicitBaseInitializer | ( | Sema & | SemaRef, |
| CXXConstructorDecl * | Constructor, | ||
| ImplicitInitializerKind | ImplicitInitKind, | ||
| CXXBaseSpecifier * | BaseSpec, | ||
| bool | IsInheritedVirtualBase, | ||
| CXXCtorInitializer *& | CXXBaseInit | ||
| ) | [static] |
Definition at line 2370 of file SemaDeclCXX.cpp.
References CastForMoving(), clang::CK_UncheckedDerivedToBase, clang::Sema::Context, clang::DeclRefExpr::Create(), clang::InitializationKind::CreateDefault(), clang::InitializationKind::CreateDirect(), 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_Move, clang::Sema::ImpCastExprToType(), clang::InitializedEntity::InitializeBase(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::CXXBaseSpecifier::isVirtual(), clang::Sema::MarkDeclRefReferenced(), clang::Sema::MaybeCreateExprWithCleanups(), Param, clang::ActionResult< PtrTy, CompressInvalid >::take(), clang::ActionResult< PtrTy, CompressInvalid >::takeAs(), 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 2455 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::ASTContext::getAsConstantArrayType(), clang::ASTContext::getBaseElementType(), clang::FieldDecl::getBitWidthValue(), clang::NamedDecl::getDeclName(), clang::Sema::getLangOptions(), 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_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::TagDecl::isUnion(), clang::Sema::LookupMemberName, clang::Sema::MarkDeclRefReferenced(), clang::Sema::MaybeCreateExprWithCleanups(), clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, Param, clang::InitializationSequence::Perform(), RefersToRValueRef(), clang::SC_None, clang::ActionResult< PtrTy, CompressInvalid >::take(), clang::ActionResult< PtrTy, CompressInvalid >::takeAs(), and clang::VK_LValue.
Referenced by CollectFieldInitializer().
| static StmtResult BuildSingleCopyAssign | ( | Sema & | S, |
| SourceLocation | Loc, | ||
| QualType | T, | ||
| Expr * | To, | ||
| Expr * | 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 7542 of file SemaDeclCXX.cpp.
References clang::Sema::ActOnForStmt(), clang::AS_protected, clang::AS_public, clang::AssertSuccess(), clang::prec::Assignment, clang::LookupResult::begin(), clang::BO_Assign, clang::BO_NE, clang::ASTContext::BoolTy, clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildDeclRefExpr(), clang::Sema::BuildMemberReferenceExpr(), CastForMoving(), clang::Sema::Context, clang::NestedNameSpecifier::Create(), clang::VarDecl::Create(), clang::IntegerLiteral::Create(), clang::Sema::CreateBuiltinArraySubscriptExpr(), clang::Sema::CreateBuiltinBinOp(), clang::Sema::CurContext, clang::ASTContext::DeclarationNames, clang::Sema::DefaultLvalueConversion(), clang::LookupResult::Filter::done(), clang::LookupResult::end(), clang::LookupResult::Filter::erase(), clang::IdentifierTable::get(), clang::ASTContext::getAsConstantArrayType(), clang::ASTContext::getCanonicalType(), clang::DeclarationNameTable::getCXXOperatorName(), clang::ArrayType::getElementType(), clang::ConstantArrayType::getSize(), clang::ASTContext::getSizeType(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::QualType::getTypePtr(), clang::ASTContext::getTypeSize(), clang::LookupResult::Filter::hasNext(), clang::ASTContext::Idents, clang::CXXMethodDecl::isCopyAssignmentOperator(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::CXXMethodDecl::isMoveAssignmentOperator(), clang::Sema::LookupOrdinaryName, clang::Sema::LookupQualifiedName(), clang::LookupResult::makeFilter(), clang::Sema::MakeFullExpr(), clang::CXXScopeSpec::MakeTrivial(), clang::LookupResult::Filter::next(), clang::OK_Ordinary, clang::Sema::Owned(), clang::SC_None, clang::VarDecl::setInit(), clang::StmtError(), clang::ActionResult< PtrTy, CompressInvalid >::take(), clang::ActionResult< PtrTy, CompressInvalid >::takeAs(), clang::UO_PreInc, clang::VK_LValue, and clang::VK_RValue.
Referenced by clang::Sema::DefineImplicitCopyAssignment(), and clang::Sema::DefineImplicitMoveAssignment().
Definition at line 2349 of file SemaDeclCXX.cpp.
References clang::Sema::BuildCXXNamedCast(), clang::Sema::Context, clang::Stmt::getLocStart(), clang::ASTContext::getRValueReferenceType(), clang::Stmt::getSourceRange(), clang::ASTContext::getTrivialTypeSourceInfo(), and clang::Expr::getType().
Referenced by BuildImplicitBaseInitializer(), BuildImplicitMemberInitializer(), BuildSingleCopyAssign(), and clang::Sema::DefineImplicitMoveAssignment().
| static void CheckAbstractClassUsage | ( | AbstractUsageInfo & | Info, |
| CXXMethodDecl * | MD | ||
| ) | [static] |
Check for invalid uses of an abstract type in a method declaration.
Definition at line 3570 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 3585 of file SemaDeclCXX.cpp.
References clang::Sema::AbstractFieldType, clang::Sema::AbstractVariableType, CheckAbstractClassUsage(), clang::DeclContext::decls_begin(), clang::DeclContext::decls_end(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclaratorDecl::getTypeSourceInfo(), and clang::Decl::isImplicit().
| 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 811 of file SemaDeclCXX.cpp.
References clang::Sema::Diag(), clang::RecordDecl::field_begin(), clang::RecordDecl::field_end(), clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::FieldDecl::isAnonymousStructOrUnion(), clang::TagDecl::isUnion(), and clang::FieldDecl::isUnnamedBitfield().
Referenced by clang::Sema::CheckConstexprFunctionBody().
| static bool CheckConstexprDeclStmt | ( | Sema & | SemaRef, |
| const FunctionDecl * | Dcl, | ||
| DeclStmt * | DS | ||
| ) | [static] |
Check the given declaration statement is legal within a constexpr function body. C++0x [dcl.constexpr]p3,p4.
Definition at line 742 of file SemaDeclCXX.cpp.
References clang::DeclStmt::decl_begin(), clang::DeclStmt::decl_end(), clang::Sema::Diag(), clang::TypeLoc::getBeginLoc(), clang::Stmt::getLocStart(), clang::TypeLoc::getSourceRange(), clang::TypeLoc::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::TypedefNameDecl::getTypeSourceInfo(), and clang::TypedefNameDecl::getUnderlyingType().
Referenced by clang::Sema::CheckConstexprFunctionBody().
| static bool CheckConstexprParameterTypes | ( | Sema & | SemaRef, |
| const FunctionDecl * | FD, | ||
| Sema::CheckConstexprKind | CCK | ||
| ) | [static] |
Definition at line 623 of file SemaDeclCXX.cpp.
References clang::FunctionProtoType::arg_type_begin(), clang::FunctionProtoType::arg_type_end(), clang::Sema::CCK_Declaration, clang::Sema::CCK_NoteNonConstexprInstantiation, clang::Sema::Diag(), clang::Decl::getLocation(), clang::FunctionDecl::getParamDecl(), clang::ParmVarDecl::getSourceRange(), clang::ValueDecl::getType(), clang::Sema::PDiag(), and clang::Sema::RequireLiteralType().
Referenced by clang::Sema::CheckConstexprFunctionDecl().
| 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 1963 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(), and clang::UO_AddrOf.
Referenced by clang::Sema::BuildMemberInitializer().
| static bool CheckOperatorDeleteDeclaration | ( | Sema & | SemaRef, |
| const FunctionDecl * | FnDecl | ||
| ) | [static] |
Definition at line 9412 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 9381 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 9313 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 9333 of file SemaDeclCXX.cpp.
References clang::Sema::Context, clang::Sema::Diag(), clang::ASTContext::getCanonicalType(), clang::NamedDecl::getDeclName(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::Decl::getLocation(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::ValueDecl::getType(), and clang::CanQual< T >::getUnqualifiedType().
Referenced by CheckOperatorDeleteDeclaration(), and CheckOperatorNewDeclaration().
| static bool CollectFieldInitializer | ( | Sema & | SemaRef, |
| BaseAndFieldInfo & | Info, | ||
| FieldDecl * | Field, | ||
| IndirectFieldDecl * | Indirect = 0 |
||
| ) | [static] |
Definition at line 2744 of file SemaDeclCXX.cpp.
References BuildImplicitMemberInitializer(), clang::Sema::Context, clang::FieldDecl::getParent(), clang::ValueDecl::getType(), clang::FieldDecl::hasInClassInitializer(), isIncompleteOrZeroLengthArrayType(), clang::Decl::isInvalidDecl(), clang::TagDecl::isUnion(), and isWithinAnonymousUnion().
Referenced by clang::Sema::SetCtorInitializers().
| 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 10997 of file SemaDeclCXX.cpp.
References 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, | ||
| CXXCtorInitializer ** | Inits, | ||
| unsigned | NumInits | ||
| ) | [static] |
Definition at line 3011 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases_begin(), clang::CXXRecordDecl::bases_end(), clang::Sema::Context, clang::Sema::Diag(), clang::Sema::Diags, clang::RecordDecl::field_begin(), clang::RecordDecl::field_end(), clang::CXXCtorInitializer::getAnyMember(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::DiagnosticsEngine::getDiagnosticLevel(), GetKeyForBase(), GetKeyForMember(), GetKeyForTopLevelField(), clang::CXXMethodDecl::getParent(), clang::CXXCtorInitializer::getSourceLocation(), clang::TypeSourceInfo::getType(), clang::CXXCtorInitializer::getTypeSourceInfo(), clang::DiagnosticsEngine::Ignored, clang::CXXCtorInitializer::isAnyMemberInitializer(), clang::DeclContext::isDependentContext(), clang::CXXRecordDecl::vbases_begin(), and clang::CXXRecordDecl::vbases_end().
Referenced by clang::Sema::ActOnMemInitializers().
| 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 1697 of file SemaDeclCXX.cpp.
References clang::CXXRecordDecl::bases_begin(), clang::CXXRecordDecl::bases_end(), clang::CXXBasePaths::begin(), clang::Sema::Context, clang::CXXBasePaths::end(), clang::ASTContext::getTypeDeclType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Sema::IsDerivedFrom(), and clang::CXXBaseSpecifier::isVirtual().
Referenced by clang::Sema::BuildBaseInitializer(), and clang::Sema::BuildMemInitializer().
| 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 4934 of file SemaDeclCXX.cpp.
References clang::CXXBasePath::Decls, clang::DeclarationName::getNameKind(), clang::CXXBaseSpecifier::getType(), clang::DeclarationName::Identifier, and clang::DeclContext::lookup().
Referenced by clang::Sema::DiagnoseHiddenVirtualMethods().
| static bool FTIHasSingleVoidArgument | ( | DeclaratorChunk::FunctionTypeInfo & | FTI | ) | [inline, static] |
Definition at line 5330 of file SemaDeclCXX.cpp.
References clang::DeclaratorChunk::FunctionTypeInfo::ArgInfo, clang::DeclaratorChunk::FunctionTypeInfo::isVariadic, and clang::DeclaratorChunk::FunctionTypeInfo::NumArgs.
Referenced by clang::Sema::CheckDestructorDeclarator().
| static CXXRecordDecl* GetClassForType | ( | QualType | T | ) | [static] |
Definition at line 1208 of file SemaDeclCXX.cpp.
Referenced by clang::Sema::IsDerivedFrom().
| static CXXConstructorDecl* getDefaultedDefaultConstructorUnsafe | ( | Sema & | Self, |
| CXXRecordDecl * | D | ||
| ) | [static] |
Get any existing defaulted default constructor for the given class. Do not implicitly define one if it does not exist.
Definition at line 7127 of file SemaDeclCXX.cpp.
References clang::Sema::Context, clang::ASTContext::DeclarationNames, clang::ASTContext::getCanonicalType(), clang::DeclarationNameTable::getCXXConstructorName(), clang::ASTContext::getTypeDeclType(), clang::QualType::getUnqualifiedType(), clang::CXXConstructorDecl::isDefaultConstructor(), clang::FunctionDecl::isDefaulted(), and clang::DeclContext::lookup().
Referenced by clang::Sema::ActOnFinishDelayedMemberInitializers().
| static void* GetKeyForBase | ( | ASTContext & | Context, |
| QualType | BaseType | ||
| ) | [static] |
Definition at line 2979 of file SemaDeclCXX.cpp.
References clang::ASTContext::getCanonicalType(), and clang::CanQual< T >::getTypePtr().
Referenced by clang::Sema::ActOnMemInitializers(), DiagnoseBaseOrMemInitializerOrder(), and GetKeyForMember().
| static void* GetKeyForMember | ( | ASTContext & | Context, |
| CXXCtorInitializer * | Member | ||
| ) | [static] |
Definition at line 2983 of file SemaDeclCXX.cpp.
References clang::CXXCtorInitializer::getAnyMember(), clang::CXXCtorInitializer::getBaseClass(), clang::Decl::getDeclContext(), GetKeyForBase(), clang::FieldDecl::getParent(), clang::RecordDecl::isAnonymousStructOrUnion(), and clang::CXXCtorInitializer::isAnyMemberInitializer().
Referenced by DiagnoseBaseOrMemInitializerOrder().
| static void* GetKeyForTopLevelField | ( | FieldDecl * | Field | ) | [static] |
Definition at line 2970 of file SemaDeclCXX.cpp.
References clang::ValueDecl::getType().
Referenced by DiagnoseBaseOrMemInitializerOrder().
| 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 5759 of file SemaDeclCXX.cpp.
Referenced by clang::Sema::ActOnNamespaceAliasDef(), and clang::Sema::ActOnUsingDirective().
| static bool InitExprContainsUninitializedFields | ( | const Stmt * | S, |
| const ValueDecl * | LhsField, | ||
| SourceLocation * | L | ||
| ) | [static] |
Checks an initializer expression for use of uninitialized fields, such as containing the field that is being initialized. Returns true if there is an uninitialized field was used an updates the SourceLocation parameter; false otherwise.
Definition at line 2020 of file SemaDeclCXX.cpp.
References clang::Stmt::children(), clang::Expr::IgnoreParenCasts(), NULL, and clang::UO_AddrOf.
Referenced by clang::Sema::BuildMemberInitializer().
| static bool IsEquivalentForUsingDecl | ( | ASTContext & | Context, |
| NamedDecl * | D1, | ||
| NamedDecl * | D2, | ||
| bool & | SuppressRedeclaration | ||
| ) | [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 6157 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 2730 of file SemaDeclCXX.cpp.
References clang::ASTContext::getAsConstantArrayType().
Referenced by CollectFieldInitializer(), and clang::Sema::MarkBaseAndMemberDestructorsReferenced().
| 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 5931 of file SemaDeclCXX.cpp.
References clang::DeclContext::getDeclKind(), and clang::DeclContext::getParent().
Referenced by clang::Sema::ActOnUsingDirective().
| static bool isWithinAnonymousUnion | ( | IndirectFieldDecl * | F | ) | [static] |
Determine whether the given indirect field declaration is somewhere within an anonymous union.
Definition at line 2717 of file SemaDeclCXX.cpp.
References clang::IndirectFieldDecl::chain_begin(), and clang::IndirectFieldDecl::chain_end().
Referenced by CollectFieldInitializer().
| static ClassTemplateDecl* LookupStdInitializerList | ( | Sema & | S, |
| SourceLocation | Loc | ||
| ) | [static] |
Definition at line 5863 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 bool RefersToRValueRef | ( | Expr * | MemRef | ) | [static] |
Definition at line 2449 of file SemaDeclCXX.cpp.
References clang::ValueDecl::getType().
Referenced by BuildImplicitMemberInitializer().
Definition at line 10583 of file SemaDeclCXX.cpp.
References clang::Stmt::children(), clang::Sema::Diag(), clang::SourceRange::getBegin(), and clang::Stmt::getSourceRange().
Referenced by clang::Sema::DiagnoseReturnInConstructorExceptionHandler().
| static bool TryNamespaceTypoCorrection | ( | Sema & | S, |
| LookupResult & | R, | ||
| Scope * | Sc, | ||
| CXXScopeSpec & | SS, | ||
| SourceLocation | IdentLoc, | ||
| IdentifierInfo * | Ident | ||
| ) | [static] |
Definition at line 5957 of file SemaDeclCXX.cpp.
References clang::LookupResult::addDecl(), clang::LookupResult::clear(), clang::Sema::computeDeclContext(), clang::Sema::CorrectTypo(), clang::FixItHint::CreateReplacement(), clang::Sema::Diag(), clang::Sema::getLangOptions(), clang::LookupResult::getLookupKind(), and clang::LookupResult::getLookupNameInfo().
Referenced by clang::Sema::ActOnNamespaceAliasDef(), and clang::Sema::ActOnUsingDirective().