clang 22.0.0git
SemaDeclCXX.cpp File Reference
#include "TypeLocBuilder.h"
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTMutationListener.h"
#include "clang/AST/CXXInheritance.h"
#include "clang/AST/CharUnits.h"
#include "clang/AST/ComparisonCategories.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/DynamicRecursiveASTVisitor.h"
#include "clang/AST/EvaluatedExprVisitor.h"
#include "clang/AST/Expr.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/Basic/AttributeCommonInfo.h"
#include "clang/Basic/PartialDiagnostic.h"
#include "clang/Basic/Specifiers.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/EnterExpressionEvaluationContext.h"
#include "clang/Sema/Initialization.h"
#include "clang/Sema/Lookup.h"
#include "clang/Sema/Ownership.h"
#include "clang/Sema/ParsedTemplate.h"
#include "clang/Sema/Scope.h"
#include "clang/Sema/ScopeInfo.h"
#include "clang/Sema/SemaCUDA.h"
#include "clang/Sema/SemaInternal.h"
#include "clang/Sema/SemaObjC.h"
#include "clang/Sema/SemaOpenMP.h"
#include "clang/Sema/Template.h"
#include "clang/Sema/TemplateDeduction.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/SaveAndRestore.h"
#include <map>
#include <optional>
#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)
#define CheckPolymorphic(Type)
#define OVERLOADED_OPERATOR(Name, Spelling, Token, Unary, Binary, MemberOnly)

Typedefs

typedef llvm::SmallPtrSet< QualType, 4 > IndirectBaseSet
 Use small set to collect indirect bases.

Enumerations

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 class  AllocationOperatorKind { New , Delete }

Functions

static bool functionDeclHasDefaultArgument (const FunctionDecl *FD)
static bool CheckBindingsCount (Sema &S, DecompositionDecl *DD, QualType DecompType, ArrayRef< BindingDecl * > Bindings, unsigned MemberCount)
static bool checkSimpleDecomposition (Sema &S, ArrayRef< BindingDecl * > Bindings, ValueDecl *Src, QualType DecompType, const llvm::APSInt &NumElemsAPS, 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, const TemplateParameterList *Params)
static QualType getStdTrait (Sema &S, SourceLocation Loc, StringRef Trait, TemplateArgumentListInfo &Args, unsigned DiagID)
static bool lookupMember (Sema &S, CXXRecordDecl *RD, LookupResult &MemberLookup)
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.
static bool CheckMemberDecompositionFields (Sema &S, SourceLocation Loc, const CXXRecordDecl *OrigRD, QualType DecompType, DeclAccessPair BasePair)
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.
static bool CheckConstexprDestructorSubobjects (Sema &SemaRef, const CXXDestructorDecl *DD, Sema::CheckConstexprKind Kind)
 Determine whether a destructor cannot be constexpr due to.
static bool CheckConstexprParameterTypes (Sema &SemaRef, const FunctionDecl *FD, Sema::CheckConstexprKind Kind)
 Check whether a function's parameter types are all literal types.
static bool CheckConstexprReturnType (Sema &SemaRef, const FunctionDecl *FD, Sema::CheckConstexprKind Kind)
 Check whether a function's return type is a literal type.
static unsigned getRecordDiagFromTagKind (TagTypeKind Tag)
 Get diagnostic select index for tag kind for record diagnostic message.
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.
static bool CheckConstexprMissingReturn (Sema &SemaRef, const FunctionDecl *Dcl)
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.
static bool CheckConstexprCtorInitializer (Sema &SemaRef, const FunctionDecl *Dcl, FieldDecl *Field, llvm::SmallPtrSet< Decl *, 16 > &Inits, bool &Diagnosed, Sema::CheckConstexprKind Kind)
 Check that the given field is initialized within a constexpr constructor.
static bool CheckConstexprFunctionStmt (Sema &SemaRef, const FunctionDecl *Dcl, Stmt *S, SmallVectorImpl< SourceLocation > &ReturnStmts, SourceLocation &Cxx1yLoc, SourceLocation &Cxx2aLoc, SourceLocation &Cxx2bLoc, Sema::CheckConstexprKind Kind)
 Check the provided statement is allowed in a constexpr function definition.
static void NoteIndirectBases (ASTContext &Context, IndirectBaseSet &Set, const QualType &Type)
 Recursively add the bases of Type. Don't add Type itself.
static void BuildBasePathArray (const CXXBasePath &Path, CXXCastPath &BasePathArray)
static bool InitializationHasSideEffects (const FieldDecl &FD)
template<typename AttrType>
static bool HasAttribute (const QualType &T)
static bool IsUnusedPrivateField (const FieldDecl *FD)
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 ExprCastForMoving (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 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 CXXDestructorDeclLookupDestructorIfRelevant (Sema &S, CXXRecordDecl *Class)
static void MarkFieldDestructorReferenced (Sema &S, SourceLocation Location, FieldDecl *Field)
static void MarkBaseDestructorsReferenced (Sema &S, SourceLocation Location, CXXRecordDecl *ClassDecl)
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 AddInitializerToDiag (const Sema::SemaDiagnosticBuilder &Diag, const CXXCtorInitializer *Previous, const CXXCtorInitializer *Current)
static void DiagnoseBaseOrMemInitializerOrder (Sema &SemaRef, const CXXConstructorDecl *Constructor, ArrayRef< CXXCtorInitializer * > Inits)
static void CheckAbstractClassUsage (AbstractUsageInfo &Info, FunctionDecl *FD)
 Check for invalid uses of an abstract type in a function declaration.
static void CheckAbstractClassUsage (AbstractUsageInfo &Info, VarDecl *VD)
 Check for invalid uses of an abstract type in a variable0 declaration.
static void CheckAbstractClassUsage (AbstractUsageInfo &Info, CXXRecordDecl *RD)
 Check for invalid uses of an abstract type within a class definition.
static void ReferenceDllExportedMembers (Sema &S, CXXRecordDecl *Class)
static void checkForMultipleExportedDefaultConstructors (Sema &S, CXXRecordDecl *Class)
static void checkCUDADeviceBuiltinSurfaceClassTemplate (Sema &S, CXXRecordDecl *Class)
static void checkCUDADeviceBuiltinTextureClassTemplate (Sema &S, CXXRecordDecl *Class)
static void DefineDefaultedFunction (Sema &S, FunctionDecl *FD, 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.
static bool ReportOverrides (Sema &S, unsigned DiagID, const CXXMethodDecl *MD, llvm::function_ref< bool(const CXXMethodDecl *)> Report)
 Report an error regarding overriding, along with any relevant overridden methods.
static Sema::SpecialMemberOverloadResult lookupCallFromSpecialMember (Sema &S, CXXRecordDecl *Class, CXXSpecialMemberKind 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.
static bool specialMemberIsConstexpr (Sema &S, CXXRecordDecl *ClassDecl, CXXSpecialMemberKind 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?
static bool defaultedSpecialMemberIsConstexpr (Sema &S, CXXRecordDecl *ClassDecl, CXXSpecialMemberKind 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.
static Sema::ImplicitExceptionSpecification ComputeDefaultedSpecialMemberExceptionSpec (Sema &S, SourceLocation Loc, CXXMethodDecl *MD, CXXSpecialMemberKind 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.
static bool findTrivialSpecialMember (Sema &S, CXXRecordDecl *RD, CXXSpecialMemberKind CSM, unsigned Quals, bool ConstRHS, TrivialABIHandling TAH, CXXMethodDecl **Selected)
 Perform lookup for a special member of the specified kind, and determine whether it is trivial.
static CXXConstructorDeclfindUserDeclaredCtor (CXXRecordDecl *RD)
static bool checkTrivialSubobjectCall (Sema &S, SourceLocation SubobjLoc, QualType SubType, bool ConstRHS, CXXSpecialMemberKind CSM, TrivialSubobjectKind Kind, TrivialABIHandling TAH, bool Diagnose)
 Check whether the special member selected for a given type would be trivial.
static bool checkTrivialClassMembers (Sema &S, CXXRecordDecl *RD, CXXSpecialMemberKind CSM, bool ConstArg, TrivialABIHandling TAH, bool Diagnose)
 Check whether the members of a class type allow a special member to be trivial.
static void AddMostOverridenMethods (const CXXMethodDecl *MD, llvm::SmallPtrSetImpl< const CXXMethodDecl * > &Methods)
 Add the most overridden methods from MD to Methods.
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.
static void checkMethodTypeQualifiers (Sema &S, Declarator &D, unsigned DiagID)
static void diagnoseInvalidDeclaratorChunks (Sema &S, Declarator &D, unsigned Kind)
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.
static NamespaceDeclgetNamespaceDecl (NamespaceBaseDecl *D)
 getNamespaceDecl - Returns the namespace a decl represents.
static bool isStdClassTemplate (Sema &S, QualType SugaredType, QualType *TypeArg, const char *ClassName, ClassTemplateDecl **CachedDecl, const Decl **MalformedDecl)
static ClassTemplateDeclLookupStdClassTemplate (Sema &S, SourceLocation Loc, const char *ClassName, bool *WasMalformed)
static QualType BuildStdClassTemplate (Sema &S, ClassTemplateDecl *CTD, QualType TypeParam, 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 void DiagnoseInvisibleNamespace (const TypoCorrection &Corrected, Sema &S)
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 bool isVirtualDirectBase (CXXRecordDecl *Derived, CXXRecordDecl *Base)
 Determine whether a direct base class is a virtual base class.
static CXXBaseSpecifierfindDirectBaseWithType (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)
 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.
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)
 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.
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.
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 CanQualType RemoveAddressSpaceFromPtr (Sema &SemaRef, const PointerType *PtrTy)
static bool IsPotentiallyTypeAwareOperatorNewOrDelete (Sema &SemaRef, const FunctionDecl *FD, bool *WasMalformed)
static bool isDestroyingDeleteT (QualType Type)
static bool IsPotentiallyDestroyingOperatorDelete (Sema &SemaRef, const FunctionDecl *FD)
static bool CheckOperatorNewDeleteTypes (Sema &SemaRef, FunctionDecl *FnDecl, AllocationOperatorKind OperatorKind, CanQualType ExpectedResultType, CanQualType ExpectedSizeOrAddressParamType, unsigned DependentParamTypeDiag, unsigned InvalidParamTypeDiag)
static bool CheckOperatorNewDeclaration (Sema &SemaRef, FunctionDecl *FnDecl)
static bool CheckOperatorDeleteDeclaration (Sema &SemaRef, FunctionDecl *FnDecl)
static bool checkLiteralOperatorTemplateParameterList (Sema &SemaRef, FunctionTemplateDecl *TpDecl)
static void WriteCharTypePrefix (BuiltinType::Kind BTK, llvm::raw_ostream &OS)
static void WriteCharValueForDiagnostic (uint32_t Value, const BuiltinType *BTy, unsigned TyWidth, SmallVectorImpl< char > &Str)
 Convert character's value, interpreted as a code unit, to a string.
static bool ConvertAPValueToString (const APValue &V, QualType T, SmallVectorImpl< char > &Str, ASTContext &Context)
 Convert \V to a string we can present to the user in a diagnostic \T is the type of the expression that has been evaluated into \V.
static bool UsefulToPrintExpr (const Expr *E)
 Some Expression types are not useful to print notes about, e.g.
template<typename ResultType>
static bool EvaluateAsStringImpl (Sema &SemaRef, Expr *Message, ResultType &Result, ASTContext &Ctx, Sema::StringEvaluationContext EvalContext, bool ErrorOnInvalidMessage)
static void SearchForReturnInStmt (Sema &Self, Stmt *S)
static void DelegatingCycleHelper (CXXConstructorDecl *Ctor, llvm::SmallPtrSet< CXXConstructorDecl *, 4 > &Valid, llvm::SmallPtrSet< CXXConstructorDecl *, 4 > &Invalid, llvm::SmallPtrSet< CXXConstructorDecl *, 4 > &Current, Sema &S)

Macro Definition Documentation

◆ ABSTRACT_TYPELOC

#define ABSTRACT_TYPELOC ( CLASS,
PARENT )

◆ CheckPolymorphic

#define CheckPolymorphic ( Type)
Value:
void Check(Type TL, Sema::AbstractDiagSelID Sel) { \
Visit(TL.getNextTypeLoc(), Sema::AbstractNone); \
}
AbstractDiagSelID
Definition Sema.h:6191
@ AbstractNone
Definition Sema.h:6192
The base class of the type hierarchy.
Definition TypeBase.h:1833

Definition at line 6145 of file SemaDeclCXX.cpp.

◆ OVERLOADED_OPERATOR

#define OVERLOADED_OPERATOR ( Name,
Spelling,
Token,
Unary,
Binary,
MemberOnly )
Value:
, { Unary, Binary, MemberOnly }

◆ TYPELOC

#define TYPELOC ( CLASS,
PARENT )
Value:
case TypeLoc::CLASS: Check(TL.castAs<CLASS##TypeLoc>(), Sel); break;
Base wrapper for a particular "section" of type source info.
Definition TypeLoc.h:59

Typedef Documentation

◆ 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 2917 of file SemaDeclCXX.cpp.

Enumeration Type Documentation

◆ AllocationOperatorKind

enum class AllocationOperatorKind
strong
Enumerator
New 
Delete 

Definition at line 16491 of file SemaDeclCXX.cpp.

◆ ImplicitInitializerKind

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 4903 of file SemaDeclCXX.cpp.

◆ 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 10174 of file SemaDeclCXX.cpp.

Function Documentation

◆ AddInitializerToDiag()

void AddInitializerToDiag ( const Sema::SemaDiagnosticBuilder & Diag,
const CXXCtorInitializer * Previous,
const CXXCtorInitializer * Current )
static

◆ AddMostOverridenMethods()

void AddMostOverridenMethods ( const CXXMethodDecl * MD,
llvm::SmallPtrSetImpl< const CXXMethodDecl * > & Methods )
static

◆ BuildBasePathArray()

void BuildBasePathArray ( const CXXBasePath & Path,
CXXCastPath & BasePathArray )
static

◆ BuildImplicitBaseInitializer()

◆ BuildImplicitMemberInitializer()

◆ buildMemcpyForAssignmentOp()

◆ buildSingleCopyAssign()

StmtResult buildSingleCopyAssign ( Sema & S,
SourceLocation Loc,
QualType T,
const ExprBuilder & To,
const ExprBuilder & From,
bool CopyingBaseSubobject,
bool Copying )
static

◆ buildSingleCopyAssignRecursively()

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.

Parameters
SThe Sema object used for type-checking.
LocThe location where the implicit copy/move is being generated.
TThe type of the expressions being copied/moved. Both expressions must have this type.
ToThe expression we are copying/moving to.
FromThe expression we are copying/moving from.
CopyingBaseSubobjectWhether we're copying/moving a base subobject. Otherwise, it's a non-static member subobject.
CopyingWhether we're copying or moving.
DepthInternal parameter recording the depth of the recursion.
Returns
A statement or a loop that copies the expressions, or StmtResult(0) if a memcpy should be used instead.

Definition at line 14832 of file SemaDeclCXX.cpp.

References clang::Sema::ActOnCondition(), clang::Sema::ActOnExprStmt(), clang::Sema::ActOnForStmt(), clang::AS_protected, clang::AS_public, clang::Assignment, clang::LookupResult::begin(), clang::Sema::Boolean, clang::ASTContext::BoolTy, clang::Sema::BuildCallToMemberFunction(), clang::Sema::BuildMemberReferenceExpr(), buildSingleCopyAssignRecursively(), clang::Call, clang::Comparison, clang::Sema::Context, clang::Copy, clang::BinaryOperator::Create(), clang::IntegerLiteral::Create(), clang::UnaryOperator::Create(), clang::VarDecl::Create(), clang::Sema::CreateBuiltinBinOp(), clang::Sema::CurContext, clang::Sema::CurFPFeatureOverrides(), clang::ASTContext::DeclarationNames, clang::LookupResult::Filter::done(), clang::LookupResult::end(), clang::LookupResult::Filter::erase(), clang::IdentifierTable::get(), clang::ActionResult< PtrTy, Compress >::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::ASTContext::getTypeSize(), clang::LookupResult::Filter::hasNext(), clang::ASTContext::Idents, clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::FunctionDecl::isTrivial(), clang::Sema::LookupOrdinaryName, clang::Sema::LookupQualifiedName(), clang::LookupResult::makeFilter(), clang::Sema::MakeFullDiscardedValueExpr(), clang::CXXScopeSpec::MakeTrivial(), clang::LookupResult::Filter::next(), clang::OK_Ordinary, clang::SC_None, clang::VarDecl::setInit(), clang::StmtError(), clang::T, clang::VK_LValue, clang::VK_PRValue, and clang::Zero.

Referenced by buildSingleCopyAssign(), and buildSingleCopyAssignRecursively().

◆ BuildStdClassTemplate()

◆ canPassInRegisters()

bool canPassInRegisters ( Sema & S,
CXXRecordDecl * D,
TargetInfo::CallingConvKind CCK )
static

◆ CastForMoving()

◆ CheckAbstractClassUsage() [1/3]

void CheckAbstractClassUsage ( AbstractUsageInfo & Info,
CXXRecordDecl * RD )
static

Check for invalid uses of an abstract type within a class definition.

Definition at line 6225 of file SemaDeclCXX.cpp.

References clang::Sema::AbstractFieldType, CheckAbstractClassUsage(), clang::DeclContext::decls(), clang::TypeSourceInfo::getTypeLoc(), and clang::DeclaratorDecl::getTypeSourceInfo().

◆ CheckAbstractClassUsage() [2/3]

void CheckAbstractClassUsage ( AbstractUsageInfo & Info,
FunctionDecl * FD )
static

◆ CheckAbstractClassUsage() [3/3]

void CheckAbstractClassUsage ( AbstractUsageInfo & Info,
VarDecl * VD )
static

Check for invalid uses of an abstract type in a variable0 declaration.

Definition at line 6213 of file SemaDeclCXX.cpp.

References clang::Sema::AbstractVariableType, clang::TypeSourceInfo::getTypeLoc(), clang::DeclaratorDecl::getTypeSourceInfo(), and clang::VarDecl::isThisDeclarationADefinition().

◆ checkArrayDecomposition()

bool checkArrayDecomposition ( Sema & S,
ArrayRef< BindingDecl * > Bindings,
ValueDecl * Src,
QualType DecompType,
const ConstantArrayType * CAT )
static

◆ checkArrayLikeDecomposition()

◆ CheckBindingsCount()

◆ checkComplexDecomposition()

◆ CheckConstexprCtorInitializer()

bool CheckConstexprCtorInitializer ( Sema & SemaRef,
const FunctionDecl * Dcl,
FieldDecl * Field,
llvm::SmallPtrSet< Decl *, 16 > & Inits,
bool & Diagnosed,
Sema::CheckConstexprKind Kind )
static

Check that the given field is initialized within a constexpr constructor.

Parameters
DclThe constexpr constructor being checked.
FieldThe field being checked. This may be a member of an anonymous struct or union nested within the class being checked.
InitsAll declarations, including anonymous struct/union members and indirect members, for which any initialization was provided.
DiagnosedWhether we've emitted the error message yet. Used to attach multiple notes for different members to the same error.
KindWhether we're diagnosing a constructor as written or determining whether the formal requirements are satisfied.
Returns
false if we're checking for validity and the constructor does not satisfy the requirements on a constexpr constructor.

Definition at line 2152 of file SemaDeclCXX.cpp.

References CheckConstexprCtorInitializer(), clang::Sema::CheckValid, clang::SemaBase::Diag(), clang::SemaBase::DiagCompat(), clang::Sema::Diagnose, clang::Sema::getLangOpts(), and clang::Decl::getLocation().

Referenced by CheckConstexprCtorInitializer(), and CheckConstexprFunctionBody().

◆ CheckConstexprDeclStmt()

bool CheckConstexprDeclStmt ( Sema & SemaRef,
const FunctionDecl * Dcl,
DeclStmt * DS,
SourceLocation & Cxx1yLoc,
Sema::CheckConstexprKind Kind )
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.

Returns
true if the body is OK (maybe only as an extension), false if we have diagnosed a problem.

Definition at line 2010 of file SemaDeclCXX.cpp.

References clang::cast(), CheckLiteralType(), clang::DeclStmt::decls(), clang::SemaBase::Diag(), clang::SemaBase::DiagCompat(), clang::Sema::Diagnose, clang::DeclStmt::getBeginLoc(), clang::TypeLoc::getBeginLoc(), clang::Sema::getLangOpts(), clang::TypeLoc::getSourceRange(), clang::TypeLoc::getType(), clang::isa(), clang::FunctionDecl::isConsteval(), clang::SourceLocation::isValid(), clang::Sema::LangOpts, and clang::VarDecl::TLS_Dynamic.

Referenced by CheckConstexprFunctionStmt().

◆ CheckConstexprDestructorSubobjects()

◆ CheckConstexprFunctionBody()

◆ CheckConstexprFunctionStmt()

◆ CheckConstexprMissingReturn()

◆ CheckConstexprParameterTypes()

bool CheckConstexprParameterTypes ( Sema & SemaRef,
const FunctionDecl * FD,
Sema::CheckConstexprKind Kind )
static

◆ CheckConstexprReturnType()

bool CheckConstexprReturnType ( Sema & SemaRef,
const FunctionDecl * FD,
Sema::CheckConstexprKind Kind )
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 1887 of file SemaDeclCXX.cpp.

References CheckLiteralType(), clang::Sema::getLangOpts(), clang::Decl::getLocation(), clang::FunctionDecl::getReturnType(), and clang::FunctionDecl::isConsteval().

Referenced by clang::Sema::CheckConstexprFunctionDefinition(), and clang::Sema::CheckExplicitlyDefaultedComparison().

◆ checkCUDADeviceBuiltinSurfaceClassTemplate()

◆ checkCUDADeviceBuiltinTextureClassTemplate()

◆ checkForMultipleExportedDefaultConstructors()

◆ checkLiteralOperatorTemplateParameterList()

◆ CheckLiteralType()

template<typename... Ts>
bool CheckLiteralType ( Sema & SemaRef,
Sema::CheckConstexprKind Kind,
SourceLocation Loc,
QualType T,
unsigned DiagID,
Ts &&... DiagArgs )
static

Check that the given type is a literal type.

Issue a diagnostic if not, if Kind is Diagnose.

Returns
true if a problem has been found (and optionally diagnosed).

Definition at line 1811 of file SemaDeclCXX.cpp.

References clang::Sema::CheckValid, clang::Sema::Context, clang::Sema::Diagnose, clang::Sema::RequireLiteralType(), and clang::T.

◆ checkMemberDecomposition()

◆ CheckMemberDecompositionFields()

◆ checkMethodTypeQualifiers()

◆ checkMoveAssignmentForRepeatedMove()

◆ CheckOperatorDeleteDeclaration()

◆ CheckOperatorNewDeclaration()

◆ CheckOperatorNewDeleteDeclarationScope()

◆ CheckOperatorNewDeleteTypes()

◆ checkSimpleDecomposition()

◆ checkTrivialClassMembers()

◆ checkTrivialSubobjectCall()

◆ checkTupleLikeDecomposition()

bool checkTupleLikeDecomposition ( Sema & S,
ArrayRef< BindingDecl * > Bindings,
VarDecl * Src,
QualType DecompType,
const llvm::APSInt & TupleSize )
static

Definition at line 1279 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::cast(), CheckBindingsCount(), clang::Sema::CheckCompleteVariableDeclaration(), clang::Sema::Context, clang::ImplicitCastExpr::Create(), clang::UnresolvedLookupExpr::Create(), clang::VarDecl::Create(), clang::InitializationKind::CreateCopy(), clang::ActionResult< PtrTy, Compress >::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::VarDecl::getTSCSpec(), getTupleLikeElementType(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::Init, clang::InitializedEntity::InitializeBinding(), clang::isa(), clang::LookupResult::isAmbiguous(), clang::Sema::isCompleteType(), clang::VarDecl::isInlineSpecified(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isLValue(), clang::Type::isLValueReferenceType(), clang::QualType::isNull(), clang::Sema::LookupMemberName, clang::Sema::LookupQualifiedName(), clang::Sema::PP, clang::Seq, clang::TemplateParameterList::size(), clang::T, UINT_MAX, clang::VK_LValue, and clang::VK_XValue.

Referenced by clang::Sema::CheckCompleteDecompositionDeclaration().

◆ checkVectorDecomposition()

◆ CollectFieldInitializer()

◆ ComputeDefaultedComparisonExceptionSpec()

◆ ComputeDefaultedSpecialMemberExceptionSpec()

◆ computeImplicitExceptionSpec()

◆ ConvertAPValueToString()

bool ConvertAPValueToString ( const APValue & V,
QualType T,
SmallVectorImpl< char > & Str,
ASTContext & Context )
static

Convert \V to a string we can present to the user in a diagnostic \T is the type of the expression that has been evaluated into \V.

Definition at line 17493 of file SemaDeclCXX.cpp.

References clang::APValue::ComplexFloat, clang::APValue::ComplexInt, clang::APValue::Float, clang::APValue::Int, clang::APValue::LValue, clang::T, V, WriteCharTypePrefix(), and WriteCharValueForDiagnostic().

Referenced by clang::Sema::DiagnoseStaticAssertDetails().

◆ defaultedSpecialMemberIsConstexpr()

◆ DefineDefaultedFunction()

◆ DelegatingCycleHelper()

◆ DiagnoseBaseOrMemInitializerOrder()

◆ diagnoseDeprecatedCopyOperation()

◆ diagnoseInvalidDeclaratorChunks()

◆ DiagnoseInvisibleNamespace()

◆ DiagnoseNamespaceInlineMismatch()

void DiagnoseNamespaceInlineMismatch ( Sema & S,
SourceLocation KeywordLoc,
SourceLocation Loc,
IdentifierInfo * II,
bool * IsInline,
NamespaceDecl * PrevNS )
static

◆ EvaluateAsStringImpl()

◆ extendLeft()

◆ extendRight()

◆ FindBaseInitializer()

bool FindBaseInitializer ( Sema & SemaRef,
CXXRecordDecl * ClassDecl,
QualType BaseType,
const CXXBaseSpecifier *& DirectBaseSpec,
const CXXBaseSpecifier *& VirtualBaseSpec )
static

◆ findDecomposableBaseClass()

◆ findDirectBaseWithType()

CXXBaseSpecifier * findDirectBaseWithType ( CXXRecordDecl * Derived,
QualType DesiredBase,
bool & AnyDependentBases )
static

Find the base specifier for a base class with the given type.

Definition at line 12939 of file SemaDeclCXX.cpp.

References clang::CXXRecordDecl::bases(), clang::Type::getCanonicalTypeUnqualified(), and clang::CanQual< T >::getUnqualifiedType().

Referenced by clang::Sema::CheckInheritingConstructorUsingDecl().

◆ findImplicitlyDeclaredEqualityComparisons()

void findImplicitlyDeclaredEqualityComparisons ( ASTContext & Ctx,
CXXRecordDecl * RD,
llvm::SmallVectorImpl< FunctionDecl * > & Spaceships )
static

◆ findTrivialSpecialMember()

bool findTrivialSpecialMember ( Sema & S,
CXXRecordDecl * RD,
CXXSpecialMemberKind CSM,
unsigned Quals,
bool ConstRHS,
TrivialABIHandling TAH,
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.

If ForCall is true, look at CXXRecord::HasTrivialSpecialMembersForCall to determine whether the special member is trivial.

Definition at line 10029 of file SemaDeclCXX.cpp.

References clang::Sema::SpecialMemberOverloadResult::Ambiguous, clang::ConsiderTrivialABI, clang::Qualifiers::Const, clang::CopyAssignment, clang::CopyConstructor, clang::CXXRecordDecl::ctors(), clang::Sema::DeclareImplicitDefaultConstructor(), clang::Sema::DeclareImplicitDestructor(), clang::DefaultConstructor, clang::Destructor, 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::Invalid, clang::FunctionDecl::isTrivial(), clang::FunctionDecl::isTrivialForCall(), clang::FunctionDecl::isUserProvided(), lookupCallFromSpecialMember(), clang::MoveAssignment, clang::MoveConstructor, clang::CXXRecordDecl::needsImplicitDefaultConstructor(), clang::CXXRecordDecl::needsImplicitDestructor(), and clang::Sema::SpecialMemberOverloadResult::NoMemberOrDeleted.

Referenced by checkTrivialSubobjectCall().

◆ findUserDeclaredCtor()

◆ functionDeclHasDefaultArgument()

bool functionDeclHasDefaultArgument ( const FunctionDecl * FD)
static

◆ getImplicitMethodEPI()

◆ GetKeyForBase()

const void * GetKeyForBase ( ASTContext & Context,
QualType BaseType )
static

Definition at line 5644 of file SemaDeclCXX.cpp.

Referenced by DiagnoseBaseOrMemInitializerOrder(), and GetKeyForMember().

◆ GetKeyForMember()

const void * GetKeyForMember ( ASTContext & Context,
CXXCtorInitializer * Member )
static

◆ getNamespaceDecl()

NamespaceDecl * getNamespaceDecl ( NamespaceBaseDecl * D)
inlinestatic

getNamespaceDecl - Returns the namespace a decl represents.

If the decl is a namespace alias, returns the namespace it points to.

Definition at line 11971 of file SemaDeclCXX.cpp.

References clang::NamespaceBaseDecl::getNamespace().

Referenced by clang::Sema::ActOnNamespaceAliasDef().

◆ getRecordDiagFromTagKind()

unsigned getRecordDiagFromTagKind ( TagTypeKind Tag)
static

Get diagnostic select index for tag kind for record diagnostic message.

WARNING: Indexes apply to particular diagnostics only!

Returns
diagnostic select index.

Definition at line 1903 of file SemaDeclCXX.cpp.

References clang::Class, clang::Interface, and clang::Struct.

Referenced by clang::Sema::AttachBaseSpecifiers(), and clang::Sema::CheckConstexprFunctionDefinition().

◆ getStdTrait()

◆ getTrivialIntegralTemplateArgument()

TemplateArgumentLoc getTrivialIntegralTemplateArgument ( Sema & S,
SourceLocation Loc,
QualType T,
uint64_t I )
static

◆ getTrivialTypeTemplateArgument()

TemplateArgumentLoc getTrivialTypeTemplateArgument ( Sema & S,
SourceLocation Loc,
QualType T )
static

◆ getTupleLikeElementType()

◆ HasAttribute()

template<typename AttrType>
bool HasAttribute ( const QualType & T)
inlinestatic

Definition at line 3423 of file SemaDeclCXX.cpp.

References clang::T.

Referenced by IsUnusedPrivateField().

◆ hasOneRealArgument()

bool hasOneRealArgument ( MultiExprArg Args)
static

Determine whether the given list arguments contains exactly one "real" (non-default) argument.

Definition at line 16199 of file SemaDeclCXX.cpp.

Referenced by clang::Sema::BuildCXXConstructExpr().

◆ InitializationHasSideEffects()

bool InitializationHasSideEffects ( const FieldDecl & FD)
static

◆ isDestroyingDeleteT()

◆ IsEquivalentForUsingDecl()

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 12674 of file SemaDeclCXX.cpp.

References clang::Decl::getCanonicalDecl(), and clang::isa().

Referenced by clang::Sema::CheckUsingShadowDecl().

◆ isIncompleteOrZeroLengthArrayType()

bool isIncompleteOrZeroLengthArrayType ( ASTContext & Context,
QualType T )
static

Determine whether the given type is an incomplete or zero-lenfgth array type.

Definition at line 5243 of file SemaDeclCXX.cpp.

References clang::T.

Referenced by CollectFieldInitializer(), and MarkFieldDestructorReferenced().

◆ IsPotentiallyDestroyingOperatorDelete()

◆ IsPotentiallyTypeAwareOperatorNewOrDelete()

◆ isStdClassTemplate()

◆ isTupleLike()

◆ IsUnusedPrivateField()

◆ IsUsingDirectiveInToplevelContext()

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 12365 of file SemaDeclCXX.cpp.

References clang::DeclContext::getDeclKind(), clang::DeclContext::getParent(), and IsUsingDirectiveInToplevelContext().

Referenced by clang::Sema::ActOnUsingDirective(), and IsUsingDirectiveInToplevelContext().

◆ isVirtualDirectBase()

bool isVirtualDirectBase ( CXXRecordDecl * Derived,
CXXRecordDecl * Base )
static

Determine whether a direct base class is a virtual base class.

Definition at line 12865 of file SemaDeclCXX.cpp.

References clang::CXXRecordDecl::bases(), and clang::CXXRecordDecl::getNumVBases().

Referenced by clang::Sema::BuildUsingShadowDecl().

◆ lookupCallFromSpecialMember()

Sema::SpecialMemberOverloadResult lookupCallFromSpecialMember ( Sema & S,
CXXRecordDecl * Class,
CXXSpecialMemberKind 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.

Parameters
ClassThe class type of the subobject.
CSMThe kind of special member function.
FieldQualsIf the subobject is a field, its cv-qualifiers.
ConstRHSTrue 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 7398 of file SemaDeclCXX.cpp.

References clang::Qualifiers::Const, clang::CopyAssignment, clang::DefaultConstructor, clang::Destructor, clang::Sema::LookupSpecialMember(), clang::MoveAssignment, and clang::Qualifiers::Volatile.

Referenced by findTrivialSpecialMember(), and specialMemberIsConstexpr().

◆ LookupDestructorIfRelevant()

◆ lookupMember()

bool lookupMember ( Sema & S,
CXXRecordDecl * RD,
LookupResult & MemberLookup )
static

◆ lookupOperatorsForDefaultedComparison()

void lookupOperatorsForDefaultedComparison ( Sema & Self,
Scope * S,
UnresolvedSetImpl & Operators,
OverloadedOperatorKind Op )
static

Perform the unqualified lookups that might be needed to form a defaulted comparison function for the given operator.

Definition at line 8888 of file SemaDeclCXX.cpp.

References clang::getRewrittenOverloadedOperator(), and clang::Self.

Referenced by clang::Sema::CheckExplicitlyDefaultedComparison().

◆ LookupStdClassTemplate()

◆ MarkBaseDestructorsReferenced()

◆ MarkFieldDestructorReferenced()

◆ NoteIndirectBases()

void NoteIndirectBases ( ASTContext & Context,
IndirectBaseSet & Set,
const QualType & Type )
static

Recursively add the bases of Type. Don't add Type itself.

Definition at line 2921 of file SemaDeclCXX.cpp.

References clang::Type::getAsCXXRecordDecl(), NoteIndirectBases(), and clang::Set.

Referenced by clang::Sema::AttachBaseSpecifiers(), and NoteIndirectBases().

◆ PopulateKeysForFields()

◆ printTemplateArgs()

std::string printTemplateArgs ( const PrintingPolicy & PrintingPolicy,
TemplateArgumentListInfo & Args,
const TemplateParameterList * Params )
static

◆ ReferenceDllExportedMembers()

◆ RefersToRValueRef()

bool RefersToRValueRef ( Expr * MemRef)
static

◆ RemoveAddressSpaceFromPtr()

◆ ReportOverrides()

bool ReportOverrides ( Sema & S,
unsigned DiagID,
const CXXMethodDecl * MD,
llvm::function_ref< bool(const CXXMethodDecl *)> Report )
static

Report an error regarding overriding, along with any relevant overridden methods.

Parameters
DiagIDthe primary error to report.
MDthe overriding method.

Definition at line 6957 of file SemaDeclCXX.cpp.

References clang::SemaBase::Diag(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::CXXMethodDecl::overridden_methods(), and clang::sema::Report.

Referenced by clang::Sema::CheckCompletedCXXClass().

◆ SearchForReturnInStmt()

void SearchForReturnInStmt ( Sema & Self,
Stmt * S )
static

◆ specialMemberIsConstexpr()

bool specialMemberIsConstexpr ( Sema & S,
CXXRecordDecl * ClassDecl,
CXXSpecialMemberKind CSM,
unsigned Quals,
bool ConstRHS,
CXXConstructorDecl * InheritedCtor = nullptr,
Sema::InheritedConstructorInfo * Inherited = nullptr )
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 7504 of file SemaDeclCXX.cpp.

References clang::DefaultConstructor, clang::Destructor, clang::Sema::SpecialMemberOverloadResult::getMethod(), clang::CXXRecordDecl::hasConstexprDefaultConstructor(), clang::CXXRecordDecl::hasConstexprDestructor(), clang::FunctionDecl::isConstexpr(), and lookupCallFromSpecialMember().

Referenced by defaultedSpecialMemberIsConstexpr().

◆ TryNamespaceTypoCorrection()

◆ UsefulToPrintExpr()

bool UsefulToPrintExpr ( const Expr * E)
static

Some Expression types are not useful to print notes about, e.g.

literals and values that have already been expanded before such as int-valued template parameters.

Definition at line 17585 of file SemaDeclCXX.cpp.

References clang::Expr::IgnoreParenImpCasts(), clang::isa(), and UsefulToPrintExpr().

Referenced by clang::Sema::DiagnoseStaticAssertDetails(), and UsefulToPrintExpr().

◆ WriteCharTypePrefix()

void WriteCharTypePrefix ( BuiltinType::Kind BTK,
llvm::raw_ostream & OS )
static

Definition at line 17428 of file SemaDeclCXX.cpp.

Referenced by ConvertAPValueToString().

◆ WriteCharValueForDiagnostic()

void WriteCharValueForDiagnostic ( uint32_t Value,
const BuiltinType * BTy,
unsigned TyWidth,
SmallVectorImpl< char > & Str )
static

Convert character's value, interpreted as a code unit, to a string.

The value needs to be zero-extended to 32-bits. FIXME: This assumes Unicode literal encodings

Definition at line 17454 of file SemaDeclCXX.cpp.

References clang::escapeCStyle(), clang::EscapeStringForDiagnostic(), and clang::BuiltinType::getKind().

Referenced by ConvertAPValueToString().