clang 23.0.0git
clang::Sema Class Referencefinal

Sema - This implements semantic analysis and AST building for C. More...

#include "clang/Sema/Sema.h"

Inheritance diagram for clang::Sema:
[legend]

Classes

struct  ActOnMemberAccessExtraArgs
struct  AlignPackIncludeState
class  AlignPackInfo
class  ArgPackSubstIndexRAII
 RAII object used to change the argument pack substitution index within a Sema object. More...
class  BoundTypeDiagnoser
struct  CheckNonDependentConversionsFlag
struct  CheckTemplateArgumentInfo
struct  CodeSynthesisContext
 A context in which code is being synthesized (where a source location alone is not sufficient to identify the context). More...
class  CompoundScopeRAII
 A RAII object to enter scope of a compound statement. More...
class  ConditionResult
struct  ConstraintEvalRAII
class  ContextRAII
 A RAII object to temporarily push a declaration context. More...
class  ContextualImplicitConverter
 Abstract base class used to perform a contextual implicit conversion from an expression to any type passing a filter. More...
class  CXXThisScopeRAII
 RAII object used to temporarily allow the C++ 'this' expression to be used, with the given qualifiers on the current class type. More...
class  DefaultedFunctionKind
 For a defaulted function, the kind of defaulted function that it is. More...
class  DeferDiagsRAII
 RAII class to control scope of DeferDiags. More...
class  DelayedDiagnostics
 A class which encapsulates the logic for delaying diagnostics during parsing and other processing. More...
class  DelayedDiagnosticsState
struct  ExpressionEvaluationContextRecord
 Data structure used to record current or nested expression evaluation contexts. More...
class  ExtParameterInfoBuilder
 A helper class for building up ExtParameterInfos. More...
struct  FormatStringInfo
class  FPFeaturesStateRAII
 Records and restores the CurFPFeatures state on entry/exit of compound statements. More...
class  FpPragmaStackSaveRAII
class  FullExprArg
struct  FunctionEffectDiff
struct  FunctionEffectDiffVector
struct  FunctionScopeRAII
 An RAII helper that pops function a function scope on exit. More...
class  GlobalEagerInstantiationScope
class  ICEConvertDiagnoser
class  ImplicitExceptionSpecification
 Helper class that collects exception specifications for implicitly-declared special member functions. More...
class  InheritedConstructorInfo
struct  InstantiatingTemplate
 A stack object to be created when performing template instantiation. More...
class  LambdaScopeForCallOperatorInstantiationRAII
struct  LateInstantiatedAttribute
class  LocalEagerInstantiationScope
class  NameClassification
struct  NamedReturnInfo
struct  NestedNameSpecInfo
 Keeps information about an identifier in a nested-name-spec. More...
struct  NonSFINAEContext
struct  OffsetOfComponent
struct  OriginalCallArg
 brief A function argument from which we performed template argument More...
struct  PendingPragmaInfo
 Information from a C++ #pragma export, for a symbol that we haven't seen the declaration for yet. More...
class  PoppedFunctionScopeDeleter
 Custom deleter to allow FunctionScopeInfos to be kept alive for a short time after they've been popped. More...
struct  PragmaAttributeEntry
 This an attribute introduced by #pragma clang attribute. More...
struct  PragmaAttributeGroup
 A push'd group of PragmaAttributeEntries. More...
struct  PragmaClangSection
struct  PragmaPackInfo
struct  PragmaStack
class  PragmaStackSentinelRAII
struct  ProcessDeclAttributeOptions
struct  RecursiveInstGuard
struct  ReferenceConversionsScope
class  RequiredTemplateKind
 Whether and why a template name is required in this lookup. More...
class  SatisfactionStackResetRAII
struct  SFINAEContextBase
class  SFINAETrap
 RAII class used to determine whether SFINAE has trapped any errors that occur during template argument deduction. More...
class  SizelessTypeDiagnoser
 A derivative of BoundTypeDiagnoser for which the diagnostic's type parameter is preceded by a 0/1 enum that is 1 if the type is sizeless. More...
class  SpecialMemberOverloadResult
 SpecialMemberOverloadResult - The overloading result for a special member function. More...
class  SpecialMemberOverloadResultEntry
class  SynthesizedFunctionScope
 RAII object to handle the state changes required to synthesize a function body. More...
class  TemplateCompareNewDeclInfo
class  TentativeAnalysisScope
 RAII class used to indicate that we are performing provisional semantic analysis to determine the validity of a construct, so typo-correction and diagnostics in the immediate context (not within implicitly-instantiated templates) should be suppressed. More...
struct  TypeDiagnoser
 Abstract class used to diagnose incomplete types. More...
struct  TypeTagData
class  VerifyICEDiagnoser
 Abstract base class used for diagnosing integer constant expression violations. More...

C++ Access Control

Implementations are in SemaAccess.cpp

enum  AccessResult { AR_accessible , AR_inaccessible , AR_dependent , AR_delayed }
bool SetMemberAccessSpecifier (NamedDecl *MemberDecl, NamedDecl *PrevMemberDecl, AccessSpecifier LexicalAS)
 SetMemberAccessSpecifier - Set the access specifier of a member.
AccessResult CheckUnresolvedMemberAccess (UnresolvedMemberExpr *E, DeclAccessPair FoundDecl)
 Perform access-control checking on a previously-unresolved member access which has now been resolved to a member.
AccessResult CheckUnresolvedLookupAccess (UnresolvedLookupExpr *E, DeclAccessPair FoundDecl)
AccessResult CheckAllocationAccess (SourceLocation OperatorLoc, SourceRange PlacementRange, CXXRecordDecl *NamingClass, DeclAccessPair FoundDecl, bool Diagnose=true)
 Checks access to an overloaded operator new or delete.
AccessResult CheckConstructorAccess (SourceLocation Loc, CXXConstructorDecl *D, DeclAccessPair FoundDecl, const InitializedEntity &Entity, bool IsCopyBindingRefToTemp=false)
 Checks access to a constructor.
AccessResult CheckConstructorAccess (SourceLocation Loc, CXXConstructorDecl *D, DeclAccessPair FoundDecl, const InitializedEntity &Entity, const PartialDiagnostic &PDiag)
 Checks access to a constructor.
AccessResult CheckDestructorAccess (SourceLocation Loc, CXXDestructorDecl *Dtor, const PartialDiagnostic &PDiag, QualType objectType=QualType())
AccessResult CheckFriendAccess (NamedDecl *D)
 Checks access to the target of a friend declaration.
AccessResult CheckMemberAccess (SourceLocation UseLoc, CXXRecordDecl *NamingClass, DeclAccessPair Found)
 Checks access to a member.
AccessResult CheckStructuredBindingMemberAccess (SourceLocation UseLoc, CXXRecordDecl *DecomposedClass, DeclAccessPair Field)
 Checks implicit access to a member in a structured binding.
AccessResult CheckMemberOperatorAccess (SourceLocation Loc, Expr *ObjectExpr, const SourceRange &, DeclAccessPair FoundDecl)
AccessResult CheckMemberOperatorAccess (SourceLocation Loc, Expr *ObjectExpr, Expr *ArgExpr, DeclAccessPair FoundDecl)
 Checks access to an overloaded member operator, including conversion operators.
AccessResult CheckMemberOperatorAccess (SourceLocation Loc, Expr *ObjectExpr, ArrayRef< Expr * > ArgExprs, DeclAccessPair FoundDecl)
AccessResult CheckAddressOfMemberAccess (Expr *OvlExpr, DeclAccessPair FoundDecl)
AccessResult CheckBaseClassAccess (SourceLocation AccessLoc, QualType Base, QualType Derived, const CXXBasePath &Path, unsigned DiagID, bool ForceCheck=false, bool ForceUnprivileged=false)
 Checks access for a hierarchy conversion.
AccessResult CheckBaseClassAccess (SourceLocation AccessLoc, CXXRecordDecl *Base, CXXRecordDecl *Derived, const CXXBasePath &Path, unsigned DiagID, llvm::function_ref< void(PartialDiagnostic &PD)> SetupPDiag, bool ForceCheck=false, bool ForceUnprivileged=false)
void CheckLookupAccess (const LookupResult &R)
 Checks access to all the declarations in the given result set.
bool IsSimplyAccessible (NamedDecl *Decl, CXXRecordDecl *NamingClass, QualType BaseType)
 Checks access to Target from the given class.
bool isMemberAccessibleForDeletion (CXXRecordDecl *NamingClass, DeclAccessPair Found, QualType ObjectType, SourceLocation Loc, const PartialDiagnostic &Diag)
 Is the given member accessible for the purposes of deciding whether to define a special member function as deleted?
bool isMemberAccessibleForDeletion (CXXRecordDecl *NamingClass, DeclAccessPair Found, QualType ObjectType)
void HandleDependentAccessCheck (const DependentDiagnostic &DD, const MultiLevelTemplateArgumentList &TemplateArgs)
void HandleDelayedAccessCheck (sema::DelayedDiagnostic &DD, Decl *Ctx)

Attributes

Implementations are in SemaAttr.cpp

enum  PragmaMsStackAction {
  PSK_Reset = 0x0 , PSK_Set = 0x1 , PSK_Push = 0x2 , PSK_Pop = 0x4 ,
  PSK_Show = 0x8 , PSK_Push_Set = PSK_Push | PSK_Set , PSK_Pop_Set = PSK_Pop | PSK_Set
}
enum  PragmaSectionKind { PSK_DataSeg , PSK_BSSSeg , PSK_ConstSeg , PSK_CodeSeg }
enum class  PragmaAlignPackDiagnoseKind { NonDefaultStateAtInclude , ChangedStateAtExit }
using InstantiationContextDiagFuncRef
LangOptions::PragmaMSPointersToMembersKind MSPointerToMemberRepresentationMethod
 Controls member pointer representation format under the MS ABI.
bool MSStructPragmaOn
SourceLocation ImplicitMSInheritanceAttrLoc
 Source location for newly created implicit MSInheritanceAttrs.
PragmaClangSection PragmaClangBSSSection
PragmaClangSection PragmaClangDataSection
PragmaClangSection PragmaClangRodataSection
PragmaClangSection PragmaClangRelroSection
PragmaClangSection PragmaClangTextSection
PragmaStack< MSVtorDispModeVtorDispStack
 Whether to insert vtordisps prior to virtual bases in the Microsoft C++ ABI.
PragmaStack< AlignPackInfoAlignPackStack
SmallVector< AlignPackIncludeState, 8 > AlignPackIncludeStack
PragmaStack< StringLiteral * > DataSegStack
PragmaStack< StringLiteral * > BSSSegStack
PragmaStack< StringLiteral * > ConstSegStack
PragmaStack< StringLiteral * > CodeSegStack
PragmaStack< boolStrictGuardStackCheckStack
PragmaStack< FPOptionsOverrideFpPragmaStack
StringLiteralCurInitSeg
 Last section used with #pragma init_seg.
SourceLocation CurInitSegLoc
llvm::StringMap< std::tuple< StringRef, SourceLocation > > FunctionToSectionMap
 Sections used with #pragma alloc_text.
void * VisContext
 VisContext - Manages the stack for #pragma GCC visibility.
SmallVector< PragmaAttributeGroup, 2 > PragmaAttributeStack
const DeclPragmaAttributeCurrentTargetDecl
 The declaration that is currently receiving an attribute from the #pragma attribute stack.
SourceLocation OptimizeOffPragmaLocation
 This represents the last location of a "#pragma clang optimize off" directive if such a directive has not been closed by an "on" yet.
bool MSPragmaOptimizeIsOn = true
 The "on" or "off" argument passed by #pragma optimize, that denotes whether the optimizations in the list passed to the pragma should be turned off or on.
llvm::SmallSetVector< StringRef, 4 > MSFunctionNoBuiltins
 Set of no-builtin functions listed by #pragma function.
llvm::DenseMap< IdentifierInfo *, PendingPragmaInfoPendingExportedNames
FPOptionsOverride CurFPFeatureOverrides ()
SourceLocation getOptimizeOffPragmaLocation () const
 Get the location for the currently active "\#pragma clang optimize off". If this location is invalid, then the state of the pragma is "on".
void AddAlignmentAttributesForRecord (RecordDecl *RD)
 AddAlignmentAttributesForRecord - Adds any needed alignment attributes to a the record decl, to handle '#pragma pack' and '#pragma options align'.
void AddMsStructLayoutForRecord (RecordDecl *RD)
 AddMsStructLayoutForRecord - Adds ms_struct layout attribute to record.
void inferGslPointerAttribute (NamedDecl *ND, CXXRecordDecl *UnderlyingRecord)
 Add gsl::Pointer attribute to std::container::iterator.
void inferGslOwnerPointerAttribute (CXXRecordDecl *Record)
 Add [[gsl::Owner]] and [[gsl::Pointer]] attributes for std:: types.
void inferLifetimeBoundAttribute (FunctionDecl *FD)
 Add [[clang:::lifetimebound]] attr for std:: functions and methods.
void inferLifetimeCaptureByAttribute (FunctionDecl *FD)
 Add [[clang:::lifetime_capture_by(this)]] to STL container methods.
void inferGslPointerAttribute (TypedefNameDecl *TD)
 Add [[gsl::Pointer]] attributes for std:: types.
LifetimeCaptureByAttr * ParseLifetimeCaptureByAttr (const ParsedAttr &AL, StringRef ParamName)
void LazyProcessLifetimeCaptureByParams (FunctionDecl *FD)
void inferNullableClassAttribute (CXXRecordDecl *CRD)
 Add _Nullable attributes for std:: types.
void ActOnPragmaClangSection (SourceLocation PragmaLoc, PragmaClangSectionAction Action, PragmaClangSectionKind SecKind, StringRef SecName)
 ActOnPragmaClangSection - Called on well formed #pragma clang section.
void ActOnPragmaOptionsAlign (PragmaOptionsAlignKind Kind, SourceLocation PragmaLoc)
 ActOnPragmaOptionsAlign - Called on well formed #pragma options align.
void ActOnPragmaPack (SourceLocation PragmaLoc, PragmaMsStackAction Action, StringRef SlotLabel, Expr *Alignment)
 ActOnPragmaPack - Called on well formed #pragma pack(...).
bool ConstantFoldAttrArgs (const AttributeCommonInfo &CI, MutableArrayRef< Expr * > Args)
 ConstantFoldAttrArgs - Folds attribute arguments into ConstantExprs (unless they are value dependent or type dependent).
void DiagnoseNonDefaultPragmaAlignPack (PragmaAlignPackDiagnoseKind Kind, SourceLocation IncludeLoc)
void DiagnoseUnterminatedPragmaAlignPack ()
void ActOnPragmaMSStruct (PragmaMSStructKind Kind)
 ActOnPragmaMSStruct - Called on well formed #pragma ms_struct [on|off].
void ActOnPragmaMSComment (SourceLocation CommentLoc, PragmaMSCommentKind Kind, StringRef Arg)
 ActOnPragmaMSComment - Called on well formed #pragma comment(kind, "arg").
void ActOnPragmaDetectMismatch (SourceLocation Loc, StringRef Name, StringRef Value)
 ActOnPragmaDetectMismatch - Call on well-formed #pragma detect_mismatch.
bool isPreciseFPEnabled ()
 Are precise floating point semantics currently enabled?
void ActOnPragmaFPEvalMethod (SourceLocation Loc, LangOptions::FPEvalMethodKind Value)
void ActOnPragmaFloatControl (SourceLocation Loc, PragmaMsStackAction Action, PragmaFloatControlKind Value)
 ActOnPragmaFloatControl - Call on well-formed #pragma float_control.
void ActOnPragmaMSPointersToMembers (LangOptions::PragmaMSPointersToMembersKind Kind, SourceLocation PragmaLoc)
 ActOnPragmaMSPointersToMembers - called on well formed #pragma pointers_to_members(representation method[, general purpose representation]).
void ActOnPragmaMSVtorDisp (PragmaMsStackAction Action, SourceLocation PragmaLoc, MSVtorDispMode Value)
 Called on well formed #pragma vtordisp().
bool UnifySection (StringRef SectionName, int SectionFlags, NamedDecl *TheDecl)
bool UnifySection (StringRef SectionName, int SectionFlags, SourceLocation PragmaSectionLocation)
void ActOnPragmaMSSeg (SourceLocation PragmaLocation, PragmaMsStackAction Action, llvm::StringRef StackSlotLabel, StringLiteral *SegmentName, llvm::StringRef PragmaName)
 Called on well formed #pragma bss_seg/data_seg/const_seg/code_seg.
void ActOnPragmaMSSection (SourceLocation PragmaLocation, int SectionFlags, StringLiteral *SegmentName)
 Called on well formed #pragma section().
void ActOnPragmaMSInitSeg (SourceLocation PragmaLocation, StringLiteral *SegmentName)
 Called on well-formed #pragma init_seg().
void ActOnPragmaMSAllocText (SourceLocation PragmaLocation, StringRef Section, const SmallVector< std::tuple< IdentifierInfo *, SourceLocation > > &Functions)
 Called on well-formed #pragma alloc_text().
void ActOnPragmaMSStrictGuardStackCheck (SourceLocation PragmaLocation, PragmaMsStackAction Action, bool Value)
 ActOnPragmaMSStrictGuardStackCheck - Called on well formed #pragma strict_gs_check.
void ActOnPragmaUnused (const Token &Identifier, Scope *curScope, SourceLocation PragmaLoc)
 ActOnPragmaUnused - Called on well-formed '#pragma unused'.
void ActOnPragmaAttributeAttribute (ParsedAttr &Attribute, SourceLocation PragmaLoc, attr::ParsedSubjectMatchRuleSet Rules)
void ActOnPragmaAttributeEmptyPush (SourceLocation PragmaLoc, const IdentifierInfo *Namespace)
void ActOnPragmaAttributePop (SourceLocation PragmaLoc, const IdentifierInfo *Namespace)
 Called on well-formed '#pragma clang attribute pop'.
void AddPragmaAttributes (Scope *S, Decl *D)
 Adds the attributes that have been specified using the '#pragma clang attribute push' directives to the given declaration.
auto getDefaultDiagFunc ()
void PrintPragmaAttributeInstantiationPoint (InstantiationContextDiagFuncRef DiagFunc)
void PrintPragmaAttributeInstantiationPoint ()
void DiagnoseUnterminatedPragmaAttribute ()
void ActOnPragmaOptimize (bool On, SourceLocation PragmaLoc)
 Called on well formed #pragma clang optimize.
void ActOnPragmaMSOptimize (SourceLocation Loc, bool IsOn)
 #pragma optimize("[optimization-list]", on | off).
void ActOnPragmaMSFunction (SourceLocation Loc, const llvm::SmallVectorImpl< StringRef > &NoBuiltins)
 Call on well formed #pragma function.
NamedDecllookupExternCFunctionOrVariable (IdentifierInfo *IdentId, SourceLocation NameLoc, Scope *curScope)
void ActOnPragmaExport (IdentifierInfo *IdentId, SourceLocation ExportNameLoc, Scope *curScope)
 ActonPragmaExport - called on well-formed '#pragma export'.
void AddRangeBasedOptnone (FunctionDecl *FD)
 Only called on function definitions; if there is a pragma in scope with the effect of a range-based optnone, consider marking the function with attribute optnone.
void AddSectionMSAllocText (FunctionDecl *FD)
 Only called on function definitions; if there is a #pragma alloc_text that decides which code section the function should be in, add attribute section to the function.
void AddOptnoneAttributeIfNoConflicts (FunctionDecl *FD, SourceLocation Loc)
 Adds the 'optnone' attribute to the function declaration if there are no conflicts; Loc represents the location causing the 'optnone' attribute to be added (usually because of a pragma).
void ModifyFnAttributesMSPragmaOptimize (FunctionDecl *FD)
 Only called on function definitions; if there is a MSVC #pragma optimize in scope, consider changing the function's attributes based on the optimization list passed to the pragma.
void AddImplicitMSFunctionNoBuiltinAttr (FunctionDecl *FD)
 Only called on function definitions; if there is a pragma in scope with the effect of a range-based no_builtin, consider marking the function with attribute no_builtin.
void AddPushedVisibilityAttribute (Decl *RD)
 AddPushedVisibilityAttribute - If '#pragma GCC visibility' was used, add an appropriate visibility attribute.
void FreeVisContext ()
 FreeVisContext - Deallocate and null out VisContext.
void ActOnPragmaVisibility (const IdentifierInfo *VisType, SourceLocation PragmaLoc)
 ActOnPragmaVisibility - Called on well formed #pragma GCC visibility... .
void ActOnPragmaFPContract (SourceLocation Loc, LangOptions::FPModeKind FPC)
 ActOnPragmaFPContract - Called on well formed #pragma {STDC,OPENCL} FP_CONTRACT and #pragma clang fp contract.
void ActOnPragmaFPValueChangingOption (SourceLocation Loc, PragmaFPKind Kind, bool IsEnabled)
 Called on well formed #pragma clang fp reassociate or #pragma clang fp reciprocal.
void ActOnPragmaFEnvAccess (SourceLocation Loc, bool IsEnabled)
 ActOnPragmaFenvAccess - Called on well formed #pragma STDC FENV_ACCESS.
void ActOnPragmaCXLimitedRange (SourceLocation Loc, LangOptions::ComplexRangeKind Range)
 ActOnPragmaCXLimitedRange - Called on well formed #pragma STDC CX_LIMITED_RANGE.
void ActOnPragmaFPExceptions (SourceLocation Loc, LangOptions::FPExceptionModeKind)
 Called on well formed '#pragma clang fp' that has option 'exceptions'.
void ActOnPragmaFEnvRound (SourceLocation Loc, llvm::RoundingMode)
 Called to set constant rounding mode for floating point operations.
void setExceptionMode (SourceLocation Loc, LangOptions::FPExceptionModeKind)
 Called to set exception behavior for floating point operations.
void PushNamespaceVisibilityAttr (const VisibilityAttr *Attr, SourceLocation Loc)
 PushNamespaceVisibilityAttr - Note that we've entered a namespace with a visibility attribute.
void PopPragmaVisibility (bool IsNamespaceEnd, SourceLocation EndLoc)
 PopPragmaVisibility - Pop the top element of the visibility stack; used for '#pragma GCC visibility' and visibility attributes on namespaces.
bool checkCommonAttributeFeatures (const Decl *D, const ParsedAttr &A, bool SkipArgCountCheck=false)
 Handles semantic checking for features that are common to all attributes, such as checking whether a parameter was properly specified, or the correct number of arguments were passed, etc.
bool checkCommonAttributeFeatures (const Stmt *S, const ParsedAttr &A, bool SkipArgCountCheck=false)

Extra Semantic Checking

Implementations are in SemaChecking.cpp

enum  FormatArgumentPassingKind { FAPK_Fixed , FAPK_Variadic , FAPK_VAList , FAPK_Elsewhere }
enum class  AtomicArgumentOrder { API , AST }
enum class  EltwiseBuiltinArgTyRestriction { None , FloatTy , IntegerTy , SignedIntOrFloatTy }
typedef std::pair< const IdentifierInfo *, uint64_t > TypeTagMagicValue
 A pair of ArgumentKind identifier and magic value.
bool isConstantEvaluatedOverride = false
 Used to change context to isConstantEvaluated without pushing a heavy ExpressionEvaluationContextRecord object.
bool isConstantEvaluatedContext () const
SourceLocation getLocationOfStringLiteralByte (const StringLiteral *SL, unsigned ByteNo) const
ExprResult BuiltinShuffleVector (CallExpr *TheCall)
 BuiltinShuffleVector - Handle __builtin_shufflevector.
ExprResult ConvertVectorExpr (Expr *E, TypeSourceInfo *TInfo, SourceLocation BuiltinLoc, SourceLocation RParenLoc)
 ConvertVectorExpr - Handle __builtin_convertvector.
bool FormatStringHasSArg (const StringLiteral *FExpr)
void CheckFloatComparison (SourceLocation Loc, const Expr *LHS, const Expr *RHS, BinaryOperatorKind Opcode)
 Check for comparisons of floating-point values using == and !=.
void RegisterTypeTagForDatatype (const IdentifierInfo *ArgumentKind, uint64_t MagicValue, QualType Type, bool LayoutCompatible, bool MustBeNull)
 Register a magic integral constant to be used as a type tag.
void DiagnoseMisalignedMembers ()
 Diagnoses the current set of gathered accesses.
void DiscardMisalignedMemberAddress (const Type *T, Expr *E)
 This function checks if the expression is in the sef of potentially misaligned members and it is converted to some pointer type T with lower or equal alignment requirements.
bool DiscardingCFIUncheckedCallee (QualType From, QualType To) const
 Returns true if From is a function or pointer to a function with the cfi_unchecked_callee attribute but To is a function or pointer to function without this attribute.
void RefersToMemberWithReducedAlignment (Expr *E, llvm::function_ref< void(Expr *, RecordDecl *, FieldDecl *, CharUnits)> Action)
 This function calls Action when it determines that E designates a misaligned member due to the packed attribute.
ExprResult BuildAtomicExpr (SourceRange CallRange, SourceRange ExprRange, SourceLocation RParenLoc, MultiExprArg Args, AtomicExpr::AtomicOp Op, AtomicArgumentOrder ArgOrder=AtomicArgumentOrder::API)
bool hasCStrMethod (const Expr *E)
 Check to see if a given expression could have '.c_str()' called on it.
void DiagnoseAlwaysNonNullPointer (Expr *E, Expr::NullPointerConstantKind NullType, bool IsEqual, SourceRange Range)
 Diagnose pointers that are always non-null.
bool CheckParmsForFunctionDef (ArrayRef< ParmVarDecl * > Parameters, bool CheckParameterNames)
 CheckParmsForFunctionDef - Check that the parameters of the given function are appropriate for the definition of a function.
void CheckCastAlign (Expr *Op, QualType T, SourceRange TRange)
 CheckCastAlign - Implements -Wcast-align, which warns when a pointer cast increases the alignment requirements.
bool checkUnsafeAssigns (SourceLocation Loc, QualType LHS, Expr *RHS)
 checkUnsafeAssigns - Check whether +1 expr is being assigned to weak/__unsafe_unretained type.
void checkUnsafeExprAssigns (SourceLocation Loc, Expr *LHS, Expr *RHS)
 checkUnsafeExprAssigns - Check whether +1 expr is being assigned to weak/__unsafe_unretained expression.
void DiagnoseEmptyStmtBody (SourceLocation StmtLoc, const Stmt *Body, unsigned DiagID)
 Emit DiagID if statement located on StmtLoc has a suspicious null statement as a Body, and it is located on the same line.
void DiagnoseEmptyLoopBody (const Stmt *S, const Stmt *PossibleBody)
 Warn if a for/while loop statement S, which is followed by PossibleBody, has a suspicious null statement as a body.
void DiagnoseSelfMove (const Expr *LHSExpr, const Expr *RHSExpr, SourceLocation OpLoc)
 DiagnoseSelfMove - Emits a warning if a value is moved to itself.
bool IsLayoutCompatible (QualType T1, QualType T2) const
bool IsPointerInterconvertibleBaseOf (const TypeSourceInfo *Base, const TypeSourceInfo *Derived)
bool CheckFunctionCall (FunctionDecl *FDecl, CallExpr *TheCall, const FunctionProtoType *Proto)
 CheckFunctionCall - Check a direct function call for various correctness and safety properties not strictly enforced by the C type system.
std::optional< QualTypeBuiltinVectorMath (CallExpr *TheCall, EltwiseBuiltinArgTyRestriction ArgTyRestr=EltwiseBuiltinArgTyRestriction::None)
bool BuiltinVectorToScalarMath (CallExpr *TheCall)
void checkLifetimeCaptureBy (FunctionDecl *FDecl, bool IsMemberFunction, const Expr *ThisArg, ArrayRef< const Expr * > Args)
void checkCall (NamedDecl *FDecl, const FunctionProtoType *Proto, const Expr *ThisArg, ArrayRef< const Expr * > Args, bool IsMemberFunction, SourceLocation Loc, SourceRange Range, VariadicCallType CallType)
 Handles the checks for format strings, non-POD arguments to vararg functions, NULL arguments passed to non-NULL parameters, diagnose_if attributes and AArch64 SME attributes.
bool CheckFormatStringsCompatible (FormatStringType FST, const StringLiteral *AuthoritativeFormatString, const StringLiteral *TestedFormatString, const Expr *FunctionCallArg=nullptr)
 Verify that two format strings (as understood by attribute(format) and attribute(format_matches) are compatible.
bool ValidateFormatString (FormatStringType FST, const StringLiteral *Str)
 Verify that one format string (as understood by attribute(format)) is self-consistent; for instance, that it doesn't have multiple positional arguments referring to the same argument in incompatible ways.
void CheckTCBEnforcement (const SourceLocation CallExprLoc, const NamedDecl *Callee)
 Enforce the bounds of a TCB CheckTCBEnforcement - Enforces that every function in a named TCB only directly calls other functions in the same TCB as marked by the enforce_tcb and enforce_tcb_leaf attributes.
void CheckConstrainedAuto (const AutoType *AutoT, SourceLocation Loc)
bool BuiltinConstantArg (CallExpr *TheCall, unsigned ArgNum, llvm::APSInt &Result)
 BuiltinConstantArg - Handle a check if argument ArgNum of CallExpr TheCall is a constant expression.
bool BuiltinConstantArgRange (CallExpr *TheCall, unsigned ArgNum, int Low, int High, bool RangeIsError=true)
 BuiltinConstantArgRange - Handle a check if argument ArgNum of CallExpr TheCall is a constant expression in the range [Low, High].
bool BuiltinConstantArgMultiple (CallExpr *TheCall, unsigned ArgNum, unsigned Multiple)
 BuiltinConstantArgMultiple - Handle a check if argument ArgNum of CallExpr TheCall is a constant expression is a multiple of Num.
bool BuiltinConstantArgPower2 (CallExpr *TheCall, unsigned ArgNum)
 BuiltinConstantArgPower2 - Check if argument ArgNum of TheCall is a constant expression representing a power of 2.
bool BuiltinConstantArgShiftedByte (CallExpr *TheCall, unsigned ArgNum, unsigned ArgBits)
 BuiltinConstantArgShiftedByte - Check if argument ArgNum of TheCall is a constant expression representing an arbitrary byte value shifted left by a multiple of 8 bits.
bool BuiltinConstantArgShiftedByteOrXXFF (CallExpr *TheCall, unsigned ArgNum, unsigned ArgBits)
 BuiltinConstantArgShiftedByteOr0xFF - Check if argument ArgNum of TheCall is a constant expression representing either a shifted byte value, or a value of the form 0x?
bool checkArgCountAtLeast (CallExpr *Call, unsigned MinArgCount)
 Checks that a call expression's argument count is at least the desired number.
bool checkArgCountAtMost (CallExpr *Call, unsigned MaxArgCount)
 Checks that a call expression's argument count is at most the desired number.
bool checkArgCountRange (CallExpr *Call, unsigned MinArgCount, unsigned MaxArgCount)
 Checks that a call expression's argument count is in the desired range.
bool checkArgCount (CallExpr *Call, unsigned DesiredArgCount)
 Checks that a call expression's argument count is the desired number.
bool ValueIsRunOfOnes (CallExpr *TheCall, unsigned ArgNum)
 Returns true if the argument consists of one contiguous run of 1s with any number of 0s on either side.
void CheckImplicitConversion (Expr *E, QualType T, SourceLocation CC, bool *ICContext=nullptr, bool IsListInit=false)
bool BuiltinElementwiseTernaryMath (CallExpr *TheCall, EltwiseBuiltinArgTyRestriction ArgTyRestr=EltwiseBuiltinArgTyRestriction::FloatTy)
bool PrepareBuiltinElementwiseMathOneArgCall (CallExpr *TheCall, EltwiseBuiltinArgTyRestriction ArgTyRestr=EltwiseBuiltinArgTyRestriction::None)
static bool getFormatStringInfo (const Decl *Function, unsigned FormatIdx, unsigned FirstArg, FormatStringInfo *FSI)
 Given a function and its FormatAttr or FormatMatchesAttr info, attempts to populate the FormatStringInfo parameter with the attribute's correct format_idx and firstDataArg.
static bool getFormatStringInfo (unsigned FormatIdx, unsigned FirstArg, bool HasImplicitThisParam, bool IsVariadic, FormatStringInfo *FSI)
static StringRef GetFormatStringTypeName (FormatStringType FST)
static FormatStringType GetFormatStringType (StringRef FormatFlavor)
static FormatStringType GetFormatStringType (const FormatAttr *Format)
static FormatStringType GetFormatStringType (const FormatMatchesAttr *Format)

Declarations

Implementations are in SemaDecl.cpp

enum class  DiagCtorKind { None , Implicit , Typename }
enum class  TemplateNameKindForDiagnostics {
  ClassTemplate , FunctionTemplate , VarTemplate , AliasTemplate ,
  TemplateTemplateParam , Concept , DependentTemplate
}
 Describes the detailed kind of a template name. Used in diagnostics. More...
enum  NonTrivialCUnionKind { NTCUK_Init = 0x1 , NTCUK_Destruct = 0x2 , NTCUK_Copy = 0x4 }
enum class  FnBodyKind { Other , Default , Delete }
enum class  FunctionEmissionStatus {
  Emitted , CUDADiscarded , OMPDiscarded , TemplateDiscarded ,
  Unknown
}
 Status of the function emission on the CUDA/HIP/OpenMP host/device attrs. More...
typedef LazyVector< const DeclaratorDecl *, ExternalSemaSource, &ExternalSemaSource::ReadUnusedFileScopedDecls, 2, 2 > UnusedFileScopedDeclsType
typedef LazyVector< VarDecl *, ExternalSemaSource, &ExternalSemaSource::ReadTentativeDefinitions, 2, 2 > TentativeDefinitionsType
typedef void * SkippedDefinitionContext
typedef llvm::function_ref< void(SourceLocation Loc, PartialDiagnostic PD)> DiagReceiverTy
IdentifierResolver IdResolver
unsigned InventedParameterInfosStart = 0
 The index of the first InventedParameterInfo that refers to the current context.
llvm::SmallPtrSet< const NamedDecl *, 4 > TypoCorrectedFunctionDefinitions
 The function definitions which were renamed as part of typo-correction to match their respective declarations.
llvm::DenseMap< const EnumDecl *, llvm::APInt > FlagBitsCache
 A cache of the flags available in enumerations with the flag_bits attribute.
llvm::MapVector< IdentifierInfo *, llvm::SetVector< WeakInfo, llvm::SmallVector< WeakInfo, 1u >, llvm::SmallDenseSet< WeakInfo, 2u, WeakInfo::DenseMapInfoByAliasOnly > > > WeakUndeclaredIdentifiers
 WeakUndeclaredIdentifiers - Identifiers contained in #pragma weak before declared.
llvm::DenseMap< IdentifierInfo *, AsmLabelAttr * > ExtnameUndeclaredIdentifiers
 ExtnameUndeclaredIdentifiers - Identifiers contained in #pragma redefine_extname before declared.
llvm::SmallSetVector< const TypedefNameDecl *, 4 > UnusedLocalTypedefNameCandidates
 Set containing all typedefs that are likely unused.
UnusedFileScopedDeclsType UnusedFileScopedDecls
 The set of file scoped decls seen so far that have not been used and must warn if not used.
TentativeDefinitionsType TentativeDefinitions
 All the tentative definitions encountered in the TU.
SmallVector< DeclaratorDecl *, 4 > ExternalDeclarations
 All the external declarations encoutered and used in the TU.
DeclContextOriginalLexicalContext
 Generally null except when we temporarily switch decl contexts, like in.
llvm::SmallPtrSet< const Decl *, 4 > ParsingInitForAutoVars
 ParsingInitForAutoVars - a set of declarations with auto types for which we are currently parsing the initializer.
llvm::SmallSetVector< Decl *, 4 > DeclsToCheckForDeferredDiags
 Function or variable declarations to be checked for whether the deferred diagnostics should be emitted.
void DiagnoseInvalidJumps (Stmt *Body)
bool currentModuleIsHeaderUnit () const
 Is the module scope we are in a C++ Header Unit?
ModulegetOwningModule (const Decl *Entity)
 Get the module owning an entity.
DeclGroupPtrTy ConvertDeclToDeclGroup (Decl *Ptr, Decl *OwnedType=nullptr)
void checkTypeDeclType (DeclContext *LookupCtx, DiagCtorKind DCK, TypeDecl *TD, SourceLocation NameLoc)
 Returns the TypeDeclType for the given type declaration, as ASTContext::getTypeDeclType would, but performs the required semantic checks for name lookup of said entity.
ParsedType getTypeName (const IdentifierInfo &II, SourceLocation NameLoc, Scope *S, CXXScopeSpec *SS=nullptr, bool isClassName=false, bool HasTrailingDot=false, ParsedType ObjectType=nullptr, bool IsCtorOrDtorName=false, bool WantNontrivialTypeSourceInfo=false, bool IsClassTemplateDeductionContext=true, ImplicitTypenameContext AllowImplicitTypename=ImplicitTypenameContext::No, IdentifierInfo **CorrectedII=nullptr)
 If the identifier refers to a type name within this scope, return the declaration of that type.
TypeSpecifierType isTagName (IdentifierInfo &II, Scope *S)
 isTagName() - This method is called for error recovery purposes only to determine if the specified name is a valid tag name ("struct foo").
bool isMicrosoftMissingTypename (const CXXScopeSpec *SS, Scope *S)
 isMicrosoftMissingTypename - In Microsoft mode, within class scope, if a CXXScopeSpec's type is equal to the type of one of the base classes then downgrade the missing typename error to a warning.
void DiagnoseUnknownTypeName (IdentifierInfo *&II, SourceLocation IILoc, Scope *S, CXXScopeSpec *SS, ParsedType &SuggestedType, bool IsTemplateName=false)
ParsedType ActOnMSVCUnknownTypeName (const IdentifierInfo &II, SourceLocation NameLoc, bool IsTemplateTypeArg)
 Attempt to behave like MSVC in situations where lookup of an unqualified type name has failed in a dependent context.
NameClassification ClassifyName (Scope *S, CXXScopeSpec &SS, IdentifierInfo *&Name, SourceLocation NameLoc, const Token &NextToken, CorrectionCandidateCallback *CCC=nullptr)
 Perform name lookup on the given name, classifying it based on the results of name lookup and the following token.
ExprResult ActOnNameClassifiedAsUndeclaredNonType (IdentifierInfo *Name, SourceLocation NameLoc)
 Act on the result of classifying a name as an undeclared (ADL-only) non-type declaration.
ExprResult ActOnNameClassifiedAsDependentNonType (const CXXScopeSpec &SS, IdentifierInfo *Name, SourceLocation NameLoc, bool IsAddressOfOperand)
 Act on the result of classifying a name as an undeclared member of a dependent base class.
ExprResult ActOnNameClassifiedAsNonType (Scope *S, const CXXScopeSpec &SS, NamedDecl *Found, SourceLocation NameLoc, const Token &NextToken)
 Act on the result of classifying a name as a specific non-type declaration.
ExprResult ActOnNameClassifiedAsOverloadSet (Scope *S, Expr *OverloadSet)
 Act on the result of classifying a name as an overload set.
TemplateNameKindForDiagnostics getTemplateNameKindForDiagnostics (TemplateName Name)
bool mightBeIntendedToBeTemplateName (ExprResult E, bool &Dependent)
 Determine whether it's plausible that E was intended to be a template-name.
void warnOnReservedIdentifier (const NamedDecl *D)
void warnOnCTypeHiddenInCPlusPlus (const NamedDecl *D)
void ProcessPragmaExport (DeclaratorDecl *newDecl)
DeclActOnDeclarator (Scope *S, Declarator &D)
NamedDeclHandleDeclarator (Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParameterLists)
bool tryToFixVariablyModifiedVarType (TypeSourceInfo *&TInfo, QualType &T, SourceLocation Loc, unsigned FailedFoldDiagID)
 Attempt to fold a variable-sized type to a constant-sized type, returning true if we were successful.
void RegisterLocallyScopedExternCDecl (NamedDecl *ND, Scope *S)
 Register the given locally-scoped extern "C" declaration so that it can be found later for redeclarations.
bool DiagnoseClassNameShadow (DeclContext *DC, DeclarationNameInfo Info)
 DiagnoseClassNameShadow - Implement C++ [class.mem]p13: If T is the name of a class, then each of the following shall have a name different from T:
bool diagnoseQualifiedDeclaration (CXXScopeSpec &SS, DeclContext *DC, DeclarationName Name, SourceLocation Loc, TemplateIdAnnotation *TemplateId, bool IsMemberSpecialization)
 Diagnose a declaration whose declarator-id has the given nested-name-specifier.
bool checkPointerAuthEnabled (SourceLocation Loc, SourceRange Range)
bool checkConstantPointerAuthKey (Expr *keyExpr, unsigned &key)
bool checkPointerAuthDiscriminatorArg (Expr *Arg, PointerAuthDiscArgKind Kind, unsigned &IntVal)
void DiagnoseFunctionSpecifiers (const DeclSpec &DS)
 Diagnose function specifiers on a declaration of an identifier that does not identify a function.
NamedDeclgetShadowedDeclaration (const TypedefNameDecl *D, const LookupResult &R)
 Return the declaration shadowed by the given typedef D, or null if it doesn't shadow any declaration or shadowing warnings are disabled.
NamedDeclgetShadowedDeclaration (const VarDecl *D, const LookupResult &R)
 Return the declaration shadowed by the given variable D, or null if it doesn't shadow any declaration or shadowing warnings are disabled.
NamedDeclgetShadowedDeclaration (const BindingDecl *D, const LookupResult &R)
 Return the declaration shadowed by the given variable D, or null if it doesn't shadow any declaration or shadowing warnings are disabled.
void CheckShadow (NamedDecl *D, NamedDecl *ShadowedDecl, const LookupResult &R)
 Diagnose variable or built-in function shadowing.
void CheckShadow (Scope *S, VarDecl *D)
 Check -Wshadow without the advantage of a previous lookup.
void CheckShadowingDeclModification (Expr *E, SourceLocation Loc)
 Warn if 'E', which is an expression that is about to be modified, refers to a shadowing declaration.
void DiagnoseShadowingLambdaDecls (const sema::LambdaScopeInfo *LSI)
 Diagnose shadowing for variables shadowed in the lambda record LambdaRD when these variables are captured by the lambda.
void handleTagNumbering (const TagDecl *Tag, Scope *TagScope)
void setTagNameForLinkagePurposes (TagDecl *TagFromDeclSpec, TypedefNameDecl *NewTD)
void CheckTypedefForVariablyModifiedType (Scope *S, TypedefNameDecl *D)
NamedDeclActOnTypedefDeclarator (Scope *S, Declarator &D, DeclContext *DC, TypeSourceInfo *TInfo, LookupResult &Previous)
NamedDeclActOnTypedefNameDecl (Scope *S, DeclContext *DC, TypedefNameDecl *D, LookupResult &Previous, bool &Redeclaration)
 ActOnTypedefNameDecl - Perform semantic checking for a declaration which declares a typedef-name, either using the 'typedef' type specifier or via a C++0x [dcl.typedef]p2 alias-declaration: 'using T = A;'.
NamedDeclActOnVariableDeclarator (Scope *S, Declarator &D, DeclContext *DC, TypeSourceInfo *TInfo, LookupResult &Previous, MultiTemplateParamsArg TemplateParamLists, bool &AddToScope, ArrayRef< BindingDecl * > Bindings={})
bool CheckVariableDeclaration (VarDecl *NewVD, LookupResult &Previous)
 Perform semantic checking on a newly-created variable declaration.
void CheckVariableDeclarationType (VarDecl *NewVD)
void CheckCompleteVariableDeclaration (VarDecl *VD)
NamedDeclActOnFunctionDeclarator (Scope *S, Declarator &D, DeclContext *DC, TypeSourceInfo *TInfo, LookupResult &Previous, MultiTemplateParamsArg TemplateParamLists, bool &AddToScope)
bool AddOverriddenMethods (CXXRecordDecl *DC, CXXMethodDecl *MD)
 AddOverriddenMethods - See if a method overrides any in the base classes, and if so, check that it's a valid override and remember it.
bool CheckFunctionDeclaration (Scope *S, FunctionDecl *NewFD, LookupResult &Previous, bool IsMemberSpecialization, bool DeclIsDefn)
 Perform semantic checking of a new function declaration.
bool shouldLinkDependentDeclWithPrevious (Decl *D, Decl *OldDecl)
 Checks if the new declaration declared in dependent context must be put in the same redeclaration chain as the specified declaration.
bool canFullyTypeCheckRedeclaration (ValueDecl *NewD, ValueDecl *OldD, QualType NewT, QualType OldT)
 Determines if we can perform a correct type check for D as a redeclaration of PrevDecl.
void CheckMain (FunctionDecl *FD, const DeclSpec &D)
void CheckMSVCRTEntryPoint (FunctionDecl *FD)
AttrgetImplicitCodeSegOrSectionAttrForFunction (const FunctionDecl *FD, bool IsDefinition)
 Returns an implicit CodeSegAttr if a __declspec(code_seg) is found on a containing class.
void CheckFunctionOrTemplateParamDeclarator (Scope *S, Declarator &D)
 Common checks for a parameter-declaration that should apply to both function parameters and non-type template parameters.
DeclActOnParamDeclarator (Scope *S, Declarator &D, SourceLocation ExplicitThisLoc={})
 ActOnParamDeclarator - Called from Parser::ParseFunctionDeclarator() to introduce parameters into function prototype scope.
ParmVarDeclBuildParmVarDeclForTypedef (DeclContext *DC, SourceLocation Loc, QualType T)
 Synthesizes a variable for a parameter arising from a typedef.
ParmVarDeclCheckParameter (DeclContext *DC, SourceLocation StartLoc, SourceLocation NameLoc, const IdentifierInfo *Name, QualType T, TypeSourceInfo *TSInfo, StorageClass SC)
void checkNonTrivialCUnionInInitializer (const Expr *Init, SourceLocation Loc)
 Emit diagnostics if the initializer or any of its explicit or implicitly-generated subexpressions require copying or default-initializing a type that is or contains a C union type that is non-trivial to copy or default-initialize.
void checkNonTrivialCUnion (QualType QT, SourceLocation Loc, NonTrivialCUnionContext UseContext, unsigned NonTrivialKind)
 Emit diagnostics if a non-trivial C union type or a struct that contains a non-trivial C union is used in an invalid context.
bool GloballyUniqueObjectMightBeAccidentallyDuplicated (const VarDecl *Dcl)
 Certain globally-unique variables might be accidentally duplicated if built into multiple shared libraries with hidden visibility.
void DiagnoseUniqueObjectDuplication (const VarDecl *Dcl)
void AddInitializerToDecl (Decl *dcl, Expr *init, bool DirectInit)
 AddInitializerToDecl - Adds the initializer Init to the declaration dcl.
void ActOnUninitializedDecl (Decl *dcl)
void ActOnInitializerError (Decl *Dcl)
 ActOnInitializerError - Given that there was an error parsing an initializer for the given declaration, try to at least re-establish invariants such as whether a variable's type is either dependent or complete.
void ActOnCXXForRangeDecl (Decl *D)
StmtResult ActOnCXXForRangeIdentifier (Scope *S, SourceLocation IdentLoc, IdentifierInfo *Ident, ParsedAttributes &Attrs)
void CheckStaticLocalForDllExport (VarDecl *VD)
 Check if VD needs to be dllexport/dllimport due to being in a dllexport/import function.
void CheckThreadLocalForLargeAlignment (VarDecl *VD)
void FinalizeDeclaration (Decl *D)
 FinalizeDeclaration - called by ParseDeclarationAfterDeclarator to perform any semantic actions necessary after any initializer has been attached.
DeclGroupPtrTy FinalizeDeclaratorGroup (Scope *S, const DeclSpec &DS, ArrayRef< Decl * > Group)
DeclGroupPtrTy BuildDeclaratorGroup (MutableArrayRef< Decl * > Group)
 BuildDeclaratorGroup - convert a list of declarations into a declaration group, performing any necessary semantic checking.
void ActOnDocumentableDecl (Decl *D)
 Should be called on all declarations that might have attached documentation comments.
void ActOnDocumentableDecls (ArrayRef< Decl * > Group)
void ActOnFinishKNRParamDeclarations (Scope *S, Declarator &D, SourceLocation LocAfterDecls)
void CheckForFunctionRedefinition (FunctionDecl *FD, const FunctionDecl *EffectiveDefinition=nullptr, SkipBodyInfo *SkipBody=nullptr)
DeclActOnStartOfFunctionDef (Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParamLists, SkipBodyInfo *SkipBody=nullptr, FnBodyKind BodyKind=FnBodyKind::Other)
DeclActOnStartOfFunctionDef (Scope *S, Decl *D, SkipBodyInfo *SkipBody=nullptr, FnBodyKind BodyKind=FnBodyKind::Other)
void applyFunctionAttributesBeforeParsingBody (Decl *FD)
bool canDelayFunctionBody (const Declarator &D)
 Determine whether we can delay parsing the body of a function or function template until it is used, assuming we don't care about emitting code for that function.
bool canSkipFunctionBody (Decl *D)
 Determine whether we can skip parsing the body of a function definition, assuming we don't care about analyzing its body or emitting code for that function.
void computeNRVO (Stmt *Body, sema::FunctionScopeInfo *Scope)
 Given the set of return statements within a function body, compute the variables that are subject to the named return value optimization.
DeclActOnFinishFunctionBody (Decl *Decl, Stmt *Body, bool IsInstantiation=false, bool RetainFunctionScopeInfo=false)
 Performs semantic analysis at the end of a function body.
DeclActOnSkippedFunctionBody (Decl *Decl)
void ActOnFinishInlineFunctionDef (FunctionDecl *D)
void ActOnFinishDelayedAttribute (Scope *S, Decl *D, ParsedAttributes &Attrs)
 ActOnFinishDelayedAttribute - Invoked when we have finished parsing an attribute for which parsing is delayed.
void DiagnoseUnusedParameters (ArrayRef< ParmVarDecl * > Parameters)
 Diagnose any unused parameters in the given sequence of ParmVarDecl pointers.
void DiagnoseSizeOfParametersAndReturnValue (ArrayRef< ParmVarDecl * > Parameters, QualType ReturnTy, NamedDecl *D)
 Diagnose whether the size of parameters or return value of a function or obj-c method definition is pass-by-value and larger than a specified threshold.
DeclActOnFileScopeAsmDecl (Expr *expr, SourceLocation AsmLoc, SourceLocation RParenLoc)
TopLevelStmtDeclActOnStartTopLevelStmtDecl (Scope *S)
void ActOnFinishTopLevelStmtDecl (TopLevelStmtDecl *D, Stmt *Statement)
void ActOnPopScope (SourceLocation Loc, Scope *S)
DeclParsedFreeStandingDeclSpec (Scope *S, AccessSpecifier AS, DeclSpec &DS, const ParsedAttributesView &DeclAttrs, RecordDecl *&AnonRecord)
 ParsedFreeStandingDeclSpec - This method is invoked when a declspec with no declarator (e.g.
DeclParsedFreeStandingDeclSpec (Scope *S, AccessSpecifier AS, DeclSpec &DS, const ParsedAttributesView &DeclAttrs, MultiTemplateParamsArg TemplateParams, bool IsExplicitInstantiation, RecordDecl *&AnonRecord, SourceLocation EllipsisLoc={})
 ParsedFreeStandingDeclSpec - This method is invoked when a declspec with no declarator (e.g.
DeclBuildAnonymousStructOrUnion (Scope *S, DeclSpec &DS, AccessSpecifier AS, RecordDecl *Record, const PrintingPolicy &Policy)
 BuildAnonymousStructOrUnion - Handle the declaration of an anonymous structure or union.
void ActOnDefinedDeclarationSpecifier (Decl *D)
 Called once it is known whether a tag declaration is an anonymous union or struct.
void DiagPlaceholderFieldDeclDefinitions (RecordDecl *Record)
 Emit diagnostic warnings for placeholder members.
DeclBuildMicrosoftCAnonymousStruct (Scope *S, DeclSpec &DS, RecordDecl *Record)
 BuildMicrosoftCAnonymousStruct - Handle the declaration of an Microsoft C anonymous structure.
NonTagKind getNonTagTypeDeclKind (const Decl *D, TagTypeKind TTK)
 Given a non-tag type declaration, returns an enum useful for indicating what kind of non-tag type this is.
bool isAcceptableTagRedeclaration (const TagDecl *Previous, TagTypeKind NewTag, bool isDefinition, SourceLocation NewTagLoc, const IdentifierInfo *Name)
 Determine whether a tag with a given kind is acceptable as a redeclaration of the given tag declaration.
DeclResult ActOnTag (Scope *S, unsigned TagSpec, TagUseKind TUK, SourceLocation KWLoc, CXXScopeSpec &SS, IdentifierInfo *Name, SourceLocation NameLoc, const ParsedAttributesView &Attr, AccessSpecifier AS, SourceLocation ModulePrivateLoc, MultiTemplateParamsArg TemplateParameterLists, bool &OwnedDecl, bool &IsDependent, SourceLocation ScopedEnumKWLoc, bool ScopedEnumUsesClassTag, TypeResult UnderlyingType, bool IsTypeSpecifier, bool IsTemplateParamOrArg, OffsetOfKind OOK, SkipBodyInfo *SkipBody=nullptr)
 This is invoked when we see 'struct foo' or 'struct {'.
DeclActOnField (Scope *S, Decl *TagD, SourceLocation DeclStart, Declarator &D, Expr *BitfieldWidth)
 ActOnField - Each field of a C struct/union is passed into this in order to create a FieldDecl object for it.
FieldDeclHandleField (Scope *S, RecordDecl *TagD, SourceLocation DeclStart, Declarator &D, Expr *BitfieldWidth, InClassInitStyle InitStyle, AccessSpecifier AS)
 HandleField - Analyze a field of a C struct or a C++ data member.
FieldDeclCheckFieldDecl (DeclarationName Name, QualType T, TypeSourceInfo *TInfo, RecordDecl *Record, SourceLocation Loc, bool Mutable, Expr *BitfieldWidth, InClassInitStyle InitStyle, SourceLocation TSSL, AccessSpecifier AS, NamedDecl *PrevDecl, Declarator *D=nullptr)
 Build a new FieldDecl and check its well-formedness.
bool CheckNontrivialField (FieldDecl *FD)
void ActOnLastBitfield (SourceLocation DeclStart, SmallVectorImpl< Decl * > &AllIvarDecls)
 ActOnLastBitfield - This routine handles synthesized bitfields rules for class and class extensions.
void ActOnFields (Scope *S, SourceLocation RecLoc, Decl *TagDecl, ArrayRef< Decl * > Fields, SourceLocation LBrac, SourceLocation RBrac, const ParsedAttributesView &AttrList)
void ActOnTagStartDefinition (Scope *S, Decl *TagDecl)
 ActOnTagStartDefinition - Invoked when we have entered the scope of a tag's definition (e.g., for an enumeration, class, struct, or union).
bool ActOnDuplicateDefinition (Scope *S, Decl *Prev, SkipBodyInfo &SkipBody)
 Perform ODR-like check for C/ObjC when merging tag types from modules.
SkippedDefinitionContext ActOnTagStartSkippedDefinition (Scope *S, Decl *TD)
 Invoked when we enter a tag definition that we're skipping.
void ActOnStartCXXMemberDeclarations (Scope *S, Decl *TagDecl, SourceLocation FinalLoc, bool IsFinalSpelledSealed, bool IsAbstract, SourceLocation LBraceLoc)
 ActOnStartCXXMemberDeclarations - Invoked when we have parsed a C++ record definition's base-specifiers clause and are starting its member declarations.
void ActOnTagFinishDefinition (Scope *S, Decl *TagDecl, SourceRange BraceRange)
 ActOnTagFinishDefinition - Invoked once we have finished parsing the definition of a tag (enumeration, class, struct, or union).
ASTContext::CXXRecordDeclRelocationInfo CheckCXX2CRelocatable (const clang::CXXRecordDecl *D)
void ActOnTagFinishSkippedDefinition (SkippedDefinitionContext Context)
void ActOnTagDefinitionError (Scope *S, Decl *TagDecl)
 ActOnTagDefinitionError - Invoked when there was an unrecoverable error parsing the definition of a tag.
EnumConstantDeclCheckEnumConstant (EnumDecl *Enum, EnumConstantDecl *LastEnumConst, SourceLocation IdLoc, IdentifierInfo *Id, Expr *val)
bool CheckEnumUnderlyingType (TypeSourceInfo *TI)
 Check that this is a valid underlying type for an enum declaration.
bool CheckEnumRedeclaration (SourceLocation EnumLoc, bool IsScoped, QualType EnumUnderlyingTy, bool IsFixed, const EnumDecl *Prev)
 Check whether this is a valid redeclaration of a previous enumeration.
SkipBodyInfo shouldSkipAnonEnumBody (Scope *S, IdentifierInfo *II, SourceLocation IILoc)
 Determine whether the body of an anonymous enumeration should be skipped.
DeclActOnEnumConstant (Scope *S, Decl *EnumDecl, Decl *LastEnumConstant, SourceLocation IdLoc, IdentifierInfo *Id, const ParsedAttributesView &Attrs, SourceLocation EqualLoc, Expr *Val, SkipBodyInfo *SkipBody=nullptr)
void ActOnEnumBody (SourceLocation EnumLoc, SourceRange BraceRange, Decl *EnumDecl, ArrayRef< Decl * > Elements, Scope *S, const ParsedAttributesView &Attr)
void PushDeclContext (Scope *S, DeclContext *DC)
 Set the current declaration context until it gets popped.
void PopDeclContext ()
void EnterDeclaratorContext (Scope *S, DeclContext *DC)
 EnterDeclaratorContext - Used when we must lookup names in the context of a declarator's nested name specifier.
void ExitDeclaratorContext (Scope *S)
void EnterTemplatedContext (Scope *S, DeclContext *DC)
 Enter a template parameter scope, after it's been associated with a particular DeclContext.
void ActOnReenterFunctionContext (Scope *S, Decl *D)
 Push the parameters of D, which must be a function, into scope.
void ActOnExitFunctionContext ()
void PushOnScopeChains (NamedDecl *D, Scope *S, bool AddToContext=true)
 Add this decl to the scope shadowed decl chains.
bool isDeclInScope (NamedDecl *D, DeclContext *Ctx, Scope *S=nullptr, bool AllowInlineNamespace=false) const
 isDeclInScope - If 'Ctx' is a function/method, isDeclInScope returns true if 'D' is in Scope 'S', otherwise 'S' is ignored and isDeclInScope returns true if 'D' belongs to the given declaration context.
TypedefDeclParseTypedefDecl (Scope *S, Declarator &D, QualType T, TypeSourceInfo *TInfo)
 Subroutines of ActOnDeclarator().
bool isIncompatibleTypedef (const TypeDecl *Old, TypedefNameDecl *New)
void mergeDeclAttributes (NamedDecl *New, Decl *Old, AvailabilityMergeKind AMK=AvailabilityMergeKind::Redeclaration)
 mergeDeclAttributes - Copy attributes from the Old decl to the New one.
void CheckAttributesOnDeducedType (Decl *D)
 CheckAttributesOnDeducedType - Calls Sema functions for attributes that requires the type to be deduced.
void MergeTypedefNameDecl (Scope *S, TypedefNameDecl *New, LookupResult &OldDecls)
 MergeTypedefNameDecl - We just parsed a typedef 'New' which has the same name and scope as a previous declaration 'Old'.
void CleanupMergedEnum (Scope *S, Decl *New)
 CleanupMergedEnum - We have just merged the decl 'New' by making another definition visible.
bool MergeFunctionDecl (FunctionDecl *New, NamedDecl *&Old, Scope *S, bool MergeTypeWithOld, bool NewDeclIsDefn)
 MergeFunctionDecl - We just parsed a function 'New' from declarator D which has the same name and scope as a previous declaration 'Old'.
bool MergeCompatibleFunctionDecls (FunctionDecl *New, FunctionDecl *Old, Scope *S, bool MergeTypeWithOld)
 Completes the merge of two function declarations that are known to be compatible.
void mergeObjCMethodDecls (ObjCMethodDecl *New, ObjCMethodDecl *Old)
void MergeVarDecl (VarDecl *New, LookupResult &Previous)
 MergeVarDecl - We just parsed a variable 'New' which has the same name and scope as a previous declaration 'Old'.
void MergeVarDeclTypes (VarDecl *New, VarDecl *Old, bool MergeTypeWithOld)
 MergeVarDeclTypes - We parsed a variable 'New' which has the same name and scope as a previous declaration 'Old'.
bool checkVarDeclRedefinition (VarDecl *OldDefn, VarDecl *NewDefn)
 We've just determined that Old and New both appear to be definitions of the same variable.
void notePreviousDefinition (const NamedDecl *Old, SourceLocation New)
void FilterLookupForScope (LookupResult &R, DeclContext *Ctx, Scope *S, bool ConsiderLinkage, bool AllowInlineNamespace)
 Filters out lookup results that don't fall within the given scope as determined by isDeclInScope.
bool CheckRedeclarationModuleOwnership (NamedDecl *New, NamedDecl *Old)
 We've determined that New is a redeclaration of Old.
bool CheckRedeclarationExported (NamedDecl *New, NamedDecl *Old)
 [module.interface]p6: A redeclaration of an entity X is implicitly exported if X was introduced by an exported declaration; otherwise it shall not be exported.
bool CheckRedeclarationInModule (NamedDecl *New, NamedDecl *Old)
 A wrapper function for checking the semantic restrictions of a redeclaration within a module.
bool IsRedefinitionInModule (const NamedDecl *New, const NamedDecl *Old) const
 Check the redefinition in C++20 Modules.
bool ShouldWarnIfUnusedFileScopedDecl (const DeclaratorDecl *D) const
void MarkUnusedFileScopedDecl (const DeclaratorDecl *D)
 If it's a file scoped decl that must warn if not used, keep track of it.
void DiagnoseUnusedNestedTypedefs (const RecordDecl *D)
void DiagnoseUnusedNestedTypedefs (const RecordDecl *D, DiagReceiverTy DiagReceiver)
void DiagnoseUnusedDecl (const NamedDecl *ND)
void DiagnoseUnusedDecl (const NamedDecl *ND, DiagReceiverTy DiagReceiver)
 DiagnoseUnusedDecl - Emit warnings about declarations that are not used unless they are marked attr(unused).
void DiagnoseUnusedButSetDecl (const VarDecl *VD, DiagReceiverTy DiagReceiver)
 If VD is set but not otherwise used, diagnose, for a parameter or a variable.
ScopegetNonFieldDeclScope (Scope *S)
 getNonFieldDeclScope - Retrieves the innermost scope, starting from S, where a non-field would be declared.
FunctionDeclCreateBuiltin (IdentifierInfo *II, QualType Type, unsigned ID, SourceLocation Loc)
NamedDeclLazilyCreateBuiltin (IdentifierInfo *II, unsigned ID, Scope *S, bool ForRedeclaration, SourceLocation Loc)
 LazilyCreateBuiltin - The specified Builtin-ID was first used at file scope.
const AttributedType * getCallingConvAttributedType (QualType T) const
 Get the outermost AttributedType node that sets a calling convention.
DeclarationNameInfo GetNameForDeclarator (Declarator &D)
 GetNameForDeclarator - Determine the full declaration name for the given Declarator.
DeclarationNameInfo GetNameFromUnqualifiedId (const UnqualifiedId &Name)
 Retrieves the declaration name from a parsed unqualified-id.
NamedDeclfindLocallyScopedExternCDecl (DeclarationName Name)
 Look for a locally scoped extern "C" declaration by the given name.
void deduceOpenCLAddressSpace (ValueDecl *decl)
void deduceHLSLAddressSpace (VarDecl *decl)
void MarkTypoCorrectedFunctionDefinition (const NamedDecl *F)
bool areMultiversionVariantFunctionsCompatible (const FunctionDecl *OldFD, const FunctionDecl *NewFD, const PartialDiagnostic &NoProtoDiagID, const PartialDiagnosticAt &NoteCausedDiagIDAt, const PartialDiagnosticAt &NoSupportDiagIDAt, const PartialDiagnosticAt &DiffDiagIDAt, bool TemplatesSupported, bool ConstexprSupported, bool CLinkageMayDiffer)
 Checks if the variant/multiversion functions are compatible.
bool CheckForConstantInitializer (Expr *Init, unsigned DiagID=diag::err_init_element_not_constant)
 type checking declaration initializers (C99 6.7.8)
QualType deduceVarTypeFromInitializer (VarDecl *VDecl, DeclarationName Name, QualType Type, TypeSourceInfo *TSI, SourceRange Range, bool DirectInit, Expr *Init)
bool DeduceVariableDeclarationType (VarDecl *VDecl, bool DirectInit, Expr *Init)
sema::LambdaScopeInfoRebuildLambdaScopeInfo (CXXMethodDecl *CallOperator)
NamedDeclImplicitlyDefineFunction (SourceLocation Loc, IdentifierInfo &II, Scope *S)
 ImplicitlyDefineFunction - An undeclared identifier was used in a function call, forming a call to an implicitly defined function (per C99 6.5.1p2).
void AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction (FunctionDecl *FD)
 If this function is a C++ replaceable global allocation function (C++2a [basic.stc.dynamic.allocation], C++2a [new.delete]), adds any function attributes that we know a priori based on the standard.
void AddKnownFunctionAttributes (FunctionDecl *FD)
 Adds any function attributes that we know a priori based on the declaration of this function.
ExprResult VerifyBitField (SourceLocation FieldLoc, const IdentifierInfo *FieldName, QualType FieldTy, bool IsMsStruct, Expr *BitWidth)
 VerifyBitField - verifies that a bit field expression is an ICE and has the correct width, and that the field type is valid.
bool IsValueInFlagEnum (const EnumDecl *ED, const llvm::APInt &Val, bool AllowMask) const
 IsValueInFlagEnum - Determine if a value is allowed as part of a flag enum.
void ActOnPragmaWeakID (IdentifierInfo *WeakName, SourceLocation PragmaLoc, SourceLocation WeakNameLoc)
 ActOnPragmaWeakID - Called on well formed #pragma weak ident.
void ActOnPragmaRedefineExtname (IdentifierInfo *WeakName, IdentifierInfo *AliasName, SourceLocation PragmaLoc, SourceLocation WeakNameLoc, SourceLocation AliasNameLoc)
 ActOnPragmaRedefineExtname - Called on well formed #pragma redefine_extname oldname newname.
void ActOnPragmaWeakAlias (IdentifierInfo *WeakName, IdentifierInfo *AliasName, SourceLocation PragmaLoc, SourceLocation WeakNameLoc, SourceLocation AliasNameLoc)
 ActOnPragmaWeakAlias - Called on well formed #pragma weak ident = ident.
FunctionEmissionStatus getEmissionStatus (const FunctionDecl *Decl, bool Final=false)
bool shouldIgnoreInHostDeviceCheck (FunctionDecl *Callee)
static ScopegetScopeForDeclContext (Scope *S, DeclContext *DC)
 Finds the scope corresponding to the given decl context, if it happens to be an enclosing scope.
static bool adjustContextForLocalExternDecl (DeclContext *&DC)
 Adjust the DeclContext for a function or variable that might be a function-local external declaration.
static bool CanBeGetReturnObject (const FunctionDecl *FD)
static bool CanBeGetReturnTypeOnAllocFailure (const FunctionDecl *FD)

Declaration Attribute Handling

Implementations are in SemaDeclAttr.cpp

enum  AvailabilityPriority : int { AP_Explicit = 0 , AP_PragmaClangAttribute = 1 , AP_InferredFromOtherPlatform = 2 }
 Describes the kind of priority given to an availability attribute. More...
enum class  CallingConventionIgnoredReason { ForThisTarget = 0 , VariadicFunction , ConstructorDestructor , BuiltinFunction }
 Describes the reason a calling convention specification was ignored, used for diagnostics. More...
enum class  RetainOwnershipKind { NS , CF , OS }
typedef LazyVector< TypedefNameDecl *, ExternalSemaSource, &ExternalSemaSource::ReadExtVectorDecls, 2, 2 > ExtVectorDeclsType
SmallVector< Decl *, 2 > WeakTopLevelDecl
 WeakTopLevelDecl - Translation-unit scoped declarations generated by #pragma weak during processing of other Decls.
ExtVectorDeclsType ExtVectorDecls
 ExtVectorDecls - This is a list all the extended vector types.
SourceLocation getAttrLoc (const AttributeCommonInfo &CI)
template<typename AttrInfo>
bool checkUInt32Argument (const AttrInfo &AI, const Expr *Expr, uint32_t &Val, unsigned Idx=UINT_MAX, bool StrictlyUnsigned=false)
 If Expr is a valid integer constant, get the value of the integer expression and return success or failure.
SmallVectorImpl< Decl * > & WeakTopLevelDecls ()
 WeakTopLevelDeclDecls - access to #pragma weak-generated Decls.
bool checkStringLiteralArgumentAttr (const AttributeCommonInfo &CI, const Expr *E, StringRef &Str, SourceLocation *ArgLocation=nullptr)
 Check if the argument E is a ASCII string literal.
bool checkStringLiteralArgumentAttr (const ParsedAttr &Attr, unsigned ArgNum, StringRef &Str, SourceLocation *ArgLocation=nullptr)
 Check if the argument ArgNum of Attr is a ASCII string literal.
bool isValidPointerAttrType (QualType T, bool RefOkay=false)
 Determine if type T is a valid subject for a nonnull and similar attributes.
void AddAssumeAlignedAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E, Expr *OE)
 AddAssumeAlignedAttr - Adds an assume_aligned attribute to a particular declaration.
void AddAllocAlignAttr (Decl *D, const AttributeCommonInfo &CI, Expr *ParamExpr)
 AddAllocAlignAttr - Adds an alloc_align attribute to a particular declaration.
bool CheckAttrTarget (const ParsedAttr &CurrAttr)
bool CheckAttrNoArgs (const ParsedAttr &CurrAttr)
AvailabilityAttr * mergeAvailabilityAttr (NamedDecl *D, const AttributeCommonInfo &CI, const IdentifierInfo *Platform, bool Implicit, VersionTuple Introduced, VersionTuple Deprecated, VersionTuple Obsoleted, bool IsUnavailable, StringRef Message, bool IsStrict, StringRef Replacement, AvailabilityMergeKind AMK, int Priority, const IdentifierInfo *IIEnvironment)
TypeVisibilityAttr * mergeTypeVisibilityAttr (Decl *D, const AttributeCommonInfo &CI, TypeVisibilityAttr::VisibilityType Vis)
VisibilityAttr * mergeVisibilityAttr (Decl *D, const AttributeCommonInfo &CI, VisibilityAttr::VisibilityType Vis)
void mergeVisibilityType (Decl *D, SourceLocation Loc, VisibilityAttr::VisibilityType Type)
SectionAttr * mergeSectionAttr (Decl *D, const AttributeCommonInfo &CI, StringRef Name)
llvm::Error isValidSectionSpecifier (StringRef Str)
 Used to implement to perform semantic checking on attribute((section("foo"))) specifiers.
bool checkSectionName (SourceLocation LiteralLoc, StringRef Str)
CodeSegAttr * mergeCodeSegAttr (Decl *D, const AttributeCommonInfo &CI, StringRef Name)
bool checkTargetAttr (SourceLocation LiteralLoc, StringRef Str)
ErrorAttr * mergeErrorAttr (Decl *D, const AttributeCommonInfo &CI, StringRef NewUserDiagnostic)
FormatAttr * mergeFormatAttr (Decl *D, const AttributeCommonInfo &CI, const IdentifierInfo *Format, int FormatIdx, int FirstArg)
FormatMatchesAttr * mergeFormatMatchesAttr (Decl *D, const AttributeCommonInfo &CI, const IdentifierInfo *Format, int FormatIdx, StringLiteral *FormatStr)
ModularFormatAttr * mergeModularFormatAttr (Decl *D, const AttributeCommonInfo &CI, const IdentifierInfo *ModularImplFn, StringRef ImplName, MutableArrayRef< StringRef > Aspects)
void AddAlignedAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E, bool IsPackExpansion)
 AddAlignedAttr - Adds an aligned attribute to a particular declaration.
void AddAlignedAttr (Decl *D, const AttributeCommonInfo &CI, TypeSourceInfo *T, bool IsPackExpansion)
void AddAlignValueAttr (Decl *D, const AttributeCommonInfo &CI, Expr *E)
 AddAlignValueAttr - Adds an align_value attribute to a particular declaration.
AttrCreateAnnotationAttr (const AttributeCommonInfo &CI, StringRef Annot, MutableArrayRef< Expr * > Args)
 CreateAnnotationAttr - Creates an annotation Annot with Args arguments.
AttrCreateAnnotationAttr (const ParsedAttr &AL)
bool checkMSInheritanceAttrOnDefinition (CXXRecordDecl *RD, SourceRange Range, bool BestCase, MSInheritanceModel SemanticSpelling)
void CheckAlignasUnderalignment (Decl *D)
void AddModeAttr (Decl *D, const AttributeCommonInfo &CI, const IdentifierInfo *Name, bool InInstantiation=false)
 AddModeAttr - Adds a mode attribute to a particular declaration.
AlwaysInlineAttr * mergeAlwaysInlineAttr (Decl *D, const AttributeCommonInfo &CI, const IdentifierInfo *Ident)
MinSizeAttr * mergeMinSizeAttr (Decl *D, const AttributeCommonInfo &CI)
OptimizeNoneAttr * mergeOptimizeNoneAttr (Decl *D, const AttributeCommonInfo &CI)
InternalLinkageAttr * mergeInternalLinkageAttr (Decl *D, const ParsedAttr &AL)
InternalLinkageAttr * mergeInternalLinkageAttr (Decl *D, const InternalLinkageAttr &AL)
bool CheckCallingConvAttr (const ParsedAttr &attr, CallingConv &CC, const FunctionDecl *FD=nullptr, CUDAFunctionTarget CFT=CUDAFunctionTarget::InvalidTarget)
 Check validaty of calling convention attribute attr.
bool CheckRegparmAttr (const ParsedAttr &attr, unsigned &value)
 Checks a regparm attribute, returning true if it is ill-formed and otherwise setting numParams to the appropriate value.
CUDALaunchBoundsAttr * CreateLaunchBoundsAttr (const AttributeCommonInfo &CI, Expr *MaxThreads, Expr *MinBlocks, Expr *MaxBlocks)
 Create an CUDALaunchBoundsAttr attribute.
void AddLaunchBoundsAttr (Decl *D, const AttributeCommonInfo &CI, Expr *MaxThreads, Expr *MinBlocks, Expr *MaxBlocks)
 AddLaunchBoundsAttr - Adds a launch_bounds attribute to a particular declaration.
CUDAClusterDimsAttr * createClusterDimsAttr (const AttributeCommonInfo &CI, Expr *X, Expr *Y, Expr *Z)
 Add a cluster_dims attribute to a particular declaration.
void addClusterDimsAttr (Decl *D, const AttributeCommonInfo &CI, Expr *X, Expr *Y, Expr *Z)
void addNoClusterAttr (Decl *D, const AttributeCommonInfo &CI)
 Add a no_cluster attribute to a particular declaration.
UuidAttr * mergeUuidAttr (Decl *D, const AttributeCommonInfo &CI, StringRef UuidAsWritten, MSGuidDecl *GuidDecl)
BTFDeclTagAttr * mergeBTFDeclTagAttr (Decl *D, const BTFDeclTagAttr &AL)
DLLImportAttr * mergeDLLImportAttr (Decl *D, const AttributeCommonInfo &CI)
DLLExportAttr * mergeDLLExportAttr (Decl *D, const AttributeCommonInfo &CI)
MSInheritanceAttr * mergeMSInheritanceAttr (Decl *D, const AttributeCommonInfo &CI, bool BestCase, MSInheritanceModel Model)
EnforceTCBAttr * mergeEnforceTCBAttr (Decl *D, const EnforceTCBAttr &AL)
EnforceTCBLeafAttr * mergeEnforceTCBLeafAttr (Decl *D, const EnforceTCBLeafAttr &AL)
void ProcessDeclAttributeDelayed (Decl *D, const ParsedAttributesView &AttrList)
 Helper for delayed processing TransparentUnion or BPFPreserveAccessIndexAttr attribute.
void ProcessDeclAttributeList (Scope *S, Decl *D, const ParsedAttributesView &AttrList, const ProcessDeclAttributeOptions &Options=ProcessDeclAttributeOptions())
 ProcessDeclAttributeList - Apply all the decl attributes in the specified attribute list to the specified decl, ignoring any type attributes.
bool ProcessAccessDeclAttributeList (AccessSpecDecl *ASDecl, const ParsedAttributesView &AttrList)
 Annotation attributes are the only attributes allowed after an access specifier.
void checkUnusedDeclAttributes (Declarator &D)
 checkUnusedDeclAttributes - Given a declarator which is not being used to build a declaration, complain about any decl attributes which might be lying around on it.
void DiagnoseUnknownAttribute (const ParsedAttr &AL)
NamedDeclDeclClonePragmaWeak (NamedDecl *ND, const IdentifierInfo *II, SourceLocation Loc)
 DeclClonePragmaWeak - clone existing decl (maybe definition), #pragma weak needs a non-definition decl and source may not have one.
void DeclApplyPragmaWeak (Scope *S, NamedDecl *ND, const WeakInfo &W)
 DeclApplyPragmaWeak - A declaration (maybe definition) needs #pragma weak applied to it, possibly with an alias.
void ProcessPragmaWeak (Scope *S, Decl *D)
void ProcessDeclAttributes (Scope *S, Decl *D, const Declarator &PD)
 ProcessDeclAttributes - Given a declarator (PD) with attributes indicated in it, apply them to D.
void PopParsingDeclaration (ParsingDeclState state, Decl *decl)
void redelayDiagnostics (sema::DelayedDiagnosticPool &pool)
 Given a set of delayed diagnostics, re-emit them as if they had been delayed in the current context instead of in the given pool.
bool CheckSpanLikeType (const AttributeCommonInfo &CI, const QualType &Ty)
 Check that the type is a plain record with one field being a pointer type and the other field being an integer.
template<typename AttrInfo>
bool checkFunctionOrMethodParameterIndex (const Decl *D, const AttrInfo &AI, unsigned AttrArgNum, const Expr *IdxExpr, ParamIdx &Idx, bool CanIndexImplicitThis=false, bool CanIndexVariadicArguments=false)
 Check if IdxExpr is a valid parameter index for a function or instance method D.
template<typename AttrInfo>
static std::enable_if_t< std::is_base_of_v< Attr, AttrInfo >, SourceLocationgetAttrLoc (const AttrInfo &AL)
 A helper function to provide Attribute Location for the Attr types AND the ParsedAttr.

C++ Declarations

Implementations are in SemaDeclCXX.cpp

enum class  ComparisonCategoryUsage { OperatorInExpression , DefaultedOperator }
enum class  StringEvaluationContext { StaticAssert = 0 , Asm = 1 }
enum class  DefaultedComparisonKind : unsigned char {
  None , Equal , ThreeWay , NotEqual ,
  Relational
}
 Kinds of defaulted comparison operator functions. More...
enum  AbstractDiagSelID {
  AbstractNone = -1 , AbstractReturnType , AbstractParamType , AbstractVariableType ,
  AbstractFieldType , AbstractIvarType , AbstractSynthesizedIvarType , AbstractArrayType
}
enum class  CheckConstexprKind { Diagnose , CheckValid }
typedef std::pair< CXXRecordDecl *, SourceLocationVTableUse
 The list of classes whose vtables have been used within this translation unit, and the source locations at which the first use occurred.
typedef llvm::SmallSetVector< const NamedDecl *, 16 > NamedDeclSetType
typedef llvm::SmallPtrSet< const CXXRecordDecl *, 8 > RecordDeclSetTy
typedef LazyVector< CXXConstructorDecl *, ExternalSemaSource, &ExternalSemaSource::ReadDelegatingConstructors, 2, 2 > DelegatingCtorDeclsType
typedef llvm::PointerIntPair< CXXRecordDecl *, 3, CXXSpecialMemberKindSpecialMemberDecl
typedef ProcessingContextState ParsingClassState
SmallVector< VTableUse, 16 > VTableUses
 The list of vtables that are required but have not yet been materialized.
llvm::DenseMap< CXXRecordDecl *, boolVTablesUsed
 The set of classes whose vtables have been used within this translation unit, and a bit that will be true if the vtable is required to be emitted (otherwise, it should be emitted only if needed by code generation).
SmallVector< CXXRecordDecl *, 4 > DelayedDllExportClasses
SmallVector< CXXMethodDecl *, 4 > DelayedDllExportMemberFunctions
SmallVector< InventedTemplateParameterInfo, 4 > InventedParameterInfos
 Stack containing information needed when in C++2a an 'auto' is encountered in a function declaration parameter type specifier in order to invent a corresponding template parameter in the enclosing abbreviated function template.
std::unique_ptr< CXXFieldCollectorFieldCollector
 FieldCollector - Collects CXXFieldDecls during parsing of C++ classes.
NamedDeclSetType UnusedPrivateFields
 Set containing all declared private fields that are not used.
std::unique_ptr< RecordDeclSetTyPureVirtualClassDiagSet
 PureVirtualClassDiagSet - a set of class declarations which we have emitted a list of pure virtual functions.
DelegatingCtorDeclsType DelegatingCtorDecls
 All the delegating constructors seen so far in the file, used for cycle detection at the end of the TU.
LazyDeclPtr StdNamespace
 The C++ "std" namespace, where the standard library resides.
ClassTemplateDeclStdInitializerList
 The C++ "std::initializer_list" template, which is defined in <initializer_list>.
ClassTemplateDeclStdTypeIdentity
 The C++ "std::type_identity" template, which is defined in <type_traits>.
llvm::DenseMap< ParmVarDecl *, SourceLocationUnparsedDefaultArgLocs
llvm::MapVector< NamedDecl *, SourceLocationUndefinedButUsed
 UndefinedInternals - all the used, undefined objects which require a definition in this translation unit.
llvm::SmallPtrSet< SpecialMemberDecl, 4 > SpecialMembersBeingDeclared
 The C++ special members which we are currently in the process of declaring.
void CheckDelegatingCtorCycles ()
void ActOnStartFunctionDeclarationDeclarator (Declarator &D, unsigned TemplateParameterDepth)
 Called before parsing a function declarator belonging to a function declaration.
void ActOnFinishFunctionDeclarationDeclarator (Declarator &D)
 Called after parsing a function declarator belonging to a function declaration.
DeclActOnStartNamespaceDef (Scope *S, SourceLocation InlineLoc, SourceLocation NamespaceLoc, SourceLocation IdentLoc, IdentifierInfo *Ident, SourceLocation LBrace, const ParsedAttributesView &AttrList, UsingDirectiveDecl *&UsingDecl, bool IsNested)
 ActOnStartNamespaceDef - This is called at the start of a namespace definition.
void ActOnFinishNamespaceDef (Decl *Dcl, SourceLocation RBrace)
 ActOnFinishNamespaceDef - This callback is called after a namespace is exited.
NamespaceDeclgetStdNamespace () const
NamespaceDeclgetOrCreateStdNamespace ()
 Retrieve the special "std" namespace, which may require us to implicitly define the namespace.
CXXRecordDeclgetStdBadAlloc () const
EnumDeclgetStdAlignValT () const
TypeAwareAllocationMode ShouldUseTypeAwareOperatorNewOrDelete () const
FunctionDeclBuildTypeAwareUsualDelete (FunctionTemplateDecl *FnDecl, QualType AllocType, SourceLocation)
ValueDecltryLookupUnambiguousFieldDecl (RecordDecl *ClassDecl, const IdentifierInfo *MemberOrBase)
QualType CheckComparisonCategoryType (ComparisonCategoryType Kind, SourceLocation Loc, ComparisonCategoryUsage Usage)
 Lookup the specified comparison category types in the standard library, an check the VarDecls possibly returned by the operator<=> builtins for that type.
bool isStdInitializerList (QualType Ty, QualType *Element)
 Tests whether Ty is an instance of std::initializer_list and, if it is and Element is not NULL, assigns the element type to Element.
bool isStdTypeIdentity (QualType Ty, QualType *TypeArgument, const Decl **MalformedDecl=nullptr)
 Tests whether Ty is an instance of std::type_identity and, if it is and TypeArgument is not NULL, assigns the element type to Element.
QualType BuildStdInitializerList (QualType Element, SourceLocation Loc)
 Looks for the std::initializer_list template and instantiates it with Element, or emits an error if it's not found.
QualType tryBuildStdTypeIdentity (QualType Type, SourceLocation Loc)
 Looks for the std::type_identity template and instantiates it with Type, or returns a null type if type_identity has not been declared.
bool isInitListConstructor (const FunctionDecl *Ctor)
 Determine whether Ctor is an initializer-list constructor, as defined in [dcl.init.list]p2.
DeclActOnUsingDirective (Scope *CurScope, SourceLocation UsingLoc, SourceLocation NamespcLoc, CXXScopeSpec &SS, SourceLocation IdentLoc, IdentifierInfo *NamespcName, const ParsedAttributesView &AttrList)
void PushUsingDirective (Scope *S, UsingDirectiveDecl *UDir)
DeclActOnNamespaceAliasDef (Scope *CurScope, SourceLocation NamespaceLoc, SourceLocation AliasLoc, IdentifierInfo *Alias, CXXScopeSpec &SS, SourceLocation IdentLoc, IdentifierInfo *Ident)
void FilterUsingLookup (Scope *S, LookupResult &lookup)
 Remove decls we can't actually see from a lookup being used to declare shadow using decls.
void HideUsingShadowDecl (Scope *S, UsingShadowDecl *Shadow)
 Hides a using shadow declaration.
bool CheckUsingShadowDecl (BaseUsingDecl *BUD, NamedDecl *Target, const LookupResult &PreviousDecls, UsingShadowDecl *&PrevShadow)
 Determines whether to create a using shadow decl for a particular decl, given the set of decls existing prior to this using lookup.
UsingShadowDeclBuildUsingShadowDecl (Scope *S, BaseUsingDecl *BUD, NamedDecl *Target, UsingShadowDecl *PrevDecl)
 Builds a shadow declaration corresponding to a 'using' declaration.
bool CheckUsingDeclRedeclaration (SourceLocation UsingLoc, bool HasTypenameKeyword, const CXXScopeSpec &SS, SourceLocation NameLoc, const LookupResult &Previous)
 Checks that the given using declaration is not an invalid redeclaration.
bool CheckUsingDeclQualifier (SourceLocation UsingLoc, bool HasTypename, const CXXScopeSpec &SS, const DeclarationNameInfo &NameInfo, SourceLocation NameLoc, const LookupResult *R=nullptr, const UsingDecl *UD=nullptr)
 Checks that the given nested-name qualifier used in a using decl in the current context is appropriately related to the current scope.
NamedDeclBuildUsingDeclaration (Scope *S, AccessSpecifier AS, SourceLocation UsingLoc, bool HasTypenameKeyword, SourceLocation TypenameLoc, CXXScopeSpec &SS, DeclarationNameInfo NameInfo, SourceLocation EllipsisLoc, const ParsedAttributesView &AttrList, bool IsInstantiation, bool IsUsingIfExists)
 Builds a using declaration.
NamedDeclBuildUsingEnumDeclaration (Scope *S, AccessSpecifier AS, SourceLocation UsingLoc, SourceLocation EnumLoc, SourceLocation NameLoc, TypeSourceInfo *EnumType, EnumDecl *ED)
NamedDeclBuildUsingPackDecl (NamedDecl *InstantiatedFrom, ArrayRef< NamedDecl * > Expansions)
bool CheckInheritingConstructorUsingDecl (UsingDecl *UD)
 Additional checks for a using declaration referring to a constructor name.
CXXConstructorDeclfindInheritingConstructor (SourceLocation Loc, CXXConstructorDecl *BaseCtor, ConstructorUsingShadowDecl *DerivedShadow)
 Given a derived-class using shadow declaration for a constructor and the correspnding base class constructor, find or create the implicit synthesized derived class constructor to use for this initialization.
DeclActOnUsingDeclaration (Scope *CurScope, AccessSpecifier AS, SourceLocation UsingLoc, SourceLocation TypenameLoc, CXXScopeSpec &SS, UnqualifiedId &Name, SourceLocation EllipsisLoc, const ParsedAttributesView &AttrList)
DeclActOnUsingEnumDeclaration (Scope *CurScope, AccessSpecifier AS, SourceLocation UsingLoc, SourceLocation EnumLoc, SourceRange TyLoc, const IdentifierInfo &II, ParsedType Ty, const CXXScopeSpec &SS)
DeclActOnAliasDeclaration (Scope *CurScope, AccessSpecifier AS, MultiTemplateParamsArg TemplateParams, SourceLocation UsingLoc, UnqualifiedId &Name, const ParsedAttributesView &AttrList, TypeResult Type, Decl *DeclFromDeclSpec)
ExprResult BuildCXXConstructExpr (SourceLocation ConstructLoc, QualType DeclInitType, NamedDecl *FoundDecl, CXXConstructorDecl *Constructor, MultiExprArg Exprs, bool HadMultipleCandidates, bool IsListInitialization, bool IsStdInitListInitialization, bool RequiresZeroInit, CXXConstructionKind ConstructKind, SourceRange ParenRange)
 BuildCXXConstructExpr - Creates a complete call to a constructor, including handling of its default argument expressions.
ExprResult BuildCXXConstructExpr (SourceLocation ConstructLoc, QualType DeclInitType, CXXConstructorDecl *Constructor, bool Elidable, MultiExprArg Exprs, bool HadMultipleCandidates, bool IsListInitialization, bool IsStdInitListInitialization, bool RequiresZeroInit, CXXConstructionKind ConstructKind, SourceRange ParenRange)
 Build a CXXConstructExpr whose constructor has already been resolved if it denotes an inherited constructor.
ExprResult BuildCXXConstructExpr (SourceLocation ConstructLoc, QualType DeclInitType, NamedDecl *FoundDecl, CXXConstructorDecl *Constructor, bool Elidable, MultiExprArg Exprs, bool HadMultipleCandidates, bool IsListInitialization, bool IsStdInitListInitialization, bool RequiresZeroInit, CXXConstructionKind ConstructKind, SourceRange ParenRange)
ExprResult ConvertMemberDefaultInitExpression (FieldDecl *FD, Expr *InitExpr, SourceLocation InitLoc)
void FinalizeVarWithDestructor (VarDecl *VD, CXXRecordDecl *DeclInit)
 FinalizeVarWithDestructor - Prepare for calling destructor on the constructed variable.
void EvaluateImplicitExceptionSpec (SourceLocation Loc, FunctionDecl *FD)
 Evaluate the implicit exception specification for a defaulted special member function.
void checkExceptionSpecification (bool IsTopLevel, ExceptionSpecificationType EST, ArrayRef< ParsedType > DynamicExceptions, ArrayRef< SourceRange > DynamicExceptionRanges, Expr *NoexceptExpr, SmallVectorImpl< QualType > &Exceptions, FunctionProtoType::ExceptionSpecInfo &ESI)
 Check the given exception-specification and update the exception specification information with the results.
void actOnDelayedExceptionSpecification (Decl *D, ExceptionSpecificationType EST, SourceRange SpecificationRange, ArrayRef< ParsedType > DynamicExceptions, ArrayRef< SourceRange > DynamicExceptionRanges, Expr *NoexceptExpr)
 Add an exception-specification to the given member or friend function (or function template).
bool ShouldDeleteSpecialMember (CXXMethodDecl *MD, CXXSpecialMemberKind CSM, InheritedConstructorInfo *ICI=nullptr, bool Diagnose=false)
 Determine if a special member function should have a deleted definition when it is defaulted.
void DiagnoseDeletedDefaultedFunction (FunctionDecl *FD)
 Produce notes explaining why a defaulted function was defined as deleted.
CXXConstructorDeclDeclareImplicitDefaultConstructor (CXXRecordDecl *ClassDecl)
 Declare the implicit default constructor for the given class.
void DefineImplicitDefaultConstructor (SourceLocation CurrentLocation, CXXConstructorDecl *Constructor)
 DefineImplicitDefaultConstructor - Checks for feasibility of defining this constructor as the default constructor.
CXXDestructorDeclDeclareImplicitDestructor (CXXRecordDecl *ClassDecl)
 Declare the implicit destructor for the given class.
void DefineImplicitDestructor (SourceLocation CurrentLocation, CXXDestructorDecl *Destructor)
 DefineImplicitDestructor - Checks for feasibility of defining this destructor as the default destructor.
void AdjustDestructorExceptionSpec (CXXDestructorDecl *Destructor)
 Build an exception spec for destructors that don't have one.
void DefineInheritingConstructor (SourceLocation UseLoc, CXXConstructorDecl *Constructor)
 Define the specified inheriting constructor.
CXXConstructorDeclDeclareImplicitCopyConstructor (CXXRecordDecl *ClassDecl)
 Declare the implicit copy constructor for the given class.
void DefineImplicitCopyConstructor (SourceLocation CurrentLocation, CXXConstructorDecl *Constructor)
 DefineImplicitCopyConstructor - Checks for feasibility of defining this constructor as the copy constructor.
CXXConstructorDeclDeclareImplicitMoveConstructor (CXXRecordDecl *ClassDecl)
 Declare the implicit move constructor for the given class.
void DefineImplicitMoveConstructor (SourceLocation CurrentLocation, CXXConstructorDecl *Constructor)
 DefineImplicitMoveConstructor - Checks for feasibility of defining this constructor as the move constructor.
CXXMethodDeclDeclareImplicitCopyAssignment (CXXRecordDecl *ClassDecl)
 Declare the implicit copy assignment operator for the given class.
void DefineImplicitCopyAssignment (SourceLocation CurrentLocation, CXXMethodDecl *MethodDecl)
 Defines an implicitly-declared copy assignment operator.
CXXMethodDeclDeclareImplicitMoveAssignment (CXXRecordDecl *ClassDecl)
 Declare the implicit move assignment operator for the given class.
void DefineImplicitMoveAssignment (SourceLocation CurrentLocation, CXXMethodDecl *MethodDecl)
 Defines an implicitly-declared move assignment operator.
void CheckImplicitSpecialMemberDeclaration (Scope *S, FunctionDecl *FD)
 Check a completed declaration of an implicit special member.
bool isImplicitlyDeleted (FunctionDecl *FD)
 Determine whether the given function is an implicitly-deleted special member function.
bool checkThisInStaticMemberFunctionType (CXXMethodDecl *Method)
 Check whether 'this' shows up in the type of a static member function after the (naturally empty) cv-qualifier-seq would be.
bool checkThisInStaticMemberFunctionExceptionSpec (CXXMethodDecl *Method)
 Whether this' shows up in the exception specification of a static member function.
bool checkThisInStaticMemberFunctionAttributes (CXXMethodDecl *Method)
 Check whether 'this' shows up in the attributes of the given static member function.
bool CheckImmediateEscalatingFunctionDefinition (FunctionDecl *FD, const sema::FunctionScopeInfo *FSI)
void DiagnoseImmediateEscalatingReason (FunctionDecl *FD)
bool CompleteConstructorCall (CXXConstructorDecl *Constructor, QualType DeclInitType, MultiExprArg ArgsPtr, SourceLocation Loc, SmallVectorImpl< Expr * > &ConvertedArgs, bool AllowExplicit=false, bool IsListInitialization=false)
 Given a constructor and the set of arguments provided for the constructor, convert the arguments and add any required default arguments to form a proper call to this constructor.
void ActOnCXXEnterDeclInitializer (Scope *S, Decl *Dcl)
 ActOnCXXEnterDeclInitializer - Invoked when we are about to parse an initializer for the declaration 'Dcl'.
void ActOnCXXExitDeclInitializer (Scope *S, Decl *Dcl)
 ActOnCXXExitDeclInitializer - Invoked after we are finished parsing an initializer for the declaration 'Dcl'.
void DefineImplicitLambdaToFunctionPointerConversion (SourceLocation CurrentLoc, CXXConversionDecl *Conv)
 Define the "body" of the conversion from a lambda object to a function pointer.
void DefineImplicitLambdaToBlockPointerConversion (SourceLocation CurrentLoc, CXXConversionDecl *Conv)
 Define the "body" of the conversion from a lambda object to a block pointer.
DeclActOnStartLinkageSpecification (Scope *S, SourceLocation ExternLoc, Expr *LangStr, SourceLocation LBraceLoc)
 ActOnStartLinkageSpecification - Parsed the beginning of a C++ linkage specification, including the language and (if present) the '{'.
DeclActOnFinishLinkageSpecification (Scope *S, Decl *LinkageSpec, SourceLocation RBraceLoc)
 ActOnFinishLinkageSpecification - Complete the definition of the C++ linkage specification LinkageSpec.
CXXRecordDeclgetCurrentClass (Scope *S, const CXXScopeSpec *SS)
 Get the class that is directly named by the current context.
bool isCurrentClassName (const IdentifierInfo &II, Scope *S, const CXXScopeSpec *SS=nullptr)
 isCurrentClassName - Determine whether the identifier II is the name of the class type currently being defined.
bool isCurrentClassNameTypo (IdentifierInfo *&II, const CXXScopeSpec *SS)
 Determine whether the identifier II is a typo for the name of the class type currently being defined.
bool ActOnAccessSpecifier (AccessSpecifier Access, SourceLocation ASLoc, SourceLocation ColonLoc, const ParsedAttributesView &Attrs)
 ActOnAccessSpecifier - Parsed an access specifier followed by a colon.
NamedDeclActOnCXXMemberDeclarator (Scope *S, AccessSpecifier AS, Declarator &D, MultiTemplateParamsArg TemplateParameterLists, Expr *BitfieldWidth, const VirtSpecifiers &VS, InClassInitStyle InitStyle)
 ActOnCXXMemberDeclarator - This is invoked when a C++ class member declarator is parsed.
void ActOnStartCXXInClassMemberInitializer ()
 Enter a new C++ default initializer scope.
void ActOnFinishCXXInClassMemberInitializer (Decl *VarDecl, SourceLocation EqualLoc, ExprResult Init)
 This is invoked after parsing an in-class initializer for a non-static C++ class member, and after instantiating an in-class initializer in a class template.
MemInitResult ActOnMemInitializer (Decl *ConstructorD, Scope *S, CXXScopeSpec &SS, IdentifierInfo *MemberOrBase, ParsedType TemplateTypeTy, const DeclSpec &DS, SourceLocation IdLoc, SourceLocation LParenLoc, ArrayRef< Expr * > Args, SourceLocation RParenLoc, SourceLocation EllipsisLoc)
 Handle a C++ member initializer using parentheses syntax.
MemInitResult ActOnMemInitializer (Decl *ConstructorD, Scope *S, CXXScopeSpec &SS, IdentifierInfo *MemberOrBase, ParsedType TemplateTypeTy, const DeclSpec &DS, SourceLocation IdLoc, Expr *InitList, SourceLocation EllipsisLoc)
 Handle a C++ member initializer using braced-init-list syntax.
MemInitResult BuildMemInitializer (Decl *ConstructorD, Scope *S, CXXScopeSpec &SS, IdentifierInfo *MemberOrBase, ParsedType TemplateTypeTy, const DeclSpec &DS, SourceLocation IdLoc, Expr *Init, SourceLocation EllipsisLoc)
 Handle a C++ member initializer.
MemInitResult BuildMemberInitializer (ValueDecl *Member, Expr *Init, SourceLocation IdLoc)
MemInitResult BuildBaseInitializer (QualType BaseType, TypeSourceInfo *BaseTInfo, Expr *Init, CXXRecordDecl *ClassDecl, SourceLocation EllipsisLoc)
MemInitResult BuildDelegatingInitializer (TypeSourceInfo *TInfo, Expr *Init, CXXRecordDecl *ClassDecl)
bool SetDelegatingInitializer (CXXConstructorDecl *Constructor, CXXCtorInitializer *Initializer)
bool SetCtorInitializers (CXXConstructorDecl *Constructor, bool AnyErrors, ArrayRef< CXXCtorInitializer * > Initializers={})
void MarkBaseAndMemberDestructorsReferenced (SourceLocation Loc, CXXRecordDecl *Record)
 MarkBaseAndMemberDestructorsReferenced - Given a record decl, mark all the non-trivial destructors of its members and bases as referenced.
void MarkVirtualBaseDestructorsReferenced (SourceLocation Location, CXXRecordDecl *ClassDecl, llvm::SmallPtrSetImpl< const CXXRecordDecl * > *DirectVirtualBases=nullptr)
 Mark destructors of virtual bases of this class referenced.
void CheckCompleteDestructorVariant (SourceLocation CurrentLocation, CXXDestructorDecl *Dtor)
 Do semantic checks to allow the complete destructor variant to be emitted when the destructor is defined in another translation unit.
void LoadExternalVTableUses ()
 Load any externally-stored vtable uses.
void MarkVTableUsed (SourceLocation Loc, CXXRecordDecl *Class, bool DefinitionRequired=false)
 Note that the vtable for the given class was used at the given location.
void MarkVirtualMemberExceptionSpecsNeeded (SourceLocation Loc, const CXXRecordDecl *RD)
 Mark the exception specifications of all virtual member functions in the given class as needed.
void MarkVirtualMembersReferenced (SourceLocation Loc, const CXXRecordDecl *RD, bool ConstexprOnly=false)
 MarkVirtualMembersReferenced - Will mark all members of the given CXXRecordDecl referenced.
bool DefineUsedVTables ()
 Define all of the vtables that have been used in this translation unit and reference any virtual members used by those vtables.
void AddImplicitlyDeclaredMembersToClass (CXXRecordDecl *ClassDecl)
 AddImplicitlyDeclaredMembersToClass - Adds any implicitly-declared special functions, such as the default constructor, copy constructor, or destructor, to the given C++ class (C++ [special]p1).
void ActOnMemInitializers (Decl *ConstructorDecl, SourceLocation ColonLoc, ArrayRef< CXXCtorInitializer * > MemInits, bool AnyErrors)
 ActOnMemInitializers - Handle the member initializers for a constructor.
void checkClassLevelDLLAttribute (CXXRecordDecl *Class)
 Check class-level dllimport/dllexport attribute.
void checkClassLevelCodeSegAttribute (CXXRecordDecl *Class)
void referenceDLLExportedClassMethods ()
void propagateDLLAttrToBaseClassTemplate (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.
void CheckCompletedCXXClass (Scope *S, CXXRecordDecl *Record)
 Perform semantic checks on a class definition that has been completing, introducing implicitly-declared members, checking for abstract types, etc.
void checkIllFormedTrivialABIStruct (CXXRecordDecl &RD)
 Check that the C++ class annoated with "trivial_abi" satisfies all the conditions that are needed for the attribute to have an effect.
void checkIncorrectVTablePointerAuthenticationAttribute (CXXRecordDecl &RD)
 Check that VTable Pointer authentication is only being set on the first first instantiation of the vtable.
void ActOnFinishCXXMemberSpecification (Scope *S, SourceLocation RLoc, Decl *TagDecl, SourceLocation LBrac, SourceLocation RBrac, const ParsedAttributesView &AttrList)
void ActOnFinishCXXMemberDecls ()
 Perform any semantic analysis which needs to be delayed until all pending class member declarations have been parsed.
void ActOnFinishCXXNonNestedClass ()
void ActOnReenterCXXMethodParameter (Scope *S, ParmVarDecl *Param)
 This is used to implement the constant expression evaluation part of the attribute enable_if extension.
unsigned ActOnReenterTemplateScope (Decl *Template, llvm::function_ref< Scope *()> EnterScope)
void ActOnStartDelayedMemberDeclarations (Scope *S, Decl *Record)
void ActOnStartDelayedCXXMethodDeclaration (Scope *S, Decl *Method)
 ActOnStartDelayedCXXMethodDeclaration - We have completed parsing a top-level (non-nested) C++ class, and we are now parsing those parts of the given Method declaration that could not be parsed earlier (C++ [class.mem]p2), such as default arguments.
void ActOnDelayedCXXMethodParameter (Scope *S, Decl *Param)
 ActOnDelayedCXXMethodParameter - We've already started a delayed C++ method declaration.
void ActOnFinishDelayedMemberDeclarations (Scope *S, Decl *Record)
void ActOnFinishDelayedCXXMethodDeclaration (Scope *S, Decl *Method)
 ActOnFinishDelayedCXXMethodDeclaration - We have finished processing the delayed method declaration for Method.
void ActOnFinishDelayedMemberInitializers (Decl *Record)
bool EvaluateAsString (Expr *Message, APValue &Result, ASTContext &Ctx, StringEvaluationContext EvalContext, bool ErrorOnInvalidMessage)
bool EvaluateAsString (Expr *Message, std::string &Result, ASTContext &Ctx, StringEvaluationContext EvalContext, bool ErrorOnInvalidMessage)
DeclActOnStaticAssertDeclaration (SourceLocation StaticAssertLoc, Expr *AssertExpr, Expr *AssertMessageExpr, SourceLocation RParenLoc)
DeclBuildStaticAssertDeclaration (SourceLocation StaticAssertLoc, Expr *AssertExpr, Expr *AssertMessageExpr, SourceLocation RParenLoc, bool Failed)
void DiagnoseStaticAssertDetails (const Expr *E)
 Try to print more useful information about a failed static_assert with expression \E.
void DiagnoseTypeTraitDetails (const Expr *E)
 If E represents a built-in type trait, or a known standard type trait, try to print more information about why the type type-trait failed.
DeclActOnFriendTypeDecl (Scope *S, const DeclSpec &DS, MultiTemplateParamsArg TemplateParams, SourceLocation EllipsisLoc)
 Handle a friend type declaration.
NamedDeclActOnFriendFunctionDecl (Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParams)
QualType CheckConstructorDeclarator (Declarator &D, QualType R, StorageClass &SC)
 CheckConstructorDeclarator - Called by ActOnDeclarator to check the well-formedness of the constructor declarator D with type R.
void CheckConstructor (CXXConstructorDecl *Constructor)
 CheckConstructor - Checks a fully-formed constructor for well-formedness, issuing any diagnostics required.
QualType CheckDestructorDeclarator (Declarator &D, QualType R, StorageClass &SC)
 CheckDestructorDeclarator - Called by ActOnDeclarator to check the well-formednes of the destructor declarator D with type R.
bool CheckDestructor (CXXDestructorDecl *Destructor)
 CheckDestructor - Checks a fully-formed destructor definition for well-formedness, issuing any diagnostics required.
void CheckConversionDeclarator (Declarator &D, QualType &R, StorageClass &SC)
 CheckConversionDeclarator - Called by ActOnDeclarator to check the well-formednes of the conversion function declarator D with type R.
DeclActOnConversionDeclarator (CXXConversionDecl *Conversion)
 ActOnConversionDeclarator - Called by ActOnDeclarator to complete the declaration of the given C++ conversion function.
bool CheckDeductionGuideDeclarator (Declarator &D, QualType &R, StorageClass &SC)
 Check the validity of a declarator that we parsed for a deduction-guide.
void CheckExplicitlyDefaultedFunction (Scope *S, FunctionDecl *MD)
bool CheckExplicitlyDefaultedSpecialMember (CXXMethodDecl *MD, CXXSpecialMemberKind CSM, SourceLocation DefaultLoc)
void CheckDelayedMemberExceptionSpecs ()
bool CheckExplicitlyDefaultedComparison (Scope *S, FunctionDecl *MD, DefaultedComparisonKind DCK)
void DeclareImplicitEqualityComparison (CXXRecordDecl *RD, FunctionDecl *Spaceship)
void DefineDefaultedComparison (SourceLocation Loc, FunctionDecl *FD, DefaultedComparisonKind DCK)
void CheckExplicitObjectMemberFunction (Declarator &D, DeclarationName Name, QualType R, bool IsLambda, DeclContext *DC=nullptr)
void CheckExplicitObjectMemberFunction (DeclContext *DC, Declarator &D, DeclarationName Name, QualType R)
void CheckExplicitObjectLambda (Declarator &D)
CXXBaseSpecifierCheckBaseSpecifier (CXXRecordDecl *Class, SourceRange SpecifierRange, bool Virtual, AccessSpecifier Access, TypeSourceInfo *TInfo, SourceLocation EllipsisLoc)
 Check the validity of a C++ base class specifier.
BaseResult ActOnBaseSpecifier (Decl *classdecl, SourceRange SpecifierRange, const ParsedAttributesView &Attrs, bool Virtual, AccessSpecifier Access, ParsedType basetype, SourceLocation BaseLoc, SourceLocation EllipsisLoc)
 ActOnBaseSpecifier - Parsed a base specifier.
bool AttachBaseSpecifiers (CXXRecordDecl *Class, MutableArrayRef< CXXBaseSpecifier * > Bases)
 Performs the actual work of attaching the given base class specifiers to a C++ class.
void ActOnBaseSpecifiers (Decl *ClassDecl, MutableArrayRef< CXXBaseSpecifier * > Bases)
 ActOnBaseSpecifiers - Attach the given base specifiers to the class, after checking whether there are any duplicate base classes.
bool IsDerivedFrom (SourceLocation Loc, CXXRecordDecl *Derived, CXXRecordDecl *Base, CXXBasePaths &Paths)
 Determine whether the type Derived is a C++ class that is derived from the type Base.
bool IsDerivedFrom (SourceLocation Loc, CXXRecordDecl *Derived, CXXRecordDecl *Base)
bool IsDerivedFrom (SourceLocation Loc, QualType Derived, QualType Base)
bool IsDerivedFrom (SourceLocation Loc, QualType Derived, QualType Base, CXXBasePaths &Paths)
void BuildBasePathArray (const CXXBasePaths &Paths, CXXCastPath &BasePath)
bool CheckDerivedToBaseConversion (QualType Derived, QualType Base, SourceLocation Loc, SourceRange Range, CXXCastPath *BasePath=nullptr, bool IgnoreAccess=false)
bool CheckDerivedToBaseConversion (QualType Derived, QualType Base, unsigned InaccessibleBaseID, unsigned AmbiguousBaseConvID, SourceLocation Loc, SourceRange Range, DeclarationName Name, CXXCastPath *BasePath, bool IgnoreAccess=false)
 CheckDerivedToBaseConversion - Check whether the Derived-to-Base conversion (where Derived and Base are class types) is well-formed, meaning that the conversion is unambiguous (and that all of the base classes are accessible).
std::string getAmbiguousPathsDisplayString (CXXBasePaths &Paths)
 Builds a string representing ambiguous paths from a specific derived class to different subobjects of the same base class.
bool CheckOverridingFunctionAttributes (CXXMethodDecl *New, const CXXMethodDecl *Old)
bool CheckOverridingFunctionReturnType (const CXXMethodDecl *New, const CXXMethodDecl *Old)
 CheckOverridingFunctionReturnType - Checks whether the return types are covariant, according to C++ [class.virtual]p5.
bool CheckExplicitObjectOverride (CXXMethodDecl *New, const CXXMethodDecl *Old)
bool CheckPureMethod (CXXMethodDecl *Method, SourceRange InitRange)
 Mark the given method pure.
void CheckOverrideControl (NamedDecl *D)
 CheckOverrideControl - Check C++11 override control semantics.
void DiagnoseAbsenceOfOverrideControl (NamedDecl *D, bool Inconsistent)
 DiagnoseAbsenceOfOverrideControl - Diagnose if 'override' keyword was not used in the declaration of an overriding method.
bool CheckIfOverriddenFunctionIsMarkedFinal (const CXXMethodDecl *New, const CXXMethodDecl *Old)
 CheckIfOverriddenFunctionIsMarkedFinal - Checks whether a virtual member function overrides a virtual member function marked 'final', according to C++11 [class.virtual]p4.
bool isAbstractType (SourceLocation Loc, QualType T)
bool RequireNonAbstractType (SourceLocation Loc, QualType T, TypeDiagnoser &Diagnoser)
template<typename... Ts>
bool RequireNonAbstractType (SourceLocation Loc, QualType T, unsigned DiagID, const Ts &...Args)
void DiagnoseAbstractType (const CXXRecordDecl *RD)
bool CheckOverloadedOperatorDeclaration (FunctionDecl *FnDecl)
 CheckOverloadedOperatorDeclaration - Check whether the declaration of this overloaded operator is well-formed.
bool CheckLiteralOperatorDeclaration (FunctionDecl *FnDecl)
 CheckLiteralOperatorDeclaration - Check whether the declaration of this literal operator function is well-formed.
ExplicitSpecifier ActOnExplicitBoolSpecifier (Expr *E)
 ActOnExplicitBoolSpecifier - Build an ExplicitSpecifier from an expression found in an explicit(bool) specifier.
bool tryResolveExplicitSpecifier (ExplicitSpecifier &ExplicitSpec)
 tryResolveExplicitSpecifier - Attempt to resolve the explict specifier.
DeclResult ActOnCXXConditionDeclaration (Scope *S, Declarator &D)
 ActOnCXXConditionDeclarationExpr - Parsed a condition declaration of a C++ if/switch/while/for statement.
void MergeVarDeclExceptionSpecs (VarDecl *New, VarDecl *Old)
 Merge the exception specifications of two variable declarations.
bool MergeCXXFunctionDecl (FunctionDecl *New, FunctionDecl *Old, Scope *S)
 MergeCXXFunctionDecl - Merge two declarations of the same C++ function, once we already know that they have the same type.
void CheckCXXDefaultArguments (FunctionDecl *FD)
 Helpers for dealing with blocks and functions.
void CheckExtraCXXDefaultArguments (Declarator &D)
 CheckExtraCXXDefaultArguments - Check for any extra default arguments in the declarator, which is not a function declaration or definition and therefore is not permitted to have default arguments.
CXXSpecialMemberKind getSpecialMember (const CXXMethodDecl *MD)
VarDeclBuildExceptionDeclaration (Scope *S, TypeSourceInfo *TInfo, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id)
 Perform semantic analysis for the variable declaration that occurs within a C++ catch clause, returning the newly-created variable.
DeclActOnExceptionDeclarator (Scope *S, Declarator &D)
 ActOnExceptionDeclarator - Parsed the exception-declarator in a C++ catch handler.
void DiagnoseReturnInConstructorExceptionHandler (CXXTryStmt *TryBlock)
DeclResult ActOnTemplatedFriendTag (Scope *S, SourceLocation FriendLoc, unsigned TagSpec, SourceLocation TagLoc, CXXScopeSpec &SS, IdentifierInfo *Name, SourceLocation NameLoc, SourceLocation EllipsisLoc, const ParsedAttributesView &Attr, MultiTemplateParamsArg TempParamLists)
 Handle a friend tag declaration where the scope specifier was templated.
MSPropertyDeclHandleMSProperty (Scope *S, RecordDecl *TagD, SourceLocation DeclStart, Declarator &D, Expr *BitfieldWidth, InClassInitStyle InitStyle, AccessSpecifier AS, const ParsedAttr &MSPropertyAttr)
 HandleMSProperty - Analyze a __delcspec(property) field of a C++ class.
void DiagnoseNontrivial (const CXXRecordDecl *Record, CXXSpecialMemberKind CSM)
 Diagnose why the specified class does not have a trivial special member of the given kind.
bool SpecialMemberIsTrivial (CXXMethodDecl *MD, CXXSpecialMemberKind CSM, TrivialABIHandling TAH=TrivialABIHandling::IgnoreTrivialABI, bool Diagnose=false)
 Determine whether a defaulted or deleted special member function is trivial, as specified in C++11 [class.ctor]p5, C++11 [class.copy]p12, C++11 [class.copy]p25, and C++11 [class.dtor]p5.
DefaultedFunctionKind getDefaultedFunctionKind (const FunctionDecl *FD)
 Determine the kind of defaulting that would be done for a given function.
DeclActOnEmptyDeclaration (Scope *S, const ParsedAttributesView &AttrList, SourceLocation SemiLoc)
 Handle a C++11 empty-declaration and attribute-declaration.
bool CheckConstexprFunctionDefinition (const FunctionDecl *FD, CheckConstexprKind Kind)
void DiagnoseHiddenVirtualMethods (CXXMethodDecl *MD)
 Diagnose methods which overload virtual methods in a base class without overriding any.
void FindHiddenVirtualMethods (CXXMethodDecl *MD, SmallVectorImpl< CXXMethodDecl * > &OverloadedMethods)
 Check if a method overloads virtual methods in a base class without overriding any.
void NoteHiddenVirtualMethods (CXXMethodDecl *MD, SmallVectorImpl< CXXMethodDecl * > &OverloadedMethods)
void ActOnParamDefaultArgument (Decl *param, SourceLocation EqualLoc, Expr *defarg)
 ActOnParamDefaultArgument - Check whether the default argument provided for a function parameter is well-formed.
void ActOnParamUnparsedDefaultArgument (Decl *param, SourceLocation EqualLoc, SourceLocation ArgLoc)
 ActOnParamUnparsedDefaultArgument - We've seen a default argument for a function parameter, but we can't parse it yet because we're inside a class definition.
void ActOnParamDefaultArgumentError (Decl *param, SourceLocation EqualLoc, Expr *DefaultArg)
 ActOnParamDefaultArgumentError - Parsing or semantic analysis of the default argument for the parameter param failed.
ExprResult ConvertParamDefaultArgument (ParmVarDecl *Param, Expr *DefaultArg, SourceLocation EqualLoc)
void SetParamDefaultArgument (ParmVarDecl *Param, Expr *DefaultArg, SourceLocation EqualLoc)
void ActOnPureSpecifier (Decl *D, SourceLocation PureSpecLoc)
void SetDeclDeleted (Decl *dcl, SourceLocation DelLoc, StringLiteral *Message=nullptr)
void SetDeclDefaulted (Decl *dcl, SourceLocation DefaultLoc)
void SetFunctionBodyKind (Decl *D, SourceLocation Loc, FnBodyKind BodyKind, StringLiteral *DeletedMessage=nullptr)
void ActOnStartTrailingRequiresClause (Scope *S, Declarator &D)
ExprResult ActOnFinishTrailingRequiresClause (ExprResult ConstraintExpr)
ExprResult ActOnRequiresClause (ExprResult ConstraintExpr)
NamedDeclActOnDecompositionDeclarator (Scope *S, Declarator &D, MultiTemplateParamsArg TemplateParamLists)
void DiagPlaceholderVariableDefinition (SourceLocation Loc)
bool DiagRedefinedPlaceholderFieldDecl (SourceLocation Loc, RecordDecl *ClassDecl, const IdentifierInfo *Name)
UnsignedOrNone GetDecompositionElementCount (QualType DecompType, SourceLocation Loc)
void CheckCompleteDecompositionDeclaration (DecompositionDecl *DD)
void NoteDeletedInheritingConstructor (CXXConstructorDecl *CD)
void ActOnDefaultCtorInitializers (Decl *CDtorDecl)
ParsingClassState PushParsingClass ()
void PopParsingClass (ParsingClassState state)
ValueDecltryLookupCtorInitMemberDecl (CXXRecordDecl *ClassDecl, CXXScopeSpec &SS, ParsedType TemplateTypeTy, IdentifierInfo *MemberOrBase)

Expressions

Implementations are in SemaExpr.cpp

enum class  ExpressionEvaluationContext {
  Unevaluated , UnevaluatedList , DiscardedStatement , UnevaluatedAbstract ,
  ConstantEvaluated , ImmediateFunctionContext , PotentiallyEvaluated , PotentiallyEvaluatedIfUsed
}
 Describes how the expressions currently being parsed are evaluated at run-time, if at all. More...
enum  ReuseLambdaContextDecl_t { ReuseLambdaContextDecl }
enum class  ConditionKind { Boolean , ConstexprIf , Switch }
using MaybeODRUseExprSet = llvm::SmallSetVector<Expr *, 4>
 Store a set of either DeclRefExprs or MemberExprs that contain a reference to a variable (constant) that may or may not be odr-used in this Expr, and we won't know until all lvalue-to-rvalue and discarded value conversions have been applied to all subexpressions of the enclosing full expression.
using ImmediateInvocationCandidate = llvm::PointerIntPair<ConstantExpr *, 1>
using ADLCallKind = CallExpr::ADLCallKind
MaybeODRUseExprSet MaybeODRUseExprs
llvm::DenseMap< const VarDecl *, intRefsMinusAssignments
 Increment when we find a reference; decrement when we find an ignored assignment.
CleanupInfo Cleanup
 Used to control the generation of ExprWithCleanups.
SmallVector< ExprWithCleanups::CleanupObject, 8 > ExprCleanupObjects
 ExprCleanupObjects - This is the stack of objects requiring cleanup that are created by the current full expression.
bool RebuildingImmediateInvocation = false
 Whether the AST is currently being rebuilt to correct immediate invocations.
RecordDeclStdSourceLocationImplDecl
 The C++ "std::source_location::__impl" struct, defined in <source_location>.
SmallVector< ExpressionEvaluationContextRecord, 8 > ExprEvalContexts
 A stack of expression evaluation contexts.
llvm::SmallPtrSet< ConstantExpr *, 4 > FailedImmediateInvocations
llvm::SmallVector< std::pair< SourceLocation, const BlockDecl * >, 1 > ImplicitlyRetainedSelfLocs
 List of SourceLocations where 'self' is implicitly retained inside a block.
std::vector< std::pair< QualType, unsigned > > ExcessPrecisionNotSatisfied
SourceLocation LocationOfExcessPrecisionNotSatisfied
const ExpressionEvaluationContextRecordcurrentEvaluationContext () const
ExpressionEvaluationContextRecordcurrentEvaluationContext ()
ExpressionEvaluationContextRecordparentEvaluationContext ()
const ExpressionEvaluationContextRecordparentEvaluationContext () const
bool isAttrContext () const
bool CanUseDecl (NamedDecl *D, bool TreatUnavailableAsInvalid)
 Determine whether the use of this declaration is valid, without emitting diagnostics.
bool DiagnoseUseOfOverloadedDecl (NamedDecl *D, SourceLocation Loc)
bool DiagnoseUseOfDecl (NamedDecl *D, ArrayRef< SourceLocation > Locs, const ObjCInterfaceDecl *UnknownObjCClass=nullptr, bool ObjCPropertyAccess=false, bool AvoidPartialAvailabilityChecks=false, ObjCInterfaceDecl *ClassReceiver=nullptr, bool SkipTrailingRequiresClause=false)
 Determine whether the use of this declaration is valid, and emit any corresponding diagnostics.
void NoteDeletedFunction (FunctionDecl *FD)
 Emit a note explaining that this function is deleted.
void DiagnoseSentinelCalls (const NamedDecl *D, SourceLocation Loc, ArrayRef< Expr * > Args)
 DiagnoseSentinelCalls - This routine checks whether a call or message-send is to a declaration with the sentinel attribute, and if so, it checks that the requirements of the sentinel are satisfied.
void PushExpressionEvaluationContext (ExpressionEvaluationContext NewContext, Decl *LambdaContextDecl=nullptr, ExpressionEvaluationContextRecord::ExpressionKind Type=ExpressionEvaluationContextRecord::EK_Other)
void PushExpressionEvaluationContextForFunction (ExpressionEvaluationContext NewContext, FunctionDecl *FD)
void PushExpressionEvaluationContext (ExpressionEvaluationContext NewContext, ReuseLambdaContextDecl_t, ExpressionEvaluationContextRecord::ExpressionKind Type=ExpressionEvaluationContextRecord::EK_Other)
void PopExpressionEvaluationContext ()
void DiscardCleanupsInEvaluationContext ()
ExprResult TransformToPotentiallyEvaluated (Expr *E)
TypeSourceInfoTransformToPotentiallyEvaluated (TypeSourceInfo *TInfo)
ExprResult HandleExprEvaluationContextForTypeof (Expr *E)
void CheckUnusedVolatileAssignment (Expr *E)
 Check whether E, which is either a discarded-value expression or an unevaluated operand, is a simple-assignment to a volatlie-qualified lvalue, and if so, remove it from the list of volatile-qualified assignments that we are going to warn are deprecated.
ExprResult ActOnConstantExpression (ExprResult Res)
void MarkAnyDeclReferenced (SourceLocation Loc, Decl *D, bool MightBeOdrUse)
 Perform marking for a reference to an arbitrary declaration.
void MarkFunctionReferenced (SourceLocation Loc, FunctionDecl *Func, bool MightBeOdrUse=true)
 Mark a function referenced, and check whether it is odr-used (C++ [basic.def.odr]p2, C99 6.9p3)
void MarkVariableReferenced (SourceLocation Loc, VarDecl *Var)
 Mark a variable referenced, and check whether it is odr-used (C++ [basic.def.odr]p2, C99 6.9p3).
void MarkDeclRefReferenced (DeclRefExpr *E, const Expr *Base=nullptr)
 Perform reference-marking and odr-use handling for a DeclRefExpr.
void MarkMemberReferenced (MemberExpr *E)
 Perform reference-marking and odr-use handling for a MemberExpr.
void MarkFunctionParmPackReferenced (FunctionParmPackExpr *E)
 Perform reference-marking and odr-use handling for a FunctionParmPackExpr.
void MarkCaptureUsedInEnclosingContext (ValueDecl *Capture, SourceLocation Loc, unsigned CapturingScopeIndex)
ExprResult CheckLValueToRValueConversionOperand (Expr *E)
void CleanupVarDeclMarking ()
bool tryCaptureVariable (ValueDecl *Var, SourceLocation Loc, TryCaptureKind Kind, SourceLocation EllipsisLoc, bool BuildAndDiagnose, QualType &CaptureType, QualType &DeclRefType, const unsigned *const FunctionScopeIndexToStopAt)
 Try to capture the given variable.
bool tryCaptureVariable (ValueDecl *Var, SourceLocation Loc, TryCaptureKind Kind=TryCaptureKind::Implicit, SourceLocation EllipsisLoc=SourceLocation())
 Try to capture the given variable.
bool NeedToCaptureVariable (ValueDecl *Var, SourceLocation Loc)
 Checks if the variable must be captured.
QualType getCapturedDeclRefType (ValueDecl *Var, SourceLocation Loc)
 Given a variable, determine the type that a reference to that variable will have in the given scope.
void MarkDeclarationsReferencedInType (SourceLocation Loc, QualType T)
 Mark all of the declarations referenced within a particular AST node as referenced.
void MarkDeclarationsReferencedInExpr (Expr *E, bool SkipLocalVariables=false, ArrayRef< const Expr * > StopAt={})
 Mark any declarations that appear within this expression or any potentially-evaluated subexpressions as "referenced".
ExprResult tryConvertExprToType (Expr *E, QualType Ty)
 Try to convert an expression E to type Ty.
bool DiagIfReachable (SourceLocation Loc, ArrayRef< const Stmt * > Stmts, const PartialDiagnostic &PD)
 Conditionally issue a diagnostic based on the statements's reachability analysis.
bool DiagRuntimeBehavior (SourceLocation Loc, const Stmt *Statement, const PartialDiagnostic &PD)
 Conditionally issue a diagnostic based on the current evaluation context.
bool DiagRuntimeBehavior (SourceLocation Loc, ArrayRef< const Stmt * > Stmts, const PartialDiagnostic &PD)
 Similar, but diagnostic is only produced if all the specified statements are reachable.
SourceRange getExprRange (Expr *E) const
ExprResult ActOnIdExpression (Scope *S, CXXScopeSpec &SS, SourceLocation TemplateKWLoc, UnqualifiedId &Id, bool HasTrailingLParen, bool IsAddressOfOperand, CorrectionCandidateCallback *CCC=nullptr, bool IsInlineAsmIdentifier=false, Token *KeywordReplacement=nullptr)
void DecomposeUnqualifiedId (const UnqualifiedId &Id, TemplateArgumentListInfo &Buffer, DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *&TemplateArgs)
 Decomposes the given name into a DeclarationNameInfo, its location, and possibly a list of template arguments.
bool DiagnoseDependentMemberLookup (const LookupResult &R)
 Diagnose a lookup that found results in an enclosing class during error recovery.
bool DiagnoseEmptyLookup (Scope *S, CXXScopeSpec &SS, LookupResult &R, CorrectionCandidateCallback &CCC, TemplateArgumentListInfo *ExplicitTemplateArgs=nullptr, ArrayRef< Expr * > Args={}, DeclContext *LookupCtx=nullptr)
 Diagnose an empty lookup.
NonOdrUseReason getNonOdrUseReasonInCurrentContext (ValueDecl *D)
 If D cannot be odr-used in the current expression evaluation context, return a reason explaining why.
DeclRefExprBuildDeclRefExpr (ValueDecl *D, QualType Ty, ExprValueKind VK, SourceLocation Loc, const CXXScopeSpec *SS=nullptr)
DeclRefExprBuildDeclRefExpr (ValueDecl *D, QualType Ty, ExprValueKind VK, const DeclarationNameInfo &NameInfo, const CXXScopeSpec *SS=nullptr, NamedDecl *FoundD=nullptr, SourceLocation TemplateKWLoc=SourceLocation(), const TemplateArgumentListInfo *TemplateArgs=nullptr)
DeclRefExprBuildDeclRefExpr (ValueDecl *D, QualType Ty, ExprValueKind VK, const DeclarationNameInfo &NameInfo, NestedNameSpecifierLoc NNS, NamedDecl *FoundD=nullptr, SourceLocation TemplateKWLoc=SourceLocation(), const TemplateArgumentListInfo *TemplateArgs=nullptr)
 BuildDeclRefExpr - Build an expression that references a declaration that does not require a closure capture.
bool UseArgumentDependentLookup (const CXXScopeSpec &SS, const LookupResult &R, bool HasTrailingLParen)
ExprResult BuildQualifiedDeclarationNameExpr (CXXScopeSpec &SS, const DeclarationNameInfo &NameInfo, bool IsAddressOfOperand, TypeSourceInfo **RecoveryTSI=nullptr)
 BuildQualifiedDeclarationNameExpr - Build a C++ qualified declaration name, generally during template instantiation.
ExprResult BuildDeclarationNameExpr (const CXXScopeSpec &SS, LookupResult &R, bool NeedsADL, bool AcceptInvalidDecl=false)
ExprResult BuildDeclarationNameExpr (const CXXScopeSpec &SS, const DeclarationNameInfo &NameInfo, NamedDecl *D, NamedDecl *FoundD=nullptr, const TemplateArgumentListInfo *TemplateArgs=nullptr, bool AcceptInvalidDecl=false)
 Complete semantic analysis for a reference to the given declaration.
std::vector< TokenExpandFunctionLocalPredefinedMacros (ArrayRef< Token > Toks)
ExprResult BuildPredefinedExpr (SourceLocation Loc, PredefinedIdentKind IK)
ExprResult ActOnPredefinedExpr (SourceLocation Loc, tok::TokenKind Kind)
ExprResult ActOnIntegerConstant (SourceLocation Loc, int64_t Val)
bool CheckLoopHintExpr (Expr *E, SourceLocation Loc, bool AllowZero)
ExprResult ActOnNumericConstant (const Token &Tok, Scope *UDLScope=nullptr)
ExprResult ActOnCharacterConstant (const Token &Tok, Scope *UDLScope=nullptr)
ExprResult ActOnParenExpr (SourceLocation L, SourceLocation R, Expr *E)
ExprResult ActOnParenListExpr (SourceLocation L, SourceLocation R, MultiExprArg Val)
ExprResult ActOnCXXParenListInitExpr (ArrayRef< Expr * > Args, QualType T, unsigned NumUserSpecifiedExprs, SourceLocation InitLoc, SourceLocation LParenLoc, SourceLocation RParenLoc)
ExprResult ActOnStringLiteral (ArrayRef< Token > StringToks, Scope *UDLScope=nullptr)
 ActOnStringLiteral - The specified tokens were lexed as pasted string fragments (e.g.
ExprResult ActOnUnevaluatedStringLiteral (ArrayRef< Token > StringToks)
ExprResult ActOnGenericSelectionExpr (SourceLocation KeyLoc, SourceLocation DefaultLoc, SourceLocation RParenLoc, bool PredicateIsExpr, void *ControllingExprOrType, ArrayRef< ParsedType > ArgTypes, ArrayRef< Expr * > ArgExprs)
 ControllingExprOrType is either an opaque pointer coming out of a ParsedType or an Expr *.
ExprResult CreateGenericSelectionExpr (SourceLocation KeyLoc, SourceLocation DefaultLoc, SourceLocation RParenLoc, bool PredicateIsExpr, void *ControllingExprOrType, ArrayRef< TypeSourceInfo * > Types, ArrayRef< Expr * > Exprs)
 ControllingExprOrType is either a TypeSourceInfo * or an Expr *.
ExprResult CreateBuiltinUnaryOp (SourceLocation OpLoc, UnaryOperatorKind Opc, Expr *InputExpr, bool IsAfterAmp=false)
ExprResult BuildUnaryOp (Scope *S, SourceLocation OpLoc, UnaryOperatorKind Opc, Expr *Input, bool IsAfterAmp=false)
ExprResult ActOnUnaryOp (Scope *S, SourceLocation OpLoc, tok::TokenKind Op, Expr *Input, bool IsAfterAmp=false)
 Unary Operators. 'Tok' is the token for the operator.
bool isQualifiedMemberAccess (Expr *E)
 Determine whether the given expression is a qualified member access expression, of a form that could be turned into a pointer to member with the address-of operator.
bool CheckUseOfCXXMethodAsAddressOfOperand (SourceLocation OpLoc, const Expr *Op, const CXXMethodDecl *MD)
QualType CheckAddressOfOperand (ExprResult &Operand, SourceLocation OpLoc)
 CheckAddressOfOperand - The operand of & must be either a function designator or an lvalue designating an object.
bool ActOnAlignasTypeArgument (StringRef KWName, ParsedType Ty, SourceLocation OpLoc, SourceRange R)
 ActOnAlignasTypeArgument - Handle alignas(type-id) and _Alignas(type-name) .
bool CheckAlignasTypeArgument (StringRef KWName, TypeSourceInfo *TInfo, SourceLocation OpLoc, SourceRange R)
ExprResult CreateUnaryExprOrTypeTraitExpr (TypeSourceInfo *TInfo, SourceLocation OpLoc, UnaryExprOrTypeTrait ExprKind, SourceRange R)
 Build a sizeof or alignof expression given a type operand.
ExprResult CreateUnaryExprOrTypeTraitExpr (Expr *E, SourceLocation OpLoc, UnaryExprOrTypeTrait ExprKind)
 Build a sizeof or alignof expression given an expression operand.
ExprResult ActOnUnaryExprOrTypeTraitExpr (SourceLocation OpLoc, UnaryExprOrTypeTrait ExprKind, bool IsType, void *TyOrEx, SourceRange ArgRange)
 ActOnUnaryExprOrTypeTraitExpr - Handle sizeof(type) and sizeof expr and the same for alignof and __alignof Note that the ArgRange is invalid if isType is false.
ExprResult CheckPlaceholderExpr (Expr *E)
 Check for operands with placeholder types and complain if found.
bool CheckVecStepExpr (Expr *E)
bool CheckUnaryExprOrTypeTraitOperand (Expr *E, UnaryExprOrTypeTrait ExprKind)
 Check the constraints on expression operands to unary type expression and type traits.
bool CheckUnaryExprOrTypeTraitOperand (QualType ExprType, SourceLocation OpLoc, SourceRange ExprRange, UnaryExprOrTypeTrait ExprKind, StringRef KWName)
 Check the constraints on operands to unary expression and type traits.
ExprResult ActOnPostfixUnaryOp (Scope *S, SourceLocation OpLoc, tok::TokenKind Kind, Expr *Input)
ExprResult ActOnArraySubscriptExpr (Scope *S, Expr *Base, SourceLocation LLoc, MultiExprArg ArgExprs, SourceLocation RLoc)
ExprResult CreateBuiltinArraySubscriptExpr (Expr *Base, SourceLocation LLoc, Expr *Idx, SourceLocation RLoc)
ExprResult CreateBuiltinMatrixSingleSubscriptExpr (Expr *Base, Expr *RowIdx, SourceLocation RBLoc)
ExprResult CreateBuiltinMatrixSubscriptExpr (Expr *Base, Expr *RowIdx, Expr *ColumnIdx, SourceLocation RBLoc)
bool ConvertArgumentsForCall (CallExpr *Call, Expr *Fn, FunctionDecl *FDecl, const FunctionProtoType *Proto, ArrayRef< Expr * > Args, SourceLocation RParenLoc, bool ExecConfig=false)
 ConvertArgumentsForCall - Converts the arguments specified in Args/NumArgs to the parameter types of the function FDecl with function prototype Proto.
void CheckStaticArrayArgument (SourceLocation CallLoc, ParmVarDecl *Param, const Expr *ArgExpr)
 CheckStaticArrayArgument - If the given argument corresponds to a static array parameter, check that it is non-null, and that if it is formed by array-to-pointer decay, the underlying array is sufficiently large.
ExprResult ActOnCallExpr (Scope *S, Expr *Fn, SourceLocation LParenLoc, MultiExprArg ArgExprs, SourceLocation RParenLoc, Expr *ExecConfig=nullptr)
 ActOnCallExpr - Handle a call to Fn with the specified array of arguments.
ExprResult BuildCallExpr (Scope *S, Expr *Fn, SourceLocation LParenLoc, MultiExprArg ArgExprs, SourceLocation RParenLoc, Expr *ExecConfig=nullptr, bool IsExecConfig=false, bool AllowRecovery=false)
 BuildCallExpr - Handle a call to Fn with the specified array of arguments.
ExprBuildBuiltinCallExpr (SourceLocation Loc, Builtin::ID Id, MultiExprArg CallArgs)
 BuildBuiltinCallExpr - Create a call to a builtin function specified by Id.
ExprResult BuildResolvedCallExpr (Expr *Fn, NamedDecl *NDecl, SourceLocation LParenLoc, ArrayRef< Expr * > Arg, SourceLocation RParenLoc, Expr *Config=nullptr, bool IsExecConfig=false, ADLCallKind UsesADL=ADLCallKind::NotADL)
 BuildResolvedCallExpr - Build a call to a resolved expression, i.e.
ExprResult ActOnCastExpr (Scope *S, SourceLocation LParenLoc, Declarator &D, ParsedType &Ty, SourceLocation RParenLoc, Expr *CastExpr)
CastKind PrepareScalarCast (ExprResult &src, QualType destType)
 Prepares for a scalar cast, performing all the necessary stages except the final cast and returning the kind required.
ExprResult BuildVectorLiteral (SourceLocation LParenLoc, SourceLocation RParenLoc, Expr *E, TypeSourceInfo *TInfo)
 Build an altivec or OpenCL literal.
ExprResult MaybeConvertParenListExprToParenExpr (Scope *S, Expr *ME)
 This is not an AltiVec-style cast or or C++ direct-initialization, so turn the ParenListExpr into a sequence of comma binary operators.
ExprResult ActOnCompoundLiteral (SourceLocation LParenLoc, ParsedType Ty, SourceLocation RParenLoc, Expr *InitExpr)
ExprResult BuildCompoundLiteralExpr (SourceLocation LParenLoc, TypeSourceInfo *TInfo, SourceLocation RParenLoc, Expr *LiteralExpr)
ExprResult ActOnInitList (SourceLocation LBraceLoc, MultiExprArg InitArgList, SourceLocation RBraceLoc)
ExprResult BuildInitList (SourceLocation LBraceLoc, MultiExprArg InitArgList, SourceLocation RBraceLoc)
ExprResult ActOnBinOp (Scope *S, SourceLocation TokLoc, tok::TokenKind Kind, Expr *LHSExpr, Expr *RHSExpr)
 Binary Operators. 'Tok' is the token for the operator.
ExprResult BuildBinOp (Scope *S, SourceLocation OpLoc, BinaryOperatorKind Opc, Expr *LHSExpr, Expr *RHSExpr, bool ForFoldExpression=false)
ExprResult CreateBuiltinBinOp (SourceLocation OpLoc, BinaryOperatorKind Opc, Expr *LHSExpr, Expr *RHSExpr, bool ForFoldExpression=false)
 CreateBuiltinBinOp - Creates a new built-in binary operation with operator Opc at location TokLoc.
void LookupBinOp (Scope *S, SourceLocation OpLoc, BinaryOperatorKind Opc, UnresolvedSetImpl &Functions)
void DiagnoseCommaOperator (const Expr *LHS, SourceLocation Loc)
 Look for instances where it is likely the comma operator is confused with another operator.
ExprResult ActOnConditionalOp (SourceLocation QuestionLoc, SourceLocation ColonLoc, Expr *CondExpr, Expr *LHSExpr, Expr *RHSExpr)
 ActOnConditionalOp - Parse a ?
ExprResult ActOnAddrLabel (SourceLocation OpLoc, SourceLocation LabLoc, LabelDecl *TheDecl)
 ActOnAddrLabel - Parse the GNU address of label extension: "&&foo".
void ActOnStartStmtExpr ()
ExprResult ActOnStmtExpr (Scope *S, SourceLocation LPLoc, Stmt *SubStmt, SourceLocation RPLoc)
ExprResult BuildStmtExpr (SourceLocation LPLoc, Stmt *SubStmt, SourceLocation RPLoc, unsigned TemplateDepth)
ExprResult ActOnStmtExprResult (ExprResult E)
void ActOnStmtExprError ()
ExprResult BuildBuiltinOffsetOf (SourceLocation BuiltinLoc, TypeSourceInfo *TInfo, ArrayRef< OffsetOfComponent > Components, SourceLocation RParenLoc)
 __builtin_offsetof(type, a.b[123][456].c)
ExprResult ActOnBuiltinOffsetOf (Scope *S, SourceLocation BuiltinLoc, SourceLocation TypeLoc, ParsedType ParsedArgTy, ArrayRef< OffsetOfComponent > Components, SourceLocation RParenLoc)
ExprResult ActOnChooseExpr (SourceLocation BuiltinLoc, Expr *CondExpr, Expr *LHSExpr, Expr *RHSExpr, SourceLocation RPLoc)
ExprResult ActOnVAArg (SourceLocation BuiltinLoc, Expr *E, ParsedType Ty, SourceLocation RPLoc)
ExprResult BuildVAArgExpr (SourceLocation BuiltinLoc, Expr *E, TypeSourceInfo *TInfo, SourceLocation RPLoc)
ExprResult ActOnSourceLocExpr (SourceLocIdentKind Kind, SourceLocation BuiltinLoc, SourceLocation RPLoc)
ExprResult ActOnEmbedExpr (SourceLocation EmbedKeywordLoc, StringLiteral *BinaryData, StringRef FileName)
ExprResult BuildSourceLocExpr (SourceLocIdentKind Kind, QualType ResultTy, SourceLocation BuiltinLoc, SourceLocation RPLoc, DeclContext *ParentContext)
ExprResult ActOnGNUNullExpr (SourceLocation TokenLoc)
bool CheckCaseExpression (Expr *E)
void ActOnBlockStart (SourceLocation CaretLoc, Scope *CurScope)
 ActOnBlockStart - This callback is invoked when a block literal is started.
void ActOnBlockArguments (SourceLocation CaretLoc, Declarator &ParamInfo, Scope *CurScope)
 ActOnBlockArguments - This callback allows processing of block arguments.
void ActOnBlockError (SourceLocation CaretLoc, Scope *CurScope)
 ActOnBlockError - If there is an error parsing a block, this callback is invoked to pop the information about the block from the action impl.
ExprResult ActOnBlockStmtExpr (SourceLocation CaretLoc, Stmt *Body, Scope *CurScope)
 ActOnBlockStmtExpr - This is called when the body of a block statement literal was successfully completed.
ExprResult ActOnConvertVectorExpr (Expr *E, ParsedType ParsedDestTy, SourceLocation BuiltinLoc, SourceLocation RParenLoc)
 ActOnConvertVectorExpr - create a new convert-vector expression from the provided arguments.
ExprResult ActOnAsTypeExpr (Expr *E, ParsedType ParsedDestTy, SourceLocation BuiltinLoc, SourceLocation RParenLoc)
 Parse a __builtin_astype expression.
ExprResult BuildAsTypeExpr (Expr *E, QualType DestTy, SourceLocation BuiltinLoc, SourceLocation RParenLoc)
 Create a new AsTypeExpr node (bitcast) from the arguments.
ExprResult CreateRecoveryExpr (SourceLocation Begin, SourceLocation End, ArrayRef< Expr * > SubExprs, QualType T=QualType())
 Attempts to produce a RecoveryExpr after some AST node cannot be created.
ExprResult PerformObjectMemberConversion (Expr *From, NestedNameSpecifier Qualifier, NamedDecl *FoundDecl, NamedDecl *Member)
 Cast a base object to a member's actual type.
bool CheckCallReturnType (QualType ReturnType, SourceLocation Loc, CallExpr *CE, FunctionDecl *FD)
 CheckCallReturnType - Checks that a call expression's return type is complete.
void WarnOnPendingNoDerefs (ExpressionEvaluationContextRecord &Rec)
 Emit a warning for all pending noderef expressions that we recorded.
ExprResult BuildCXXDefaultInitExpr (SourceLocation Loc, FieldDecl *Field)
bool CheckCXXDefaultArgExpr (SourceLocation CallLoc, FunctionDecl *FD, ParmVarDecl *Param, Expr *Init=nullptr, bool SkipImmediateInvocations=true)
 Instantiate or parse a C++ default argument expression as necessary.
ExprResult BuildCXXDefaultArgExpr (SourceLocation CallLoc, FunctionDecl *FD, ParmVarDecl *Param, Expr *Init=nullptr)
 BuildCXXDefaultArgExpr - Creates a CXXDefaultArgExpr, instantiating the default expr if needed.
ExprResult CheckForImmediateInvocation (ExprResult E, FunctionDecl *Decl)
 Wrap the expression in a ConstantExpr if it is a potential immediate invocation.
void MarkExpressionAsImmediateEscalating (Expr *E)
bool IsInvalidSMECallConversion (QualType FromType, QualType ToType)
ExprResult VerifyIntegerConstantExpression (Expr *E, llvm::APSInt *Result, VerifyICEDiagnoser &Diagnoser, AllowFoldKind CanFold=AllowFoldKind::No)
 VerifyIntegerConstantExpression - Verifies that an expression is an ICE, and reports the appropriate diagnostics.
ExprResult VerifyIntegerConstantExpression (Expr *E, llvm::APSInt *Result, unsigned DiagID, AllowFoldKind CanFold=AllowFoldKind::No)
ExprResult VerifyIntegerConstantExpression (Expr *E, llvm::APSInt *Result=nullptr, AllowFoldKind CanFold=AllowFoldKind::No)
ExprResult VerifyIntegerConstantExpression (Expr *E, AllowFoldKind CanFold=AllowFoldKind::No)
void DiagnoseAssignmentAsCondition (Expr *E)
 DiagnoseAssignmentAsCondition - Given that an expression is being used as a boolean condition, warn if it's an assignment.
void DiagnoseEqualityWithExtraParens (ParenExpr *ParenE)
 Redundant parentheses over an equality comparison can indicate that the user intended an assignment used as condition.
FullExprArg MakeFullExpr (Expr *Arg)
FullExprArg MakeFullExpr (Expr *Arg, SourceLocation CC)
FullExprArg MakeFullDiscardedValueExpr (Expr *Arg)
ExprResult CheckBooleanCondition (SourceLocation Loc, Expr *E, bool IsConstexpr=false)
 CheckBooleanCondition - Diagnose problems involving the use of the given expression as a boolean condition (e.g.
ConditionResult ActOnCondition (Scope *S, SourceLocation Loc, Expr *SubExpr, ConditionKind CK, bool MissingOK=false)
QualType CheckConditionalOperands (ExprResult &Cond, ExprResult &LHS, ExprResult &RHS, ExprValueKind &VK, ExprObjectKind &OK, SourceLocation QuestionLoc)
 Note that LHS is not null here, even if this is the gnu "x ?: y" extension.
bool DiagnoseConditionalForNull (const Expr *LHSExpr, const Expr *RHSExpr, SourceLocation QuestionLoc)
 Emit a specialized diagnostic when one expression is a null pointer constant and the other is not a pointer.
QualType CheckVectorOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, bool IsCompAssign, bool AllowBothBool, bool AllowBoolConversion, bool AllowBoolOperation, bool ReportInvalid)
 type checking for vector binary operators.
QualType GetSignedVectorType (QualType V)
 Return a signed ext_vector_type that is of identical size and number of elements.
QualType GetSignedSizelessVectorType (QualType V)
QualType CheckVectorCompareOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc)
 CheckVectorCompareOperands - vector comparisons are a clang extension that operates on extended vector types.
QualType CheckSizelessVectorCompareOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc)
QualType CheckVectorLogicalOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc)
QualType CheckMatrixLogicalOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc)
QualType CheckSizelessVectorOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, bool IsCompAssign, ArithConvKind OperationKind)
QualType CheckMatrixElementwiseOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, bool IsCompAssign)
 Type checking for matrix binary operators.
QualType CheckMatrixMultiplyOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, bool IsCompAssign)
bool isValidSveBitcast (QualType srcType, QualType destType)
 Are the two types SVE-bitcast-compatible types?
bool areMatrixTypesOfTheSameDimension (QualType srcTy, QualType destTy)
 Are the two types matrix types and do they have the same dimensions i.e.
bool areVectorTypesSameSize (QualType srcType, QualType destType)
bool areLaxCompatibleVectorTypes (QualType srcType, QualType destType)
 Are the two types lax-compatible vector types?
bool isLaxVectorConversion (QualType srcType, QualType destType)
 Is this a legal conversion between two types, one of which is known to be a vector type?
bool anyAltivecTypes (QualType srcType, QualType destType)
ExprResult checkUnknownAnyCast (SourceRange TypeRange, QualType CastType, Expr *CastExpr, CastKind &CastKind, ExprValueKind &VK, CXXCastPath &Path)
 Check a cast of an unknown-any type.
ExprResult forceUnknownAnyToType (Expr *E, QualType ToType)
 Force an expression with unknown-type to an expression of the given type.
ExprResult checkUnknownAnyArg (SourceLocation callLoc, Expr *result, QualType &paramType)
 Type-check an expression that's being passed to an __unknown_anytype parameter.
bool CheckMatrixCast (SourceRange R, QualType DestTy, QualType SrcTy, CastKind &Kind)
bool CheckVectorCast (SourceRange R, QualType VectorTy, QualType Ty, CastKind &Kind)
ExprResult prepareVectorSplat (QualType VectorTy, Expr *SplattedExpr)
 Prepare SplattedExpr for a vector splat operation, adding implicit casts if necessary.
ExprResult prepareMatrixSplat (QualType MatrixTy, Expr *SplattedExpr)
 Prepare SplattedExpr for a matrix splat operation, adding implicit casts if necessary.
ExprResult CheckExtVectorCast (SourceRange R, QualType DestTy, Expr *CastExpr, CastKind &Kind)
QualType PreferredConditionType (ConditionKind K) const
ExprResult UsualUnaryConversions (Expr *E)
 UsualUnaryConversions - Performs various conversions that are common to most operators (C99 6.3).
ExprResult UsualUnaryFPConversions (Expr *E)
 UsualUnaryFPConversions - Promotes floating-point types according to the current language semantics.
ExprResult CallExprUnaryConversions (Expr *E)
 CallExprUnaryConversions - a special case of an unary conversion performed on a function designator of a call expression.
ExprResult DefaultFunctionArrayConversion (Expr *E, bool Diagnose=true)
 DefaultFunctionArrayConversion (C99 6.3.2.1p3, C99 6.3.2.1p4).
ExprResult DefaultFunctionArrayLvalueConversion (Expr *E, bool Diagnose=true)
ExprResult DefaultLvalueConversion (Expr *E)
ExprResult DefaultArgumentPromotion (Expr *E)
 DefaultArgumentPromotion (C99 6.5.2.2p6).
VariadicCallType getVariadicCallType (FunctionDecl *FDecl, const FunctionProtoType *Proto, Expr *Fn)
VarArgKind isValidVarArgType (const QualType &Ty)
 Determine the degree of POD-ness for an expression.
void checkVariadicArgument (const Expr *E, VariadicCallType CT)
 Check to see if the given expression is a valid argument to a variadic function, issuing a diagnostic if not.
bool GatherArgumentsForCall (SourceLocation CallLoc, FunctionDecl *FDecl, const FunctionProtoType *Proto, unsigned FirstParam, ArrayRef< Expr * > Args, SmallVectorImpl< Expr * > &AllArgs, VariadicCallType CallType=VariadicCallType::DoesNotApply, bool AllowExplicit=false, bool IsListInitialization=false)
 GatherArgumentsForCall - Collector argument expressions for various form of call prototypes.
ExprResult DefaultVariadicArgumentPromotion (Expr *E, VariadicCallType CT, FunctionDecl *FDecl)
void checkEnumArithmeticConversions (Expr *LHS, Expr *RHS, SourceLocation Loc, ArithConvKind ACK)
 Check that the usual arithmetic conversions can be performed on this pair of expressions that might be of enumeration type.
QualType UsualArithmeticConversions (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, ArithConvKind ACK)
 UsualArithmeticConversions - Performs various conversions that are common to binary operators (C99 6.3.1.8).
bool IsAssignConvertCompatible (AssignConvertType ConvTy)
bool DiagnoseAssignmentResult (AssignConvertType ConvTy, SourceLocation Loc, QualType DstType, QualType SrcType, Expr *SrcExpr, AssignmentAction Action, bool *Complained=nullptr)
 DiagnoseAssignmentResult - Emit a diagnostic, if required, for the assignment conversion type specified by ConvTy.
AssignConvertType CheckAssignmentConstraints (SourceLocation Loc, QualType LHSType, QualType RHSType)
 CheckAssignmentConstraints - Perform type checking for assignment, argument passing, variable initialization, and function return values.
AssignConvertType CheckAssignmentConstraints (QualType LHSType, ExprResult &RHS, CastKind &Kind, bool ConvertRHS=true)
 Check assignment constraints and optionally prepare for a conversion of the RHS to the LHS type.
AssignConvertType CheckSingleAssignmentConstraints (QualType LHSType, ExprResult &RHS, bool Diagnose=true, bool DiagnoseCFAudited=false, bool ConvertRHS=true)
 Check assignment constraints for an assignment of RHS to LHSType.
AssignConvertType CheckTransparentUnionArgumentConstraints (QualType ArgType, ExprResult &RHS)
QualType InvalidOperands (SourceLocation Loc, ExprResult &LHS, ExprResult &RHS)
 the following "Check" methods will return a valid/converted QualType or a null QualType (indicating an error diagnostic was issued).
QualType InvalidLogicalVectorOperands (SourceLocation Loc, ExprResult &LHS, ExprResult &RHS)
 Diagnose cases where a scalar was implicitly converted to a vector and diagnose the underlying types.
QualType CheckMultiplyDivideOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc)
QualType CheckRemainderOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, bool IsCompAssign=false)
QualType CheckAdditionOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc, QualType *CompLHSTy=nullptr)
QualType CheckSubtractionOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc, QualType *CompLHSTy=nullptr)
QualType CheckShiftOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc, bool IsCompAssign=false)
void CheckPtrComparisonWithNullChar (ExprResult &E, ExprResult &NullE)
QualType CheckCompareOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc)
QualType CheckBitwiseOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc)
QualType CheckLogicalOperands (ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc)
QualType CheckAssignmentOperands (Expr *LHSExpr, ExprResult &RHS, SourceLocation Loc, QualType CompoundType, BinaryOperatorKind Opc)
bool isAlwaysConstantEvaluatedContext () const
bool isUnevaluatedContext () const
 Determines whether we are currently in a context that is not evaluated as per C++ [expr] p5.
bool isImmediateFunctionContext () const
bool isInLifetimeExtendingContext () const
bool needsRebuildOfDefaultArgOrInit () const
bool isCheckingDefaultArgumentOrInitializer () const
std::optional< ExpressionEvaluationContextRecord::InitializationContextInnermostDeclarationWithDelayedImmediateInvocations () const
std::optional< ExpressionEvaluationContextRecord::InitializationContextOutermostDeclarationWithDelayedImmediateInvocations () const
DefaultedComparisonKind getDefaultedComparisonKind (const FunctionDecl *FD)
const FieldDeclgetSelfAssignmentClassMemberCandidate (const ValueDecl *SelfAssigned)
 Returns a field in a CXXRecordDecl that has the same name as the decl SelfAssigned when inside a CXXMethodDecl.
void MaybeSuggestAddingStaticToDecl (const FunctionDecl *D)
template<typename... Ts>
bool RequireCompleteSizedType (SourceLocation Loc, QualType T, unsigned DiagID, const Ts &...Args)
template<typename... Ts>
bool RequireCompleteSizedExprType (Expr *E, unsigned DiagID, const Ts &...Args)
bool CheckArgsForPlaceholders (MultiExprArg args)
 Check an argument list for placeholders that we won't try to handle later.
void maybeExtendBlockObject (ExprResult &E)
 Do an explicit extend of the given block pointer if we're in ARC.
void DiagnosePrecisionLossInComplexDivision ()
static ConditionResult ConditionError ()
static bool TooManyArguments (size_t NumParams, size_t NumArgs, bool PartialOverloading=false)
 To be used for checking whether the arguments being passed to function exceeds the number of parameters expected for it.

Name Lookup

These routines provide name lookup that is used during semantic analysis to resolve the various kinds of names (identifiers, overloaded operator names, constructor names, etc.) into zero or more declarations within a particular scope.

The major entry points are LookupName, which performs unqualified name lookup, and LookupQualifiedName, which performs qualified name lookup.

All name lookup is performed based on some specific criteria, which specify what names will be visible to name lookup and how far name lookup should work. These criteria are important both for capturing language semantics (certain lookups will ignore certain names, for example) and for performance, since name lookup is often a bottleneck in the compilation of C++. Name lookup criteria is specified via the LookupCriteria enumeration.

The results of name lookup can vary based on the kind of name lookup performed, the current language, and the translation unit. In C, for example, name lookup will either return nothing (no entity found) or a single declaration. In C++, name lookup can additionally refer to a set of overloaded functions or result in an ambiguity. All of the possible results of name lookup are captured by the LookupResult class, which provides the ability to distinguish among them.

Implementations are in SemaLookup.cpp

enum class  AcceptableKind { Visible , Reachable }
enum  LookupNameKind {
  LookupOrdinaryName = 0 , LookupTagName , LookupLabel , LookupMemberName ,
  LookupOperatorName , LookupDestructorName , LookupNestedNameSpecifierName , LookupNamespaceName ,
  LookupUsingDeclName , LookupRedeclarationWithLinkage , LookupLocalFriendName , LookupObjCProtocolName ,
  LookupObjCImplicitSelfParam , LookupOMPReductionName , LookupOMPMapperName , LookupAnyName
}
 Describes the kind of name lookup to perform. More...
enum  LiteralOperatorLookupResult {
  LOLR_Error , LOLR_ErrorNoDiagnostic , LOLR_Cooked , LOLR_Raw ,
  LOLR_Template , LOLR_StringTemplatePack
}
 The possible outcomes of name lookup for a literal operator. More...
enum class  MissingImportKind {
  Declaration , Definition , DefaultArgument , ExplicitSpecialization ,
  PartialSpecialization
}
 Kinds of missing import. More...
typedef llvm::SmallSet< SourceLocation, 2 > SrcLocSet
typedef llvm::DenseMap< IdentifierInfo *, SrcLocSetIdentifierSourceLocations
typedef llvm::SmallSetVector< DeclContext *, 16 > AssociatedNamespaceSet
typedef llvm::SmallSetVector< CXXRecordDecl *, 16 > AssociatedClassSet
bool DisableTypoCorrection
 Tracks whether we are in a context where typo correction is disabled.
unsigned TyposCorrected
 The number of typos corrected by CorrectTypo.
IdentifierSourceLocations TypoCorrectionFailures
 A cache containing identifiers for which typo correction failed and their locations, so that repeated attempts to correct an identifier in a given location are ignored if typo correction already failed for it.
llvm::FoldingSet< SpecialMemberOverloadResultEntrySpecialMemberCache
 A cache of special member function overload resolution results for C++ records.
SpecialMemberOverloadResult LookupSpecialMember (CXXRecordDecl *D, CXXSpecialMemberKind SM, bool ConstArg, bool VolatileArg, bool RValueThis, bool ConstThis, bool VolatileThis)
RedeclarationKind forRedeclarationInCurContext () const
NamedDeclLookupSingleName (Scope *S, DeclarationName Name, SourceLocation Loc, LookupNameKind NameKind, RedeclarationKind Redecl=RedeclarationKind::NotForRedeclaration)
 Look up a name, looking for a single declaration.
bool LookupBuiltin (LookupResult &R)
 Lookup a builtin function, when name lookup would otherwise fail.
void LookupNecessaryTypesForBuiltin (Scope *S, unsigned ID)
bool LookupName (LookupResult &R, Scope *S, bool AllowBuiltinCreation=false, bool ForceNoCPlusPlus=false)
 Perform unqualified name lookup starting from a given scope.
bool LookupQualifiedName (LookupResult &R, DeclContext *LookupCtx, bool InUnqualifiedLookup=false)
 Perform qualified name lookup into a given context.
bool LookupQualifiedName (LookupResult &R, DeclContext *LookupCtx, CXXScopeSpec &SS)
 Performs qualified name lookup or special type of lookup for "__super::" scope specifier.
bool LookupParsedName (LookupResult &R, Scope *S, CXXScopeSpec *SS, QualType ObjectType, bool AllowBuiltinCreation=false, bool EnteringContext=false)
 Performs name lookup for a name that was parsed in the source code, and may contain a C++ scope specifier.
bool LookupInSuper (LookupResult &R, CXXRecordDecl *Class)
 Perform qualified name lookup into all base classes of the given class.
void LookupOverloadedOperatorName (OverloadedOperatorKind Op, Scope *S, UnresolvedSetImpl &Functions)
LabelDeclLookupOrCreateLabel (IdentifierInfo *II, SourceLocation IdentLoc, SourceLocation GnuLabelLoc=SourceLocation())
 LookupOrCreateLabel - Do a name lookup of a label with the specified name.
LabelDeclLookupExistingLabel (IdentifierInfo *II, SourceLocation IdentLoc)
 Perform a name lookup for a label with the specified name; this does not create a new label if the lookup fails.
DeclContextLookupResult LookupConstructors (CXXRecordDecl *Class)
 Look up the constructors for the given class.
CXXConstructorDeclLookupDefaultConstructor (CXXRecordDecl *Class)
 Look up the default constructor for the given class.
CXXConstructorDeclLookupCopyingConstructor (CXXRecordDecl *Class, unsigned Quals)
 Look up the copying constructor for the given class.
CXXMethodDeclLookupCopyingAssignment (CXXRecordDecl *Class, unsigned Quals, bool RValueThis, unsigned ThisQuals)
 Look up the copying assignment operator for the given class.
CXXConstructorDeclLookupMovingConstructor (CXXRecordDecl *Class, unsigned Quals)
 Look up the moving constructor for the given class.
CXXMethodDeclLookupMovingAssignment (CXXRecordDecl *Class, unsigned Quals, bool RValueThis, unsigned ThisQuals)
 Look up the moving assignment operator for the given class.
CXXDestructorDeclLookupDestructor (CXXRecordDecl *Class)
 Look for the destructor of the given class.
void ForceDeclarationOfImplicitMembers (CXXRecordDecl *Class)
 Force the declaration of any implicitly-declared members of this class.
void makeMergedDefinitionVisible (NamedDecl *ND)
 Make a merged definition of an existing hidden definition ND visible at the specified location.
template<typename T, typename = std::enable_if_t<std::is_base_of<NamedDecl, T>::value>>
bool ActOnDuplicateODRHashDefinition (T *Duplicate, T *Previous)
 Check ODR hashes for C/ObjC when merging types from modules.
llvm::DenseSet< Module * > & getLookupModules ()
 Get the set of additional modules that should be checked during name lookup.
bool hasVisibleMergedDefinition (const NamedDecl *Def)
bool hasMergedDefinitionInCurrentModule (const NamedDecl *Def)
bool hasVisibleDefaultArgument (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr)
 Determine if the template parameter D has a visible default argument.
bool hasReachableDefaultArgument (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr)
 Determine if the template parameter D has a reachable default argument.
bool hasAcceptableDefaultArgument (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules, Sema::AcceptableKind Kind)
 Determine if the template parameter D has a reachable default argument.
bool hasVisibleExplicitSpecialization (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr)
 Determine if there is a visible declaration of D that is an explicit specialization declaration for a specialization of a template.
bool hasReachableExplicitSpecialization (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr)
 Determine if there is a reachable declaration of D that is an explicit specialization declaration for a specialization of a template.
bool hasVisibleMemberSpecialization (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr)
 Determine if there is a visible declaration of D that is a member specialization declaration (as opposed to an instantiated declaration).
bool hasReachableMemberSpecialization (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr)
 Determine if there is a reachable declaration of D that is a member specialization declaration (as opposed to an instantiated declaration).
bool isModuleVisible (const Module *M, bool ModulePrivate=false)
bool hasVisibleDeclaration (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr)
 Determine whether any declaration of an entity is visible.
bool hasVisibleDeclarationSlow (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules)
bool hasReachableDeclaration (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr)
 Determine whether any declaration of an entity is reachable.
bool hasReachableDeclarationSlow (const NamedDecl *D, llvm::SmallVectorImpl< Module * > *Modules=nullptr)
void diagnoseTypo (const TypoCorrection &Correction, const PartialDiagnostic &TypoDiag, bool ErrorRecovery=true)
void diagnoseTypo (const TypoCorrection &Correction, const PartialDiagnostic &TypoDiag, const PartialDiagnostic &PrevNote, bool ErrorRecovery=true)
 Diagnose a successfully-corrected typo.
void FindAssociatedClassesAndNamespaces (SourceLocation InstantiationLoc, ArrayRef< Expr * > Args, AssociatedNamespaceSet &AssociatedNamespaces, AssociatedClassSet &AssociatedClasses)
 Find the associated classes and namespaces for argument-dependent lookup for a call with the given set of arguments.
void DiagnoseAmbiguousLookup (LookupResult &Result)
 Produce a diagnostic describing the ambiguity that resulted from name lookup.
LiteralOperatorLookupResult LookupLiteralOperator (Scope *S, LookupResult &R, ArrayRef< QualType > ArgTys, bool AllowRaw, bool AllowTemplate, bool AllowStringTemplate, bool DiagnoseMissing, StringLiteral *StringLit=nullptr)
 LookupLiteralOperator - Determine which literal operator should be used for a user-defined literal, per C++11 [lex.ext].
void ArgumentDependentLookup (DeclarationName Name, SourceLocation Loc, ArrayRef< Expr * > Args, ADLResult &Functions)
void LookupVisibleDecls (Scope *S, LookupNameKind Kind, VisibleDeclConsumer &Consumer, bool IncludeGlobalScope=true, bool LoadExternal=true)
void LookupVisibleDecls (DeclContext *Ctx, LookupNameKind Kind, VisibleDeclConsumer &Consumer, bool IncludeGlobalScope=true, bool IncludeDependentBases=false, bool LoadExternal=true)
TypoCorrection CorrectTypo (const DeclarationNameInfo &Typo, Sema::LookupNameKind LookupKind, Scope *S, CXXScopeSpec *SS, CorrectionCandidateCallback &CCC, CorrectTypoKind Mode, DeclContext *MemberContext=nullptr, bool EnteringContext=false, const ObjCObjectPointerType *OPT=nullptr, bool RecordFailure=true)
 Try to "correct" a typo in the source code by finding visible declarations whose names are similar to the name that was present in the source code.
void diagnoseMissingImport (SourceLocation Loc, const NamedDecl *Decl, MissingImportKind MIK, bool Recover=true)
 Diagnose that the specified declaration needs to be visible but isn't, and suggest a module import that would resolve the problem.
void diagnoseMissingImport (SourceLocation Loc, const NamedDecl *Decl, SourceLocation DeclLoc, ArrayRef< Module * > Modules, MissingImportKind MIK, bool Recover)
void ActOnPragmaDump (Scope *S, SourceLocation Loc, IdentifierInfo *II)
 Called on #pragma clang __debug dump II.
void ActOnPragmaDump (Expr *E)
 Called on #pragma clang __debug dump E.

Modules

Implementations are in SemaModule.cpp

enum class  ModuleDeclKind { Interface , Implementation , PartitionInterface , PartitionImplementation }
enum class  ModuleImportState {
  FirstDecl , GlobalFragment , ImportAllowed , ImportFinished ,
  PrivateFragmentImportAllowed , PrivateFragmentImportFinished , NotACXX20Module
}
 An enumeration to represent the transition of states in parsing module fragments and imports. More...
ModulegetCurrentModule () const
 Get the module unit whose scope we are currently within.
bool currentModuleIsImplementation () const
 Is the module scope we are an implementation unit?
void makeModuleVisible (Module *Mod, SourceLocation ImportLoc)
DeclGroupPtrTy ActOnModuleDecl (SourceLocation StartLoc, SourceLocation ModuleLoc, ModuleDeclKind MDK, ModuleIdPath Path, ModuleIdPath Partition, ModuleImportState &ImportState, bool SeenNoTrivialPPDirective)
 The parser has processed a module-declaration that begins the definition of a module interface or implementation.
DeclGroupPtrTy ActOnGlobalModuleFragmentDecl (SourceLocation ModuleLoc)
 The parser has processed a global-module-fragment declaration that begins the definition of the global module fragment of the current module unit.
DeclGroupPtrTy ActOnPrivateModuleFragmentDecl (SourceLocation ModuleLoc, SourceLocation PrivateLoc)
 The parser has processed a private-module-fragment declaration that begins the definition of the private module fragment of the current module unit.
DeclResult ActOnModuleImport (SourceLocation StartLoc, SourceLocation ExportLoc, SourceLocation ImportLoc, ModuleIdPath Path, bool IsPartition=false)
 The parser has processed a module import declaration.
DeclResult ActOnModuleImport (SourceLocation StartLoc, SourceLocation ExportLoc, SourceLocation ImportLoc, Module *M, ModuleIdPath Path={})
void ActOnAnnotModuleInclude (SourceLocation DirectiveLoc, Module *Mod)
 The parser has processed a module import translated from a #include or similar preprocessing directive.
void BuildModuleInclude (SourceLocation DirectiveLoc, Module *Mod)
void ActOnAnnotModuleBegin (SourceLocation DirectiveLoc, Module *Mod)
 The parsed has entered a submodule.
void ActOnAnnotModuleEnd (SourceLocation DirectiveLoc, Module *Mod)
 The parser has left a submodule.
void createImplicitModuleImportForErrorRecovery (SourceLocation Loc, Module *Mod)
 Create an implicit import of the given module at the given source location, for error recovery, if possible.
DeclActOnStartExportDecl (Scope *S, SourceLocation ExportLoc, SourceLocation LBraceLoc)
 We have parsed the start of an export declaration, including the '{' (if present).
DeclActOnFinishExportDecl (Scope *S, Decl *ExportDecl, SourceLocation RBraceLoc)
 Complete the definition of an export declaration.

C++ Overloading

Implementations are in SemaOverload.cpp

enum class  AllowedExplicit { None , Conversions , All }
enum class  MemberPointerConversionResult {
  Success , DifferentPointee , NotDerived , Ambiguous ,
  Virtual , Inaccessible
}
enum class  MemberPointerConversionDirection : bool { Downcast , Upcast }
enum  ReferenceCompareResult { Ref_Incompatible = 0 , Ref_Related , Ref_Compatible }
 ReferenceCompareResult - Expresses the result of comparing two types (cv1 T1 and cv2 T2) to determine their compatibility for the purposes of initialization by reference (C++ [dcl.init.ref]p4). More...
enum  ForRangeStatus { FRS_Success , FRS_NoViableFunction , FRS_DiagnosticIssued }
using ReferenceConversions = ReferenceConversionsScope::ReferenceConversions
bool DeferDiags = false
 Whether deferrable diagnostics should be deferred.
bool IsBuildingRecoveryCallExpr
 Flag indicating if Sema is building a recovery call expression.
OverloadKind CheckOverload (Scope *S, FunctionDecl *New, const LookupResult &OldDecls, NamedDecl *&OldDecl, bool UseMemberUsingDeclRules)
 Determine whether the given New declaration is an overload of the declarations in Old.
bool IsOverload (FunctionDecl *New, FunctionDecl *Old, bool UseMemberUsingDeclRules, bool ConsiderCudaAttrs=true)
bool IsOverride (FunctionDecl *MD, FunctionDecl *BaseMD, bool UseMemberUsingDeclRules, bool ConsiderCudaAttrs=true)
ImplicitConversionSequence TryImplicitConversion (Expr *From, QualType ToType, bool SuppressUserConversions, AllowedExplicit AllowExplicit, bool InOverloadResolution, bool CStyle, bool AllowObjCWritebackConversion)
ExprResult PerformImplicitConversion (Expr *From, QualType ToType, AssignmentAction Action, bool AllowExplicit=false)
 PerformImplicitConversion - Perform an implicit conversion of the expression From to the type ToType.
bool IsIntegralPromotion (Expr *From, QualType FromType, QualType ToType)
 IsIntegralPromotion - Determines whether the conversion from the expression From (whose potentially-adjusted type is FromType) to ToType is an integral promotion (C++ 4.5).
bool IsFloatingPointPromotion (QualType FromType, QualType ToType)
 IsFloatingPointPromotion - Determines whether the conversion from FromType to ToType is a floating point promotion (C++ 4.6).
bool IsComplexPromotion (QualType FromType, QualType ToType)
 Determine if a conversion is a complex promotion.
bool IsPointerConversion (Expr *From, QualType FromType, QualType ToType, bool InOverloadResolution, QualType &ConvertedType, bool &IncompatibleObjC)
 IsPointerConversion - Determines whether the conversion of the expression From, which has the (possibly adjusted) type FromType, can be converted to the type ToType via a pointer conversion (C++ 4.10).
bool isObjCPointerConversion (QualType FromType, QualType ToType, QualType &ConvertedType, bool &IncompatibleObjC)
 isObjCPointerConversion - Determines whether this is an Objective-C pointer conversion.
bool IsBlockPointerConversion (QualType FromType, QualType ToType, QualType &ConvertedType)
bool FunctionParamTypesAreEqual (ArrayRef< QualType > Old, ArrayRef< QualType > New, unsigned *ArgPos=nullptr, bool Reversed=false)
 FunctionParamTypesAreEqual - This routine checks two function proto types for equality of their parameter types.
bool FunctionParamTypesAreEqual (const FunctionProtoType *OldType, const FunctionProtoType *NewType, unsigned *ArgPos=nullptr, bool Reversed=false)
bool FunctionNonObjectParamTypesAreEqual (const FunctionDecl *OldFunction, const FunctionDecl *NewFunction, unsigned *ArgPos=nullptr, bool Reversed=false)
void HandleFunctionTypeMismatch (PartialDiagnostic &PDiag, QualType FromType, QualType ToType)
 HandleFunctionTypeMismatch - Gives diagnostic information for differeing function types.
bool CheckPointerConversion (Expr *From, QualType ToType, CastKind &Kind, CXXCastPath &BasePath, bool IgnoreBaseAccess, bool Diagnose=true)
 CheckPointerConversion - Check the pointer conversion from the expression From to the type ToType.
bool IsMemberPointerConversion (Expr *From, QualType FromType, QualType ToType, bool InOverloadResolution, QualType &ConvertedType)
 IsMemberPointerConversion - Determines whether the conversion of the expression From, which has the (possibly adjusted) type FromType, can be converted to the type ToType via a member pointer conversion (C++ 4.11).
MemberPointerConversionResult CheckMemberPointerConversion (QualType FromType, const MemberPointerType *ToPtrType, CastKind &Kind, CXXCastPath &BasePath, SourceLocation CheckLoc, SourceRange OpRange, bool IgnoreBaseAccess, MemberPointerConversionDirection Direction)
 CheckMemberPointerConversion - Check the member pointer conversion from the expression From to the type ToType.
bool IsQualificationConversion (QualType FromType, QualType ToType, bool CStyle, bool &ObjCLifetimeConversion)
 IsQualificationConversion - Determines whether the conversion from an rvalue of type FromType to ToType is a qualification conversion (C++ 4.4).
bool IsFunctionConversion (QualType FromType, QualType ToType) const
 Determine whether the conversion from FromType to ToType is a valid conversion of ExtInfo/ExtProtoInfo on the nested function type.
bool TryFunctionConversion (QualType FromType, QualType ToType, QualType &ResultTy) const
 Same as IsFunctionConversion, but if this would return true, it sets ResultTy to ToType.
bool DiagnoseMultipleUserDefinedConversion (Expr *From, QualType ToType)
void DiagnoseUseOfDeletedFunction (SourceLocation Loc, SourceRange Range, DeclarationName Name, OverloadCandidateSet &CandidateSet, FunctionDecl *Fn, MultiExprArg Args, bool IsMember=false)
ExprResult InitializeExplicitObjectArgument (Sema &S, Expr *Obj, FunctionDecl *Fun)
ExprResult PerformImplicitObjectArgumentInitialization (Expr *From, NestedNameSpecifier Qualifier, NamedDecl *FoundDecl, CXXMethodDecl *Method)
 PerformObjectArgumentInitialization - Perform initialization of the implicit object parameter for the given Method with the given expression.
ExprResult PerformContextuallyConvertToBool (Expr *From)
 PerformContextuallyConvertToBool - Perform a contextual conversion of the expression From to bool (C++0x [conv]p3).
ExprResult PerformContextuallyConvertToObjCPointer (Expr *From)
 PerformContextuallyConvertToObjCPointer - Perform a contextual conversion of the expression From to an Objective-C pointer type.
ExprResult BuildConvertedConstantExpression (Expr *From, QualType T, CCEKind CCE, NamedDecl *Dest=nullptr)
ExprResult CheckConvertedConstantExpression (Expr *From, QualType T, llvm::APSInt &Value, CCEKind CCE)
ExprResult CheckConvertedConstantExpression (Expr *From, QualType T, APValue &Value, CCEKind CCE, NamedDecl *Dest=nullptr)
ExprResult EvaluateConvertedConstantExpression (Expr *E, QualType T, APValue &Value, CCEKind CCE, bool RequireInt, const APValue &PreNarrowingValue)
 EvaluateConvertedConstantExpression - Evaluate an Expression That is a converted constant expression (which was built with BuildConvertedConstantExpression)
ExprResult PerformContextualImplicitConversion (SourceLocation Loc, Expr *FromE, ContextualImplicitConverter &Converter)
 Perform a contextual implicit conversion.
ReferenceCompareResult CompareReferenceRelationship (SourceLocation Loc, QualType T1, QualType T2, ReferenceConversions *Conv=nullptr)
 CompareReferenceRelationship - Compare the two types T1 and T2 to determine whether they are reference-compatible, reference-related, or incompatible, for use in C++ initialization by reference (C++ [dcl.ref.init]p4).
void AddOverloadCandidate (FunctionDecl *Function, DeclAccessPair FoundDecl, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool SuppressUserConversions=false, bool PartialOverloading=false, bool AllowExplicit=true, bool AllowExplicitConversion=false, ADLCallKind IsADLCandidate=ADLCallKind::NotADL, ConversionSequenceList EarlyConversions={}, OverloadCandidateParamOrder PO={}, bool AggregateCandidateDeduction=false, bool StrictPackMatch=false)
 AddOverloadCandidate - Adds the given function to the set of candidate functions, using the given function call arguments.
void AddFunctionCandidates (const UnresolvedSetImpl &Functions, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, TemplateArgumentListInfo *ExplicitTemplateArgs=nullptr, bool SuppressUserConversions=false, bool PartialOverloading=false, bool FirstArgumentIsBase=false)
 Add all of the function declarations in the given function set to the overload candidate set.
void AddMethodCandidate (DeclAccessPair FoundDecl, QualType ObjectType, Expr::Classification ObjectClassification, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool SuppressUserConversion=false, OverloadCandidateParamOrder PO={})
 AddMethodCandidate - Adds a named decl (which is some kind of method) as a method candidate to the given overload set.
void AddMethodCandidate (CXXMethodDecl *Method, DeclAccessPair FoundDecl, CXXRecordDecl *ActingContext, QualType ObjectType, Expr::Classification ObjectClassification, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool SuppressUserConversions=false, bool PartialOverloading=false, ConversionSequenceList EarlyConversions={}, OverloadCandidateParamOrder PO={}, bool StrictPackMatch=false)
 AddMethodCandidate - Adds the given C++ member function to the set of candidate functions, using the given function call arguments and the object argument (Object).
void AddMethodTemplateCandidate (FunctionTemplateDecl *MethodTmpl, DeclAccessPair FoundDecl, CXXRecordDecl *ActingContext, TemplateArgumentListInfo *ExplicitTemplateArgs, QualType ObjectType, Expr::Classification ObjectClassification, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool SuppressUserConversions=false, bool PartialOverloading=false, OverloadCandidateParamOrder PO={})
 Add a C++ member function template as a candidate to the candidate set, using template argument deduction to produce an appropriate member function template specialization.
void AddTemplateOverloadCandidate (FunctionTemplateDecl *FunctionTemplate, DeclAccessPair FoundDecl, TemplateArgumentListInfo *ExplicitTemplateArgs, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool SuppressUserConversions=false, bool PartialOverloading=false, bool AllowExplicit=true, ADLCallKind IsADLCandidate=ADLCallKind::NotADL, OverloadCandidateParamOrder PO={}, bool AggregateCandidateDeduction=false)
 Add a C++ function template specialization as a candidate in the candidate set, using template argument deduction to produce an appropriate function template specialization.
bool CheckNonDependentConversions (FunctionTemplateDecl *FunctionTemplate, ArrayRef< QualType > ParamTypes, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, ConversionSequenceList &Conversions, CheckNonDependentConversionsFlag UserConversionFlag, CXXRecordDecl *ActingContext=nullptr, QualType ObjectType=QualType(), Expr::Classification ObjectClassification={}, OverloadCandidateParamOrder PO={})
 Check that implicit conversion sequences can be formed for each argument whose corresponding parameter has a non-dependent type, per DR1391's [temp.deduct.call]p10.
void AddConversionCandidate (CXXConversionDecl *Conversion, DeclAccessPair FoundDecl, CXXRecordDecl *ActingContext, Expr *From, QualType ToType, OverloadCandidateSet &CandidateSet, bool AllowObjCConversionOnExplicit, bool AllowExplicit, bool AllowResultConversion=true, bool StrictPackMatch=false)
 AddConversionCandidate - Add a C++ conversion function as a candidate in the candidate set (C++ [over.match.conv], C++ [over.match.copy]).
void AddTemplateConversionCandidate (FunctionTemplateDecl *FunctionTemplate, DeclAccessPair FoundDecl, CXXRecordDecl *ActingContext, Expr *From, QualType ToType, OverloadCandidateSet &CandidateSet, bool AllowObjCConversionOnExplicit, bool AllowExplicit, bool AllowResultConversion=true)
 Adds a conversion function template specialization candidate to the overload set, using template argument deduction to deduce the template arguments of the conversion function template from the type that we are converting to (C++ [temp.deduct.conv]).
void AddSurrogateCandidate (CXXConversionDecl *Conversion, DeclAccessPair FoundDecl, CXXRecordDecl *ActingContext, const FunctionProtoType *Proto, Expr *Object, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet)
 AddSurrogateCandidate - Adds a "surrogate" candidate function that converts the given Object to a function pointer via the conversion function Conversion, and then attempts to call it with the given arguments (C++ [over.call.object]p2-4).
void AddNonMemberOperatorCandidates (const UnresolvedSetImpl &Functions, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, TemplateArgumentListInfo *ExplicitTemplateArgs=nullptr)
 Add all of the non-member operator function declarations in the given function set to the overload candidate set.
void AddMemberOperatorCandidates (OverloadedOperatorKind Op, SourceLocation OpLoc, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, OverloadCandidateParamOrder PO={})
 Add overload candidates for overloaded operators that are member functions.
void AddBuiltinCandidate (QualType *ParamTys, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool IsAssignmentOperator=false, unsigned NumContextualBoolArguments=0)
 AddBuiltinCandidate - Add a candidate for a built-in operator.
void AddBuiltinOperatorCandidates (OverloadedOperatorKind Op, SourceLocation OpLoc, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet)
 AddBuiltinOperatorCandidates - Add the appropriate built-in operator overloads to the candidate set (C++ [over.built]), based on the operator Op and the arguments given.
void AddArgumentDependentLookupCandidates (DeclarationName Name, SourceLocation Loc, ArrayRef< Expr * > Args, TemplateArgumentListInfo *ExplicitTemplateArgs, OverloadCandidateSet &CandidateSet, bool PartialOverloading=false)
 Add function candidates found via argument-dependent lookup to the set of overloading candidates.
EnableIfAttr * CheckEnableIf (FunctionDecl *Function, SourceLocation CallLoc, ArrayRef< Expr * > Args, bool MissingImplicitThis=false)
 Check the enable_if expressions on the given function.
bool diagnoseArgDependentDiagnoseIfAttrs (const FunctionDecl *Function, const Expr *ThisArg, ArrayRef< const Expr * > Args, SourceLocation Loc)
 Emit diagnostics for the diagnose_if attributes on Function, ignoring any non-ArgDependent DiagnoseIfAttrs.
bool diagnoseArgIndependentDiagnoseIfAttrs (const NamedDecl *ND, SourceLocation Loc)
 Emit diagnostics for the diagnose_if attributes on Function, ignoring any ArgDependent DiagnoseIfAttrs.
bool isEquivalentInternalLinkageDeclaration (const NamedDecl *A, const NamedDecl *B)
 Determine if A and B are equivalent internal linkage declarations from different modules, and thus an ambiguity error can be downgraded to an extension warning.
void diagnoseEquivalentInternalLinkageDeclarations (SourceLocation Loc, const NamedDecl *D, ArrayRef< const NamedDecl * > Equiv)
void NoteOverloadCandidate (const NamedDecl *Found, const FunctionDecl *Fn, OverloadCandidateRewriteKind RewriteKind=OverloadCandidateRewriteKind(), QualType DestType=QualType(), bool TakingAddress=false)
void NoteAllOverloadCandidates (Expr *E, QualType DestType=QualType(), bool TakingAddress=false)
bool checkAddressOfFunctionIsAvailable (const FunctionDecl *Function, bool Complain=false, SourceLocation Loc=SourceLocation())
 Returns whether the given function's address can be taken or not, optionally emitting a diagnostic if the address can't be taken.
QualType ExtractUnqualifiedFunctionType (QualType PossiblyAFunctionType)
FunctionDeclResolveAddressOfOverloadedFunction (Expr *AddressOfExpr, QualType TargetType, bool Complain, DeclAccessPair &Found, bool *pHadMultipleCandidates=nullptr)
 ResolveAddressOfOverloadedFunction - Try to resolve the address of an overloaded function (C++ [over.over]), where From is an expression with overloaded function type and ToType is the type we're trying to resolve to.
FunctionDeclresolveAddressOfSingleOverloadCandidate (Expr *E, DeclAccessPair &FoundResult)
 Given an expression that refers to an overloaded function, try to resolve that function to a single function that can have its address taken.
bool resolveAndFixAddressOfSingleOverloadCandidate (ExprResult &SrcExpr, bool DoFunctionPointerConversion=false)
 Given an overloaded function, tries to turn it into a non-overloaded function reference using resolveAddressOfSingleOverloadCandidate.
FunctionDeclResolveSingleFunctionTemplateSpecialization (OverloadExpr *ovl, bool Complain=false, DeclAccessPair *Found=nullptr, TemplateSpecCandidateSet *FailedTSC=nullptr, bool ForTypeDeduction=false)
 Given an expression that refers to an overloaded function, try to resolve that overloaded function expression down to a single function.
bool ResolveAndFixSingleFunctionTemplateSpecialization (ExprResult &SrcExpr, bool DoFunctionPointerConversion=false, bool Complain=false, SourceRange OpRangeForComplaining=SourceRange(), QualType DestTypeForComplaining=QualType(), unsigned DiagIDForComplaining=0)
void AddOverloadedCallCandidates (UnresolvedLookupExpr *ULE, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool PartialOverloading=false)
 Add the overload candidates named by callee and/or found by argument dependent lookup to the given overload set.
void AddOverloadedCallCandidates (LookupResult &R, TemplateArgumentListInfo *ExplicitTemplateArgs, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet)
 Add the call candidates from the given set of lookup results to the given overload set.
ForRangeStatus BuildForRangeBeginEndCall (SourceLocation Loc, SourceLocation RangeLoc, const DeclarationNameInfo &NameInfo, LookupResult &MemberLookup, OverloadCandidateSet *CandidateSet, Expr *Range, ExprResult *CallExpr)
 Build a call to 'begin' or 'end' for a C++11 for-range statement.
ExprResult BuildOverloadedCallExpr (Scope *S, Expr *Fn, UnresolvedLookupExpr *ULE, SourceLocation LParenLoc, MultiExprArg Args, SourceLocation RParenLoc, Expr *ExecConfig, bool AllowTypoCorrection=true, bool CalleesAddressIsTaken=false)
 BuildOverloadedCallExpr - Given the call expression that calls Fn (which eventually refers to the declaration Func) and the call arguments Args/NumArgs, attempt to resolve the function call down to a specific function.
bool buildOverloadedCallSet (Scope *S, Expr *Fn, UnresolvedLookupExpr *ULE, MultiExprArg Args, SourceLocation RParenLoc, OverloadCandidateSet *CandidateSet, ExprResult *Result)
 Constructs and populates an OverloadedCandidateSet from the given function.
ExprResult CreateUnresolvedLookupExpr (CXXRecordDecl *NamingClass, NestedNameSpecifierLoc NNSLoc, DeclarationNameInfo DNI, const UnresolvedSetImpl &Fns, bool PerformADL=true)
ExprResult CreateOverloadedUnaryOp (SourceLocation OpLoc, UnaryOperatorKind Opc, const UnresolvedSetImpl &Fns, Expr *input, bool RequiresADL=true)
 Create a unary operation that may resolve to an overloaded operator.
void LookupOverloadedBinOp (OverloadCandidateSet &CandidateSet, OverloadedOperatorKind Op, const UnresolvedSetImpl &Fns, ArrayRef< Expr * > Args, bool RequiresADL=true)
 Perform lookup for an overloaded binary operator.
ExprResult CreateOverloadedBinOp (SourceLocation OpLoc, BinaryOperatorKind Opc, const UnresolvedSetImpl &Fns, Expr *LHS, Expr *RHS, bool RequiresADL=true, bool AllowRewrittenCandidates=true, FunctionDecl *DefaultedFn=nullptr)
 Create a binary operation that may resolve to an overloaded operator.
ExprResult BuildSynthesizedThreeWayComparison (SourceLocation OpLoc, const UnresolvedSetImpl &Fns, Expr *LHS, Expr *RHS, FunctionDecl *DefaultedFn)
ExprResult CreateOverloadedArraySubscriptExpr (SourceLocation LLoc, SourceLocation RLoc, Expr *Base, MultiExprArg Args)
ExprResult BuildCallToMemberFunction (Scope *S, Expr *MemExpr, SourceLocation LParenLoc, MultiExprArg Args, SourceLocation RParenLoc, Expr *ExecConfig=nullptr, bool IsExecConfig=false, bool AllowRecovery=false)
 BuildCallToMemberFunction - Build a call to a member function.
ExprResult BuildCallToObjectOfClassType (Scope *S, Expr *Object, SourceLocation LParenLoc, MultiExprArg Args, SourceLocation RParenLoc)
 BuildCallToObjectOfClassType - Build a call to an object of class type (C++ [over.call.object]), which can end up invoking an overloaded function call operator (operator()) or performing a user-defined conversion on the object argument.
ExprResult BuildOverloadedArrowExpr (Scope *S, Expr *Base, SourceLocation OpLoc, bool *NoArrowOperatorFound=nullptr)
 BuildOverloadedArrowExpr - Build a call to an overloaded operator-> (if one exists), where Base is an expression of class type and Member is the name of the member we're trying to find.
ExprResult BuildCXXMemberCallExpr (Expr *Exp, NamedDecl *FoundDecl, CXXConversionDecl *Method, bool HadMultipleCandidates)
ExprResult BuildLiteralOperatorCall (LookupResult &R, DeclarationNameInfo &SuffixInfo, ArrayRef< Expr * > Args, SourceLocation LitEndLoc, TemplateArgumentListInfo *ExplicitTemplateArgs=nullptr)
 BuildLiteralOperatorCall - Build a UserDefinedLiteral by creating a call to a literal operator described by the provided lookup results.
ExprResult FixOverloadedFunctionReference (Expr *E, DeclAccessPair FoundDecl, FunctionDecl *Fn)
 FixOverloadedFunctionReference - E is an expression that refers to a C++ overloaded function (possibly with some parentheses and perhaps a '&' around it).
ExprResult FixOverloadedFunctionReference (ExprResult, DeclAccessPair FoundDecl, FunctionDecl *Fn)
ObjCMethodDeclSelectBestMethod (Selector Sel, MultiExprArg Args, bool IsInstance, SmallVectorImpl< ObjCMethodDecl * > &Methods)

Statements

Implementations are in SemaStmt.cpp

enum  BuildForRangeKind { BFRK_Build , BFRK_Rebuild , BFRK_Check }
enum class  SimplerImplicitMoveMode { ForceOff , Normal , ForceOn }
typedef std::pair< StringRef, QualTypeCapturedParamNameType
SmallVector< Scope *, 2 > CurrentSEHFinally
 Stack of active SEH __finally scopes. Can be empty.
SmallVector< std::pair< Scope *, SourceLocation >, 2 > CurrentDefer
 Stack of '_Defer' statements that are currently being parsed, as well as the locations of their '_Defer' keywords.
StmtResult ActOnExprStmt (ExprResult Arg, bool DiscardedValue=true)
StmtResult ActOnExprStmtError ()
StmtResult ActOnNullStmt (SourceLocation SemiLoc, bool HasLeadingEmptyMacro=false)
StmtResult ActOnDeclStmt (DeclGroupPtrTy Decl, SourceLocation StartLoc, SourceLocation EndLoc)
void ActOnForEachDeclStmt (DeclGroupPtrTy Decl)
void DiagnoseUnusedExprResult (const Stmt *S, unsigned DiagID)
 DiagnoseUnusedExprResult - If the statement passed in is an expression whose result is unused, warn.
void ActOnStartOfCompoundStmt (bool IsStmtExpr)
void ActOnAfterCompoundStatementLeadingPragmas ()
void ActOnFinishOfCompoundStmt ()
StmtResult ActOnCompoundStmt (SourceLocation L, SourceLocation R, ArrayRef< Stmt * > Elts, bool isStmtExpr)
sema::CompoundScopeInfogetCurCompoundScope () const
ExprResult ActOnCaseExpr (SourceLocation CaseLoc, ExprResult Val)
StmtResult ActOnCaseStmt (SourceLocation CaseLoc, ExprResult LHS, SourceLocation DotDotDotLoc, ExprResult RHS, SourceLocation ColonLoc)
void ActOnCaseStmtBody (Stmt *CaseStmt, Stmt *SubStmt)
 ActOnCaseStmtBody - This installs a statement as the body of a case.
StmtResult ActOnDefaultStmt (SourceLocation DefaultLoc, SourceLocation ColonLoc, Stmt *SubStmt, Scope *CurScope)
StmtResult ActOnLabelStmt (SourceLocation IdentLoc, LabelDecl *TheDecl, SourceLocation ColonLoc, Stmt *SubStmt)
StmtResult BuildAttributedStmt (SourceLocation AttrsLoc, ArrayRef< const Attr * > Attrs, Stmt *SubStmt)
StmtResult ActOnAttributedStmt (const ParsedAttributes &AttrList, Stmt *SubStmt)
bool checkAndRewriteMustTailAttr (Stmt *St, const Attr &MTA)
 Check whether the given statement can have musttail applied to it, issuing a diagnostic and returning false if not.
StmtResult ActOnIfStmt (SourceLocation IfLoc, IfStatementKind StatementKind, SourceLocation LParenLoc, Stmt *InitStmt, ConditionResult Cond, SourceLocation RParenLoc, Stmt *ThenVal, SourceLocation ElseLoc, Stmt *ElseVal)
StmtResult BuildIfStmt (SourceLocation IfLoc, IfStatementKind StatementKind, SourceLocation LParenLoc, Stmt *InitStmt, ConditionResult Cond, SourceLocation RParenLoc, Stmt *ThenVal, SourceLocation ElseLoc, Stmt *ElseVal)
ExprResult CheckSwitchCondition (SourceLocation SwitchLoc, Expr *Cond)
StmtResult ActOnStartOfSwitchStmt (SourceLocation SwitchLoc, SourceLocation LParenLoc, Stmt *InitStmt, ConditionResult Cond, SourceLocation RParenLoc)
StmtResult ActOnFinishSwitchStmt (SourceLocation SwitchLoc, Stmt *Switch, Stmt *Body)
void DiagnoseAssignmentEnum (QualType DstType, QualType SrcType, Expr *SrcExpr)
 DiagnoseAssignmentEnum - Warn if assignment to enum is a constant integer not in the range of enum values.
StmtResult ActOnWhileStmt (SourceLocation WhileLoc, SourceLocation LParenLoc, ConditionResult Cond, SourceLocation RParenLoc, Stmt *Body)
StmtResult ActOnDoStmt (SourceLocation DoLoc, Stmt *Body, SourceLocation WhileLoc, SourceLocation CondLParen, Expr *Cond, SourceLocation CondRParen)
StmtResult ActOnForStmt (SourceLocation ForLoc, SourceLocation LParenLoc, Stmt *First, ConditionResult Second, FullExprArg Third, SourceLocation RParenLoc, Stmt *Body)
StmtResult ActOnForEachLValueExpr (Expr *E)
 In an Objective C collection iteration statement: for (x in y) x can be an arbitrary l-value expression.
StmtResult ActOnCXXForRangeStmt (Scope *S, SourceLocation ForLoc, SourceLocation CoawaitLoc, Stmt *InitStmt, Stmt *LoopVar, SourceLocation ColonLoc, Expr *Collection, SourceLocation RParenLoc, BuildForRangeKind Kind, ArrayRef< MaterializeTemporaryExpr * > LifetimeExtendTemps={})
 ActOnCXXForRangeStmt - Check and build a C++11 for-range statement.
StmtResult BuildCXXForRangeStmt (SourceLocation ForLoc, SourceLocation CoawaitLoc, Stmt *InitStmt, SourceLocation ColonLoc, Stmt *RangeDecl, Stmt *Begin, Stmt *End, Expr *Cond, Expr *Inc, Stmt *LoopVarDecl, SourceLocation RParenLoc, BuildForRangeKind Kind, ArrayRef< MaterializeTemporaryExpr * > LifetimeExtendTemps={})
 BuildCXXForRangeStmt - Build or instantiate a C++11 for-range statement.
StmtResult FinishCXXForRangeStmt (Stmt *ForRange, Stmt *Body)
 FinishCXXForRangeStmt - Attach the body to a C++0x for-range statement.
StmtResult ActOnGotoStmt (SourceLocation GotoLoc, SourceLocation LabelLoc, LabelDecl *TheDecl)
StmtResult ActOnIndirectGotoStmt (SourceLocation GotoLoc, SourceLocation StarLoc, Expr *DestExp)
StmtResult ActOnContinueStmt (SourceLocation ContinueLoc, Scope *CurScope, LabelDecl *Label, SourceLocation LabelLoc)
StmtResult ActOnBreakStmt (SourceLocation BreakLoc, Scope *CurScope, LabelDecl *Label, SourceLocation LabelLoc)
void ActOnStartOfDeferStmt (SourceLocation DeferLoc, Scope *CurScope)
void ActOnDeferStmtError (Scope *CurScope)
StmtResult ActOnEndOfDeferStmt (Stmt *Body, Scope *CurScope)
NamedReturnInfo getNamedReturnInfo (Expr *&E, SimplerImplicitMoveMode Mode=SimplerImplicitMoveMode::Normal)
 Determine whether the given expression might be move-eligible or copy-elidable in either a (co_)return statement or throw expression, without considering function return type, if applicable.
NamedReturnInfo getNamedReturnInfo (const VarDecl *VD)
 Determine whether the given NRVO candidate variable is move-eligible or copy-elidable, without considering function return type.
const VarDeclgetCopyElisionCandidate (NamedReturnInfo &Info, QualType ReturnType)
 Updates given NamedReturnInfo's move-eligible and copy-elidable statuses, considering the function return type criteria as applicable to return statements.
ExprResult PerformMoveOrCopyInitialization (const InitializedEntity &Entity, const NamedReturnInfo &NRInfo, Expr *Value, bool SupressSimplerImplicitMoves=false)
 Perform the initialization of a potentially-movable value, which is the result of return value.
TypeLoc getReturnTypeLoc (FunctionDecl *FD) const
bool DeduceFunctionTypeFromReturnExpr (FunctionDecl *FD, SourceLocation ReturnLoc, Expr *RetExpr, const AutoType *AT)
 Deduce the return type for a function from a returned expression, per C++1y [dcl.spec.auto]p6.
StmtResult ActOnReturnStmt (SourceLocation ReturnLoc, Expr *RetValExp, Scope *CurScope)
StmtResult BuildReturnStmt (SourceLocation ReturnLoc, Expr *RetValExp, bool AllowRecovery=false)
StmtResult ActOnCapScopeReturnStmt (SourceLocation ReturnLoc, Expr *RetValExp, NamedReturnInfo &NRInfo, bool SupressSimplerImplicitMoves)
 ActOnCapScopeReturnStmt - Utility routine to type-check return statements for capturing scopes.
StmtResult ActOnCXXCatchBlock (SourceLocation CatchLoc, Decl *ExDecl, Stmt *HandlerBlock)
 ActOnCXXCatchBlock - Takes an exception declaration and a handler block and creates a proper catch handler from them.
StmtResult ActOnCXXTryBlock (SourceLocation TryLoc, Stmt *TryBlock, ArrayRef< Stmt * > Handlers)
 ActOnCXXTryBlock - Takes a try compound-statement and a number of handlers and creates a try statement from them.
void DiagnoseExceptionUse (SourceLocation Loc, bool IsTry)
StmtResult ActOnSEHTryBlock (bool IsCXXTry, SourceLocation TryLoc, Stmt *TryBlock, Stmt *Handler)
StmtResult ActOnSEHExceptBlock (SourceLocation Loc, Expr *FilterExpr, Stmt *Block)
void ActOnStartSEHFinallyBlock ()
void ActOnAbortSEHFinallyBlock ()
StmtResult ActOnFinishSEHFinallyBlock (SourceLocation Loc, Stmt *Block)
StmtResult ActOnSEHLeaveStmt (SourceLocation Loc, Scope *CurScope)
StmtResult BuildMSDependentExistsStmt (SourceLocation KeywordLoc, bool IsIfExists, NestedNameSpecifierLoc QualifierLoc, DeclarationNameInfo NameInfo, Stmt *Nested)
StmtResult ActOnMSDependentExistsStmt (SourceLocation KeywordLoc, bool IsIfExists, CXXScopeSpec &SS, UnqualifiedId &Name, Stmt *Nested)
void ActOnCapturedRegionStart (SourceLocation Loc, Scope *CurScope, CapturedRegionKind Kind, unsigned NumParams)
void ActOnCapturedRegionStart (SourceLocation Loc, Scope *CurScope, CapturedRegionKind Kind, ArrayRef< CapturedParamNameType > Params, unsigned OpenMPCaptureLevel=0)
StmtResult ActOnCapturedRegionEnd (Stmt *S)
void ActOnCapturedRegionError ()
RecordDeclCreateCapturedStmtRecordDecl (CapturedDecl *&CD, SourceLocation Loc, unsigned NumParams)

C++ Templates

Implementations are in SemaTemplate.cpp

enum  TemplateNameIsRequiredTag { TemplateNameIsRequired }
enum class  AssumedTemplateKind { None , FoundNothing , FoundFunctions }
enum  TemplateParamListContext {
  TPC_Other , TPC_FunctionTemplate , TPC_ClassTemplateMember , TPC_FriendClassTemplate ,
  TPC_FriendFunctionTemplate , TPC_FriendFunctionTemplateDefinition , TPC_TemplateTemplateParameterPack
}
 The context in which we are checking a template parameter list. More...
enum  CheckTemplateArgumentKind { CTAK_Specified , CTAK_Deduced , CTAK_DeducedFromArrayBound }
 Specifies the context in which a particular template argument is being checked. More...
enum  TemplateParameterListEqualKind { TPL_TemplateMatch , TPL_TemplateTemplateParmMatch , TPL_TemplateParamsEquivalent }
 Enumeration describing how template parameter lists are compared for equality. More...
typedef llvm::MapVector< const FunctionDecl *, std::unique_ptr< LateParsedTemplate > > LateParsedTemplateMapT
LateParsedTemplateMapT LateParsedTemplateMap
void resetFPOptions (FPOptions FPO)
ArrayRef< InventedTemplateParameterInfogetInventedParameterInfos () const
ArrayRef< sema::FunctionScopeInfo * > getFunctionScopes () const
unsigned getTemplateDepth (Scope *S) const
 Determine the number of levels of enclosing template parameters.
void FilterAcceptableTemplateNames (LookupResult &R, bool AllowFunctionTemplates=true, bool AllowDependent=true)
bool hasAnyAcceptableTemplateNames (LookupResult &R, bool AllowFunctionTemplates=true, bool AllowDependent=true, bool AllowNonTemplateFunctions=false)
bool LookupTemplateName (LookupResult &R, Scope *S, CXXScopeSpec &SS, QualType ObjectType, bool EnteringContext, RequiredTemplateKind RequiredTemplate=SourceLocation(), AssumedTemplateKind *ATK=nullptr, bool AllowTypoCorrection=true)
TemplateNameKind isTemplateName (Scope *S, CXXScopeSpec &SS, bool hasTemplateKeyword, const UnqualifiedId &Name, ParsedType ObjectType, bool EnteringContext, TemplateTy &Template, bool &MemberOfUnknownSpecialization, bool Disambiguation=false)
void ActOnUndeclaredTypeTemplateName (Scope *S, TemplateTy &Name, TemplateNameKind &TNK, SourceLocation NameLoc, IdentifierInfo *&II)
 Try to resolve an undeclared template name as a type template.
bool isDeductionGuideName (Scope *S, const IdentifierInfo &Name, SourceLocation NameLoc, CXXScopeSpec &SS, ParsedTemplateTy *Template=nullptr)
 Determine whether a particular identifier might be the name in a C++1z deduction-guide declaration.
bool DiagnoseUnknownTemplateName (const IdentifierInfo &II, SourceLocation IILoc, Scope *S, const CXXScopeSpec *SS, TemplateTy &SuggestedTemplate, TemplateNameKind &SuggestedKind)
bool DiagnoseUninstantiableTemplate (SourceLocation PointOfInstantiation, NamedDecl *Instantiation, bool InstantiatedFromMember, const NamedDecl *Pattern, const NamedDecl *PatternDef, TemplateSpecializationKind TSK, bool Complain=true, bool *Unreachable=nullptr)
 Determine whether we would be unable to instantiate this template (because it either has no definition, or is in the process of being instantiated).
void DiagnoseTemplateParameterShadow (SourceLocation Loc, Decl *PrevDecl, bool SupportedForCompatibility=false)
 DiagnoseTemplateParameterShadow - Produce a diagnostic complaining that the template parameter 'PrevDecl' is being shadowed by a new declaration at location Loc.
TemplateDeclAdjustDeclIfTemplate (Decl *&Decl)
 AdjustDeclIfTemplate - If the given decl happens to be a template, reset the parameter D to reference the templated declaration and return a pointer to the template declaration.
NamedDeclActOnTypeParameter (Scope *S, bool Typename, SourceLocation EllipsisLoc, SourceLocation KeyLoc, IdentifierInfo *ParamName, SourceLocation ParamNameLoc, unsigned Depth, unsigned Position, SourceLocation EqualLoc, ParsedType DefaultArg, bool HasTypeConstraint)
 ActOnTypeParameter - Called when a C++ template type parameter (e.g., "typename T") has been parsed.
bool CheckTypeConstraint (TemplateIdAnnotation *TypeConstraint)
bool ActOnTypeConstraint (const CXXScopeSpec &SS, TemplateIdAnnotation *TypeConstraint, TemplateTypeParmDecl *ConstrainedParameter, SourceLocation EllipsisLoc)
bool BuildTypeConstraint (const CXXScopeSpec &SS, TemplateIdAnnotation *TypeConstraint, TemplateTypeParmDecl *ConstrainedParameter, SourceLocation EllipsisLoc, bool AllowUnexpandedPack)
bool AttachTypeConstraint (NestedNameSpecifierLoc NS, DeclarationNameInfo NameInfo, TemplateDecl *NamedConcept, NamedDecl *FoundDecl, const TemplateArgumentListInfo *TemplateArgs, TemplateTypeParmDecl *ConstrainedParameter, SourceLocation EllipsisLoc)
 Attach a type-constraint to a template parameter.
bool AttachTypeConstraint (AutoTypeLoc TL, NonTypeTemplateParmDecl *NewConstrainedParm, NonTypeTemplateParmDecl *OrigConstrainedParm, SourceLocation EllipsisLoc)
bool RequireStructuralType (QualType T, SourceLocation Loc)
 Require the given type to be a structural type, and diagnose if it is not.
QualType CheckNonTypeTemplateParameterType (TypeSourceInfo *&TSI, SourceLocation Loc)
 Check that the type of a non-type template parameter is well-formed.
QualType CheckNonTypeTemplateParameterType (QualType T, SourceLocation Loc)
NamedDeclActOnNonTypeTemplateParameter (Scope *S, Declarator &D, unsigned Depth, unsigned Position, SourceLocation EqualLoc, Expr *DefaultArg)
NamedDeclActOnTemplateTemplateParameter (Scope *S, SourceLocation TmpLoc, TemplateNameKind Kind, bool TypenameKeyword, TemplateParameterList *Params, SourceLocation EllipsisLoc, IdentifierInfo *ParamName, SourceLocation ParamNameLoc, unsigned Depth, unsigned Position, SourceLocation EqualLoc, ParsedTemplateArgument DefaultArg)
 ActOnTemplateTemplateParameter - Called when a C++ template template parameter (e.g.
TemplateParameterListActOnTemplateParameterList (unsigned Depth, SourceLocation ExportLoc, SourceLocation TemplateLoc, SourceLocation LAngleLoc, ArrayRef< NamedDecl * > Params, SourceLocation RAngleLoc, Expr *RequiresClause)
 ActOnTemplateParameterList - Builds a TemplateParameterList, optionally constrained by RequiresClause, that contains the template parameters in Params.
bool CheckTemplateParameterList (TemplateParameterList *NewParams, TemplateParameterList *OldParams, TemplateParamListContext TPC, SkipBodyInfo *SkipBody=nullptr)
 Checks the validity of a template parameter list, possibly considering the template parameter list from a previous declaration.
TemplateParameterListMatchTemplateParametersToScopeSpecifier (SourceLocation DeclStartLoc, SourceLocation DeclLoc, const CXXScopeSpec &SS, TemplateIdAnnotation *TemplateId, ArrayRef< TemplateParameterList * > ParamLists, bool IsFriend, bool &IsMemberSpecialization, bool &Invalid, bool SuppressDiagnostic=false)
 Match the given template parameter lists to the given scope specifier, returning the template parameter list that applies to the name.
TemplateParameterListGetTemplateParameterList (TemplateDecl *TD)
 Returns the template parameter list with all default template argument information.
DeclResult CheckClassTemplate (Scope *S, unsigned TagSpec, TagUseKind TUK, SourceLocation KWLoc, CXXScopeSpec &SS, IdentifierInfo *Name, SourceLocation NameLoc, const ParsedAttributesView &Attr, TemplateParameterList *TemplateParams, AccessSpecifier AS, SourceLocation ModulePrivateLoc, SourceLocation FriendLoc, unsigned NumOuterTemplateParamLists, TemplateParameterList **OuterTemplateParamLists, SkipBodyInfo *SkipBody=nullptr)
void translateTemplateArguments (const ASTTemplateArgsPtr &In, TemplateArgumentListInfo &Out)
 Translates template arguments as provided by the parser into template arguments used by semantic analysis.
ParsedTemplateArgument ActOnTemplateTypeArgument (TypeResult ParsedType)
 Convert a parsed type into a parsed template argument.
void NoteAllFoundTemplates (TemplateName Name)
QualType CheckTemplateIdType (ElaboratedTypeKeyword Keyword, TemplateName Template, SourceLocation TemplateLoc, TemplateArgumentListInfo &TemplateArgs, Scope *Scope, bool ForNestedNameSpecifier)
TypeResult ActOnTemplateIdType (Scope *S, ElaboratedTypeKeyword ElaboratedKeyword, SourceLocation ElaboratedKeywordLoc, CXXScopeSpec &SS, SourceLocation TemplateKWLoc, TemplateTy Template, const IdentifierInfo *TemplateII, SourceLocation TemplateIILoc, SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgs, SourceLocation RAngleLoc, bool IsCtorOrDtorName=false, bool IsClassName=false, ImplicitTypenameContext AllowImplicitTypename=ImplicitTypenameContext::No)
TypeResult ActOnTagTemplateIdType (TagUseKind TUK, TypeSpecifierType TagSpec, SourceLocation TagLoc, CXXScopeSpec &SS, SourceLocation TemplateKWLoc, TemplateTy TemplateD, SourceLocation TemplateLoc, SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgsIn, SourceLocation RAngleLoc)
 Parsed an elaborated-type-specifier that refers to a template-id, such as class T::template apply.
DeclResult ActOnVarTemplateSpecialization (Scope *S, Declarator &D, TypeSourceInfo *TSI, LookupResult &Previous, SourceLocation TemplateKWLoc, TemplateParameterList *TemplateParams, StorageClass SC, bool IsPartialSpecialization)
DeclResult CheckVarTemplateId (VarTemplateDecl *Template, SourceLocation TemplateLoc, SourceLocation TemplateNameLoc, const TemplateArgumentListInfo &TemplateArgs, bool SetWrittenArgs)
 Get the specialization of the given variable template corresponding to the specified argument list, or a null-but-valid result if the arguments are dependent.
ExprResult CheckVarTemplateId (const CXXScopeSpec &SS, const DeclarationNameInfo &NameInfo, VarTemplateDecl *Template, NamedDecl *FoundD, SourceLocation TemplateLoc, const TemplateArgumentListInfo *TemplateArgs)
 Form a reference to the specialization of the given variable template corresponding to the specified argument list, or a null-but-valid result if the arguments are dependent.
ExprResult CheckVarOrConceptTemplateTemplateId (const CXXScopeSpec &SS, const DeclarationNameInfo &NameInfo, TemplateTemplateParmDecl *Template, SourceLocation TemplateLoc, const TemplateArgumentListInfo *TemplateArgs)
ExprResult CheckConceptTemplateId (const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, const DeclarationNameInfo &ConceptNameInfo, NamedDecl *FoundDecl, TemplateDecl *NamedConcept, const TemplateArgumentListInfo *TemplateArgs, bool DoCheckConstraintSatisfaction=true)
void diagnoseMissingTemplateArguments (TemplateName Name, SourceLocation Loc)
void diagnoseMissingTemplateArguments (const CXXScopeSpec &SS, bool TemplateKeyword, TemplateDecl *TD, SourceLocation Loc)
ExprResult BuildTemplateIdExpr (const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, LookupResult &R, bool RequiresADL, const TemplateArgumentListInfo *TemplateArgs)
ExprResult BuildQualifiedTemplateIdExpr (CXXScopeSpec &SS, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs, bool IsAddressOfOperand)
UnsignedOrNone getPackIndex (TemplateArgument Pack) const
TemplateArgument getPackSubstitutedTemplateArgument (TemplateArgument Arg) const
ExprResult BuildSubstNonTypeTemplateParmExpr (Decl *AssociatedDecl, const NonTypeTemplateParmDecl *NTTP, SourceLocation loc, TemplateArgument Replacement, UnsignedOrNone PackIndex, bool Final)
TemplateNameKind ActOnTemplateName (Scope *S, CXXScopeSpec &SS, SourceLocation TemplateKWLoc, const UnqualifiedId &Name, ParsedType ObjectType, bool EnteringContext, TemplateTy &Template, bool AllowInjectedClassName=false)
 Form a template name from a name that is syntactically required to name a template, either due to use of the 'template' keyword or because a name in this syntactic context is assumed to name a template (C++ [temp.names]p2-4).
DeclResult ActOnClassTemplateSpecialization (Scope *S, unsigned TagSpec, TagUseKind TUK, SourceLocation KWLoc, SourceLocation ModulePrivateLoc, CXXScopeSpec &SS, TemplateIdAnnotation &TemplateId, const ParsedAttributesView &Attr, MultiTemplateParamsArg TemplateParameterLists, SkipBodyInfo *SkipBody=nullptr)
bool CheckTemplatePartialSpecializationArgs (SourceLocation Loc, TemplateDecl *PrimaryTemplate, unsigned NumExplicitArgs, ArrayRef< TemplateArgument > Args)
 Check the non-type template arguments of a class template partial specialization according to C++ [temp.class.spec]p9.
void CheckTemplatePartialSpecialization (ClassTemplatePartialSpecializationDecl *Partial)
void CheckTemplatePartialSpecialization (VarTemplatePartialSpecializationDecl *Partial)
DeclActOnTemplateDeclarator (Scope *S, MultiTemplateParamsArg TemplateParameterLists, Declarator &D)
bool CheckSpecializationInstantiationRedecl (SourceLocation NewLoc, TemplateSpecializationKind ActOnExplicitInstantiationNewTSK, NamedDecl *PrevDecl, TemplateSpecializationKind PrevTSK, SourceLocation PrevPtOfInstantiation, bool &SuppressNew)
 Diagnose cases where we have an explicit template specialization before/after an explicit template instantiation, producing diagnostics for those cases where they are required and determining whether the new specialization/instantiation will have any effect.
bool CheckDependentFunctionTemplateSpecialization (FunctionDecl *FD, const TemplateArgumentListInfo *ExplicitTemplateArgs, LookupResult &Previous)
 Perform semantic analysis for the given dependent function template specialization.
bool CheckFunctionTemplateSpecialization (FunctionDecl *FD, TemplateArgumentListInfo *ExplicitTemplateArgs, LookupResult &Previous, bool QualifiedFriend=false)
 Perform semantic analysis for the given function template specialization.
bool CheckMemberSpecialization (NamedDecl *Member, LookupResult &Previous)
 Perform semantic analysis for the given non-template member specialization.
void CompleteMemberSpecialization (NamedDecl *Member, LookupResult &Previous)
DeclResult ActOnExplicitInstantiation (Scope *S, SourceLocation ExternLoc, SourceLocation TemplateLoc, unsigned TagSpec, SourceLocation KWLoc, const CXXScopeSpec &SS, TemplateTy Template, SourceLocation TemplateNameLoc, SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgs, SourceLocation RAngleLoc, const ParsedAttributesView &Attr)
DeclResult ActOnExplicitInstantiation (Scope *S, SourceLocation ExternLoc, SourceLocation TemplateLoc, unsigned TagSpec, SourceLocation KWLoc, CXXScopeSpec &SS, IdentifierInfo *Name, SourceLocation NameLoc, const ParsedAttributesView &Attr)
DeclResult ActOnExplicitInstantiation (Scope *S, SourceLocation ExternLoc, SourceLocation TemplateLoc, Declarator &D)
TemplateArgumentLoc SubstDefaultTemplateArgumentIfAvailable (TemplateDecl *Template, SourceLocation TemplateKWLoc, SourceLocation TemplateNameLoc, SourceLocation RAngleLoc, Decl *Param, ArrayRef< TemplateArgument > SugaredConverted, ArrayRef< TemplateArgument > CanonicalConverted, bool &HasDefaultArg)
 If the given template parameter has a default template argument, substitute into that default template argument and return the corresponding template argument.
SourceLocation getTopMostPointOfInstantiation (const NamedDecl *) const
 Returns the top most location responsible for the definition of N.
bool CheckTemplateArgument (NamedDecl *Param, TemplateArgumentLoc &Arg, NamedDecl *Template, SourceLocation TemplateLoc, SourceLocation RAngleLoc, unsigned ArgumentPackIndex, CheckTemplateArgumentInfo &CTAI, CheckTemplateArgumentKind CTAK)
 Check that the given template argument corresponds to the given template parameter.
bool CheckTemplateArgumentList (TemplateDecl *Template, SourceLocation TemplateLoc, TemplateArgumentListInfo &TemplateArgs, const DefaultArguments &DefaultArgs, bool PartialTemplateArgs, CheckTemplateArgumentInfo &CTAI, bool UpdateArgsWithConversions=true, bool *ConstraintsNotSatisfied=nullptr)
 Check that the given template arguments can be provided to the given template, converting the arguments along the way.
bool CheckTemplateArgumentList (TemplateDecl *Template, TemplateParameterList *Params, SourceLocation TemplateLoc, TemplateArgumentListInfo &TemplateArgs, const DefaultArguments &DefaultArgs, bool PartialTemplateArgs, CheckTemplateArgumentInfo &CTAI, bool UpdateArgsWithConversions=true, bool *ConstraintsNotSatisfied=nullptr)
 Check that the given template argument list is well-formed for specializing the given template.
bool CheckTemplateTypeArgument (TemplateTypeParmDecl *Param, TemplateArgumentLoc &Arg, SmallVectorImpl< TemplateArgument > &SugaredConverted, SmallVectorImpl< TemplateArgument > &CanonicalConverted)
bool CheckTemplateArgument (TypeSourceInfo *Arg)
 Check a template argument against its corresponding template type parameter.
ExprResult CheckTemplateArgument (NamedDecl *Param, QualType InstantiatedParamType, Expr *Arg, TemplateArgument &SugaredConverted, TemplateArgument &CanonicalConverted, bool StrictCheck, CheckTemplateArgumentKind CTAK)
 Check a template argument against its corresponding non-type template parameter.
bool CheckTemplateTemplateArgument (TemplateTemplateParmDecl *Param, TemplateParameterList *Params, TemplateArgumentLoc &Arg, bool PartialOrdering, bool *StrictPackMatch)
 Check a template argument against its corresponding template template parameter.
bool CheckDeclCompatibleWithTemplateTemplate (TemplateDecl *Template, TemplateTemplateParmDecl *Param, const TemplateArgumentLoc &Arg)
void NoteTemplateLocation (const NamedDecl &Decl, std::optional< SourceRange > ParamRange={})
void NoteTemplateParameterLocation (const NamedDecl &Decl)
ExprResult BuildExpressionFromDeclTemplateArgument (const TemplateArgument &Arg, QualType ParamType, SourceLocation Loc, NamedDecl *TemplateParam=nullptr)
 Given a non-type template argument that refers to a declaration and the type of its corresponding non-type template parameter, produce an expression that properly refers to that declaration.
ExprResult BuildExpressionFromNonTypeTemplateArgument (const TemplateArgument &Arg, SourceLocation Loc)
bool TemplateParameterListsAreEqual (const TemplateCompareNewDeclInfo &NewInstFrom, TemplateParameterList *New, const NamedDecl *OldInstFrom, TemplateParameterList *Old, bool Complain, TemplateParameterListEqualKind Kind, SourceLocation TemplateArgLoc=SourceLocation())
 Determine whether the given template parameter lists are equivalent.
bool TemplateParameterListsAreEqual (TemplateParameterList *New, TemplateParameterList *Old, bool Complain, TemplateParameterListEqualKind Kind, SourceLocation TemplateArgLoc=SourceLocation())
bool CheckTemplateDeclScope (Scope *S, TemplateParameterList *TemplateParams)
 Check whether a template can be declared within this scope.
TypeResult ActOnTypenameType (Scope *S, SourceLocation TypenameLoc, const CXXScopeSpec &SS, const IdentifierInfo &II, SourceLocation IdLoc, ImplicitTypenameContext IsImplicitTypename=ImplicitTypenameContext::No)
 Called when the parser has parsed a C++ typename specifier, e.g., "typename T::type".
TypeResult ActOnTypenameType (Scope *S, SourceLocation TypenameLoc, const CXXScopeSpec &SS, SourceLocation TemplateLoc, TemplateTy TemplateName, const IdentifierInfo *TemplateII, SourceLocation TemplateIILoc, SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgs, SourceLocation RAngleLoc)
 Called when the parser has parsed a C++ typename specifier that ends in a template-id, e.g., "typename MetaFun::template apply<T1, T2>".
QualType CheckTypenameType (ElaboratedTypeKeyword Keyword, SourceLocation KeywordLoc, NestedNameSpecifierLoc QualifierLoc, const IdentifierInfo &II, SourceLocation IILoc, TypeSourceInfo **TSI, bool DeducedTSTContext)
QualType CheckTypenameType (ElaboratedTypeKeyword Keyword, SourceLocation KeywordLoc, NestedNameSpecifierLoc QualifierLoc, const IdentifierInfo &II, SourceLocation IILoc, bool DeducedTSTContext=true)
 Build the type that describes a C++ typename specifier, e.g., "typename T::type".
TypeSourceInfoRebuildTypeInCurrentInstantiation (TypeSourceInfo *T, SourceLocation Loc, DeclarationName Name)
 Rebuilds a type within the context of the current instantiation.
bool RebuildNestedNameSpecifierInCurrentInstantiation (CXXScopeSpec &SS)
ExprResult RebuildExprInCurrentInstantiation (Expr *E)
bool RebuildTemplateParamsInCurrentInstantiation (TemplateParameterList *Params)
 Rebuild the template parameters now that we know we're in a current instantiation.
std::string getTemplateArgumentBindingsText (const TemplateParameterList *Params, const TemplateArgumentList &Args)
 Produces a formatted string that describes the binding of template parameters to template arguments.
std::string getTemplateArgumentBindingsText (const TemplateParameterList *Params, const TemplateArgument *Args, unsigned NumArgs)
void diagnoseExprIntendedAsTemplateName (Scope *S, ExprResult TemplateName, SourceLocation Less, SourceLocation Greater)
ExprResult ActOnDependentIdExpression (const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, bool isAddressOfOperand, const TemplateArgumentListInfo *TemplateArgs)
 ActOnDependentIdExpression - Handle a dependent id-expression that was just parsed.
ExprResult BuildDependentDeclRefExpr (const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs)
bool ConstraintExpressionDependsOnEnclosingTemplate (const FunctionDecl *Friend, unsigned TemplateDepth, const Expr *Constraint)
std::pair< Expr *, std::string > findFailedBooleanCondition (Expr *Cond)
 Find the failed Boolean condition within a given Boolean constant expression, and describe it with a string.
void CheckDeductionGuideTemplate (FunctionTemplateDecl *TD)
ConceptDeclActOnStartConceptDefinition (Scope *S, MultiTemplateParamsArg TemplateParameterLists, const IdentifierInfo *Name, SourceLocation NameLoc)
ConceptDeclActOnFinishConceptDefinition (Scope *S, ConceptDecl *C, Expr *ConstraintExpr, const ParsedAttributesView &Attrs)
void CheckConceptRedefinition (ConceptDecl *NewDecl, LookupResult &Previous, bool &AddToScope)
bool CheckConceptUseInDefinition (NamedDecl *Concept, SourceLocation Loc)
TypeResult ActOnDependentTag (Scope *S, unsigned TagSpec, TagUseKind TUK, const CXXScopeSpec &SS, const IdentifierInfo *Name, SourceLocation TagLoc, SourceLocation NameLoc)
void MarkAsLateParsedTemplate (FunctionDecl *FD, Decl *FnD, CachedTokens &Toks)
void UnmarkAsLateParsedTemplate (FunctionDecl *FD)
bool IsInsideALocalClassWithinATemplateFunction ()
void checkSpecializationVisibility (SourceLocation Loc, NamedDecl *Spec)
 We've found a use of a templated declaration that would trigger an implicit instantiation.
void checkSpecializationReachability (SourceLocation Loc, NamedDecl *Spec)
static NamedDeclgetAsTemplateNameDecl (NamedDecl *D, bool AllowFunctionTemplates=true, bool AllowDependent=true)
 Try to interpret the lookup result D as a template-name.

C++ Variadic Templates

Implementations are in SemaTemplateVariadic.cpp

enum  UnexpandedParameterPackContext {
  UPPC_Expression = 0 , UPPC_BaseType , UPPC_DeclarationType , UPPC_DataMemberType ,
  UPPC_BitFieldWidth , UPPC_StaticAssertExpression , UPPC_FixedUnderlyingType , UPPC_EnumeratorValue ,
  UPPC_UsingDeclaration , UPPC_FriendDeclaration , UPPC_DeclarationQualifier , UPPC_Initializer ,
  UPPC_DefaultArgument , UPPC_NonTypeTemplateParameterType , UPPC_ExceptionType , UPPC_ExplicitSpecialization ,
  UPPC_PartialSpecialization , UPPC_IfExists , UPPC_IfNotExists , UPPC_Lambda ,
  UPPC_Block , UPPC_TypeConstraint , UPPC_Requirement , UPPC_RequiresClause
}
 The context in which an unexpanded parameter pack is being diagnosed. More...
bool isUnexpandedParameterPackPermitted ()
 Determine whether an unexpanded parameter pack might be permitted in this location.
bool DiagnoseUnexpandedParameterPacks (SourceLocation Loc, UnexpandedParameterPackContext UPPC, ArrayRef< UnexpandedParameterPack > Unexpanded)
 Diagnose unexpanded parameter packs.
bool DiagnoseUnexpandedParameterPack (SourceLocation Loc, TypeSourceInfo *T, UnexpandedParameterPackContext UPPC)
 If the given type contains an unexpanded parameter pack, diagnose the error.
bool DiagnoseUnexpandedParameterPack (Expr *E, UnexpandedParameterPackContext UPPC=UPPC_Expression)
 If the given expression contains an unexpanded parameter pack, diagnose the error.
bool DiagnoseUnexpandedParameterPackInRequiresExpr (RequiresExpr *RE)
 If the given requirees-expression contains an unexpanded reference to one of its own parameter packs, diagnose the error.
bool DiagnoseUnexpandedParameterPack (const CXXScopeSpec &SS, UnexpandedParameterPackContext UPPC)
 If the given nested-name-specifier contains an unexpanded parameter pack, diagnose the error.
bool DiagnoseUnexpandedParameterPack (const DeclarationNameInfo &NameInfo, UnexpandedParameterPackContext UPPC)
 If the given name contains an unexpanded parameter pack, diagnose the error.
bool DiagnoseUnexpandedParameterPack (SourceLocation Loc, TemplateName Template, UnexpandedParameterPackContext UPPC)
 If the given template name contains an unexpanded parameter pack, diagnose the error.
bool DiagnoseUnexpandedParameterPack (TemplateArgumentLoc Arg, UnexpandedParameterPackContext UPPC)
 If the given template argument contains an unexpanded parameter pack, diagnose the error.
void collectUnexpandedParameterPacks (TemplateArgument Arg, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded)
 Collect the set of unexpanded parameter packs within the given template argument.
void collectUnexpandedParameterPacks (TemplateArgumentLoc Arg, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded)
 Collect the set of unexpanded parameter packs within the given template argument.
void collectUnexpandedParameterPacks (QualType T, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded)
 Collect the set of unexpanded parameter packs within the given type.
void collectUnexpandedParameterPacks (TypeLoc TL, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded)
 Collect the set of unexpanded parameter packs within the given type.
void collectUnexpandedParameterPacks (NestedNameSpecifierLoc NNS, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded)
 Collect the set of unexpanded parameter packs within the given nested-name-specifier.
void collectUnexpandedParameterPacks (const DeclarationNameInfo &NameInfo, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded)
 Collect the set of unexpanded parameter packs within the given name.
ParsedTemplateArgument ActOnTemplateTemplateArgument (const ParsedTemplateArgument &Arg)
 Invoked when parsing a template argument.
ParsedTemplateArgument ActOnPackExpansion (const ParsedTemplateArgument &Arg, SourceLocation EllipsisLoc)
 Invoked when parsing a template argument followed by an ellipsis, which creates a pack expansion.
TypeResult ActOnPackExpansion (ParsedType Type, SourceLocation EllipsisLoc)
 Invoked when parsing a type followed by an ellipsis, which creates a pack expansion.
TypeSourceInfoCheckPackExpansion (TypeSourceInfo *Pattern, SourceLocation EllipsisLoc, UnsignedOrNone NumExpansions)
 Construct a pack expansion type from the pattern of the pack expansion.
QualType CheckPackExpansion (QualType Pattern, SourceRange PatternRange, SourceLocation EllipsisLoc, UnsignedOrNone NumExpansions)
 Construct a pack expansion type from the pattern of the pack expansion.
ExprResult ActOnPackExpansion (Expr *Pattern, SourceLocation EllipsisLoc)
 Invoked when parsing an expression followed by an ellipsis, which creates a pack expansion.
ExprResult CheckPackExpansion (Expr *Pattern, SourceLocation EllipsisLoc, UnsignedOrNone NumExpansions)
 Invoked when parsing an expression followed by an ellipsis, which creates a pack expansion.
bool CheckParameterPacksForExpansion (SourceLocation EllipsisLoc, SourceRange PatternRange, ArrayRef< UnexpandedParameterPack > Unexpanded, const MultiLevelTemplateArgumentList &TemplateArgs, bool FailOnPackProducingTemplates, bool &ShouldExpand, bool &RetainExpansion, UnsignedOrNone &NumExpansions, bool Diagnose=true)
 Determine whether we could expand a pack expansion with the given set of parameter packs into separate arguments by repeatedly transforming the pattern.
UnsignedOrNone getNumArgumentsInExpansion (QualType T, const MultiLevelTemplateArgumentList &TemplateArgs)
 Determine the number of arguments in the given pack expansion type.
UnsignedOrNone getNumArgumentsInExpansionFromUnexpanded (llvm::ArrayRef< UnexpandedParameterPack > Unexpanded, const MultiLevelTemplateArgumentList &TemplateArgs)
bool containsUnexpandedParameterPacks (Declarator &D)
 Determine whether the given declarator contains any unexpanded parameter packs.
TemplateArgumentLoc getTemplateArgumentPackExpansionPattern (TemplateArgumentLoc OrigLoc, SourceLocation &Ellipsis, UnsignedOrNone &NumExpansions) const
 Returns the pattern of the pack expansion for a template argument.
UnsignedOrNone getFullyPackExpandedSize (TemplateArgument Arg)
 Given a template argument that contains an unexpanded parameter pack, but which has already been substituted, attempt to determine the number of elements that will be produced once this argument is fully-expanded.
ExprResult ActOnSizeofParameterPackExpr (Scope *S, SourceLocation OpLoc, IdentifierInfo &Name, SourceLocation NameLoc, SourceLocation RParenLoc)
 Called when an expression computing the size of a parameter pack is parsed.
ExprResult ActOnPackIndexingExpr (Scope *S, Expr *PackExpression, SourceLocation EllipsisLoc, SourceLocation LSquareLoc, Expr *IndexExpr, SourceLocation RSquareLoc)
ExprResult BuildPackIndexingExpr (Expr *PackExpression, SourceLocation EllipsisLoc, Expr *IndexExpr, SourceLocation RSquareLoc, ArrayRef< Expr * > ExpandedExprs={}, bool FullySubstituted=false)
ExprResult ActOnCXXFoldExpr (Scope *S, SourceLocation LParenLoc, Expr *LHS, tok::TokenKind Operator, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc)
 Handle a C++1z fold-expression: ( expr op ... op expr ).
ExprResult BuildCXXFoldExpr (UnresolvedLookupExpr *Callee, SourceLocation LParenLoc, Expr *LHS, BinaryOperatorKind Operator, SourceLocation EllipsisLoc, Expr *RHS, SourceLocation RParenLoc, UnsignedOrNone NumExpansions)
ExprResult BuildEmptyCXXFoldExpr (SourceLocation EllipsisLoc, BinaryOperatorKind Operator)
static void collectUnexpandedParameterPacks (Expr *E, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded)
 Collect the set of unexpanded parameter packs within the given expression.

Types

Implementations are in SemaType.cpp

enum class  CompleteTypeKind { Normal , AcceptSizeless , Default = AcceptSizeless }
using UTTKind = UnaryTransformType::UTTKind
FileNullabilityMap NullabilityMap
 A mapping that describes the nullability we've seen in each header file.
QualType BuildQualifiedType (QualType T, SourceLocation Loc, Qualifiers Qs, const DeclSpec *DS=nullptr)
QualType BuildQualifiedType (QualType T, SourceLocation Loc, unsigned CVRA, const DeclSpec *DS=nullptr)
QualType BuildPointerType (QualType T, SourceLocation Loc, DeclarationName Entity)
 Build a pointer type.
QualType BuildReferenceType (QualType T, bool LValueRef, SourceLocation Loc, DeclarationName Entity)
 Build a reference type.
QualType BuildArrayType (QualType T, ArraySizeModifier ASM, Expr *ArraySize, unsigned Quals, SourceRange Brackets, DeclarationName Entity)
 Build an array type.
QualType BuildVectorType (QualType T, Expr *VecSize, SourceLocation AttrLoc)
QualType BuildExtVectorType (QualType T, Expr *ArraySize, SourceLocation AttrLoc)
 Build an ext-vector type.
QualType BuildMatrixType (QualType T, Expr *NumRows, Expr *NumColumns, SourceLocation AttrLoc)
QualType BuildCountAttributedArrayOrPointerType (QualType WrappedTy, Expr *CountExpr, bool CountInBytes, bool OrNull)
QualType BuildAddressSpaceAttr (QualType &T, LangAS ASIdx, Expr *AddrSpace, SourceLocation AttrLoc)
 BuildAddressSpaceAttr - Builds a DependentAddressSpaceType if an expression is uninstantiated.
QualType BuildAddressSpaceAttr (QualType &T, Expr *AddrSpace, SourceLocation AttrLoc)
 Same as above, but constructs the AddressSpace index if not provided.
bool CheckQualifiedFunctionForTypeId (QualType T, SourceLocation Loc)
bool CheckFunctionReturnType (QualType T, SourceLocation Loc)
QualType BuildFunctionType (QualType T, MutableArrayRef< QualType > ParamTypes, SourceLocation Loc, DeclarationName Entity, const FunctionProtoType::ExtProtoInfo &EPI)
 Build a function type.
QualType BuildMemberPointerType (QualType T, const CXXScopeSpec &SS, CXXRecordDecl *Cls, SourceLocation Loc, DeclarationName Entity)
 Build a member pointer type T Class::*.
QualType BuildBlockPointerType (QualType T, SourceLocation Loc, DeclarationName Entity)
 Build a block pointer type.
QualType BuildParenType (QualType T)
 Build a paren type including T.
QualType BuildAtomicType (QualType T, SourceLocation Loc)
QualType BuildReadPipeType (QualType T, SourceLocation Loc)
 Build a Read-only Pipe type.
QualType BuildWritePipeType (QualType T, SourceLocation Loc)
 Build a Write-only Pipe type.
QualType BuildBitIntType (bool IsUnsigned, Expr *BitWidth, SourceLocation Loc)
 Build a bit-precise integer type.
TypeSourceInfoGetTypeForDeclarator (Declarator &D)
 GetTypeForDeclarator - Convert the type for the specified declarator to Type instances.
TypeSourceInfoGetTypeForDeclaratorCast (Declarator &D, QualType FromTy)
ParsedType CreateParsedType (QualType T, TypeSourceInfo *TInfo)
 Package the given type and TSI into a ParsedType.
TypeResult ActOnTypeName (Declarator &D)
bool checkArrayElementAlignment (QualType EltTy, SourceLocation Loc)
void diagnoseIgnoredQualifiers (unsigned DiagID, unsigned Quals, SourceLocation FallbackLoc, SourceLocation ConstQualLoc=SourceLocation(), SourceLocation VolatileQualLoc=SourceLocation(), SourceLocation RestrictQualLoc=SourceLocation(), SourceLocation AtomicQualLoc=SourceLocation(), SourceLocation UnalignedQualLoc=SourceLocation())
IdentifierInfogetNullabilityKeyword (NullabilityKind nullability)
 Retrieve the keyword associated.
void adjustMemberFunctionCC (QualType &T, bool HasThisPointer, bool IsCtorOrDtor, SourceLocation Loc)
 Adjust the calling convention of a method to be the ABI default if it wasn't specified explicitly.
bool hasExplicitCallingConv (QualType T)
bool CheckImplicitNullabilityTypeSpecifier (QualType &Type, NullabilityKind Nullability, SourceLocation DiagLoc, bool AllowArrayTypes, bool OverrideExisting)
 Check whether a nullability type specifier can be added to the given type through some means not written in source (e.g.
QualType getCompletedType (Expr *E)
 Get the type of expression E, triggering instantiation to complete the type if necessary – that is, if the expression refers to a templated static data member of incomplete array type.
void completeExprArrayBound (Expr *E)
bool RequireCompleteExprType (Expr *E, CompleteTypeKind Kind, TypeDiagnoser &Diagnoser)
 Ensure that the type of the given expression is complete.
bool RequireCompleteExprType (Expr *E, unsigned DiagID)
template<typename... Ts>
bool RequireCompleteExprType (Expr *E, unsigned DiagID, const Ts &...Args)
QualType getDecltypeForExpr (Expr *E)
 getDecltypeForExpr - Given an expr, will return the decltype for that expression, according to the rules in C++11 [dcl.type.simple]p4 and C++11 [expr.lambda.prim]p18.
QualType BuildTypeofExprType (Expr *E, TypeOfKind Kind)
QualType BuildDecltypeType (Expr *E, bool AsUnevaluated=true)
 If AsUnevaluated is false, E is treated as though it were an evaluated context, such as when building a type for decltype(auto).
QualType ActOnPackIndexingType (QualType Pattern, Expr *IndexExpr, SourceLocation Loc, SourceLocation EllipsisLoc)
QualType BuildPackIndexingType (QualType Pattern, Expr *IndexExpr, SourceLocation Loc, SourceLocation EllipsisLoc, bool FullySubstituted=false, ArrayRef< QualType > Expansions={})
QualType BuildUnaryTransformType (QualType BaseType, UTTKind UKind, SourceLocation Loc)
QualType BuiltinEnumUnderlyingType (QualType BaseType, SourceLocation Loc)
QualType BuiltinAddPointer (QualType BaseType, SourceLocation Loc)
QualType BuiltinRemovePointer (QualType BaseType, SourceLocation Loc)
QualType BuiltinDecay (QualType BaseType, SourceLocation Loc)
QualType BuiltinAddReference (QualType BaseType, UTTKind UKind, SourceLocation Loc)
QualType BuiltinRemoveExtent (QualType BaseType, UTTKind UKind, SourceLocation Loc)
QualType BuiltinRemoveReference (QualType BaseType, UTTKind UKind, SourceLocation Loc)
QualType BuiltinRemoveCVRef (QualType BaseType, SourceLocation Loc)
QualType BuiltinChangeCVRQualifiers (QualType BaseType, UTTKind UKind, SourceLocation Loc)
QualType BuiltinChangeSignedness (QualType BaseType, UTTKind UKind, SourceLocation Loc)
bool BuiltinIsBaseOf (SourceLocation RhsTLoc, QualType LhsT, QualType RhsT)
bool RequireLiteralType (SourceLocation Loc, QualType T, TypeDiagnoser &Diagnoser)
 Ensure that the type T is a literal type.
bool RequireLiteralType (SourceLocation Loc, QualType T, unsigned DiagID)
template<typename... Ts>
bool RequireLiteralType (SourceLocation Loc, QualType T, unsigned DiagID, const Ts &...Args)
bool isCompleteType (SourceLocation Loc, QualType T, CompleteTypeKind Kind=CompleteTypeKind::Default)
bool RequireCompleteType (SourceLocation Loc, QualType T, CompleteTypeKind Kind, TypeDiagnoser &Diagnoser)
 Ensure that the type T is a complete type.
bool RequireCompleteType (SourceLocation Loc, QualType T, CompleteTypeKind Kind, unsigned DiagID)
bool RequireCompleteType (SourceLocation Loc, QualType T, TypeDiagnoser &Diagnoser)
bool RequireCompleteType (SourceLocation Loc, QualType T, unsigned DiagID)
template<typename... Ts>
bool RequireCompleteType (SourceLocation Loc, QualType T, unsigned DiagID, const Ts &...Args)
bool isVisible (const NamedDecl *D)
 Determine whether a declaration is visible to name lookup.
bool isReachable (const NamedDecl *D)
 Determine whether a declaration is reachable.
bool isAcceptable (const NamedDecl *D, AcceptableKind Kind)
 Determine whether a declaration is acceptable (visible/reachable).
bool hasStructuralCompatLayout (Decl *D, Decl *Suggested)
 Determine if D and Suggested have a structurally compatible layout as described in C11 6.2.7/1.
bool hasVisibleDefinition (NamedDecl *D, NamedDecl **Suggested, bool OnlyNeedComplete=false)
 Determine if D has a visible definition.
bool hasVisibleDefinition (const NamedDecl *D)
bool isRedefinitionAllowedFor (NamedDecl *D, NamedDecl **Suggested, bool &Visible)
 Determine if D has a definition which allows we redefine it in current TU.
bool isRedefinitionAllowedFor (const NamedDecl *D, bool &Visible)
bool hasReachableDefinition (NamedDecl *D, NamedDecl **Suggested, bool OnlyNeedComplete=false)
 Determine if D has a reachable definition.
bool hasReachableDefinition (NamedDecl *D)
bool hasAcceptableDefinition (NamedDecl *D, NamedDecl **Suggested, AcceptableKind Kind, bool OnlyNeedComplete=false)
bool hasAcceptableDefinition (NamedDecl *D, AcceptableKind Kind)
std::optional< FunctionEffectModeActOnEffectExpression (Expr *CondExpr, StringRef AttributeName)
 Try to parse the conditional expression attached to an effect attribute (e.g.
void ActOnCleanupAttr (Decl *D, const Attr *A)
static int getPrintable (int I)
static unsigned getPrintable (unsigned I)
static bool getPrintable (bool B)
static const char * getPrintable (const char *S)
static StringRef getPrintable (StringRef S)
static const std::string & getPrintable (const std::string &S)
static const IdentifierInfogetPrintable (const IdentifierInfo *II)
static DeclarationName getPrintable (DeclarationName N)
static QualType getPrintable (QualType T)
static SourceRange getPrintable (SourceRange R)
static SourceRange getPrintable (SourceLocation L)
static SourceRange getPrintable (const Expr *E)
static SourceRange getPrintable (TypeLoc TL)
static QualType GetTypeFromParser (ParsedType Ty, TypeSourceInfo **TInfo=nullptr)

Semantic Analysis

Implementations are in Sema.cpp

typedef std::pair< SourceLocation, boolDeleteExprLoc
typedef llvm::SmallVector< DeleteExprLoc, 4 > DeleteLocs
using PoppedFunctionScopePtr
typedef OpaquePtr< DeclGroupRefDeclGroupPtrTy
typedef OpaquePtr< TemplateNameTemplateTy
typedef OpaquePtr< QualTypeTypeTy
typedef void LateTemplateParserCB(void *P, LateParsedTemplate &LPT)
 Callback to the parser to parse templated functions when needed.
typedef DelayedDiagnosticsState ParsingDeclState
typedef DelayedDiagnosticsState ProcessingContextState
static const unsigned MaxAlignmentExponent = 32
 The maximum alignment, same as in llvm::Value.
static const uint64_t MaximumAlignment = 1ull << MaxAlignmentExponent
bool CollectStats
 Flag indicating whether or not to collect detailed statistics.
std::unique_ptr< sema::FunctionScopeInfoCachedFunctionScope
SmallVector< sema::FunctionScopeInfo *, 4 > FunctionScopes
 Stack containing information about each of the nested function, block, and method scopes that are currently active.
unsigned FunctionScopesStart = 0
 The index of the first FunctionScope that corresponds to the current context.
unsigned CapturingFunctionScopes = 0
 Track the number of currently active capturing scopes.
llvm::BumpPtrAllocator BumpAlloc
const TranslationUnitKind TUKind
 The kind of translation unit we are processing.
ScopeTUScope
 Translation Unit Scope - useful to Objective-C actions that need to lookup file scope declarations in the "ordinary" C decl namespace.
OpenCLOptions OpenCLFeatures
FPOptions CurFPFeatures
const LangOptionsLangOpts
PreprocessorPP
ASTContextContext
ASTConsumerConsumer
DiagnosticsEngineDiags
SourceManagerSourceMgr
api_notes::APINotesManager APINotes
sema::AnalysisBasedWarnings AnalysisWarnings
 Worker object for performing CFG-based warnings.
threadSafety::BeforeSetThreadSafetyDeclCache
LateTemplateParserCBLateTemplateParser
void * OpaqueParser
std::function< TypeResult(StringRef, StringRef, SourceLocation)> ParseTypeFromStringCallback
 Callback to the parser to parse a type expressed as a string.
DeclarationName VAListTagName
 VAListTagName - The declaration name corresponding to __va_list_tag.
bool IsLastErrorImmediate = true
 Is the last error level diagnostic immediate.
class clang::Sema::DelayedDiagnostics DelayedDiagnostics
SemaDiagnosticBuilder::DeferredDiagnosticsType DeviceDeferredDiags
 Diagnostics that are emitted only if we discover that the given function must be codegen'ed.
DeclContextCurContext
 CurContext - This is the current declaration context of parsing.
IntrusiveRefCntPtr< ExternalSemaSourceExternalSource
 Source of additional semantic information.
class Parser
class InitializationSequence
class ASTReader
class ASTDeclReader
class ASTWriter
 Sema (Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer, TranslationUnitKind TUKind=TU_Complete, CodeCompleteConsumer *CompletionConsumer=nullptr)
 ~Sema ()
void Initialize ()
 Perform initialization that occurs after the parser has been initialized but before it parses anything.
 LLVM_DECLARE_VIRTUAL_ANCHOR_FUNCTION ()
 This virtual key function only exists to limit the emission of debug info describing the Sema class.
const LangOptionsgetLangOpts () const
OpenCLOptionsgetOpenCLOptions ()
FPOptionsgetCurFPFeatures ()
DiagnosticsEnginegetDiagnostics () const
SourceManagergetSourceManager () const
PreprocessorgetPreprocessor () const
ASTContextgetASTContext () const
ASTConsumergetASTConsumer () const
ASTMutationListenergetASTMutationListener () const
ExternalSemaSourcegetExternalSource () const
DarwinSDKInfogetDarwinSDKInfoForAvailabilityChecking (SourceLocation Loc, StringRef Platform)
DarwinSDKInfogetDarwinSDKInfoForAvailabilityChecking ()
void addExternalSource (IntrusiveRefCntPtr< ExternalSemaSource > E)
 Registers an external source.
void PrintStats () const
 Print out statistics about the semantic analysis.
void runWithSufficientStackSpace (SourceLocation Loc, llvm::function_ref< void()> Fn)
 Run some code with "sufficient" stack space.
LangAS getDefaultCXXMethodAddrSpace () const
 Returns default addr space for method qualifiers.
void LoadExternalWeakUndeclaredIdentifiers ()
 Load weak undeclared identifiers from the external source.
bool isExternalWithNoLinkageType (const ValueDecl *VD) const
 Determine if VD, which must be a variable or function, is an external symbol that nonetheless can't be referenced from outside this translation unit because its type has no linkage and it's not extern "C".
void getUndefinedButUsed (SmallVectorImpl< std::pair< NamedDecl *, SourceLocation > > &Undefined)
 Obtain a sorted list of functions that are undefined but ODR-used.
const llvm::MapVector< FieldDecl *, DeleteLocs > & getMismatchingDeleteExpressions () const
 Retrieves list of suspicious delete-expressions that will be checked at the end of translation unit.
void EmitDiagnostic (unsigned DiagID, const DiagnosticBuilder &DB)
 Cause the built diagnostic to be emitted on the DiagosticsEngine.
void addImplicitTypedef (StringRef Name, QualType T)
bool hasUncompilableErrorOccurred () const
 Whether uncompilable error has occurred.
bool findMacroSpelling (SourceLocation &loc, StringRef name)
 Looks through the macro-expansion chain for the given location, looking for a macro expansion with the given name.
SourceLocation getLocForEndOfToken (SourceLocation Loc, unsigned Offset=0)
 Calls Lexer::getLocForEndOfToken()
SourceRange getRangeForNextToken (SourceLocation Loc, bool IncludeMacros, bool IncludeComments, std::optional< tok::TokenKind > ExpectedToken=std::nullopt)
 Calls Lexer::findNextToken() to find the next token, and if the locations of both ends of the token can be resolved it return that range; Otherwise it returns an invalid SourceRange.
ModuleLoadergetModuleLoader () const
 Retrieve the module loader associated with the preprocessor.
IdentifierInfoInventAbbreviatedTemplateParameterTypeName (const IdentifierInfo *ParamName, unsigned Index)
 Invent a new identifier for parameters of abbreviated templates.
void emitAndClearUnusedLocalTypedefWarnings ()
void emitDeferredDiags ()
void ActOnStartOfTranslationUnit ()
 This is called before the very first declaration in the translation unit is parsed.
void ActOnEndOfTranslationUnit ()
 ActOnEndOfTranslationUnit - This is called at the very end of the translation unit when EOF is reached and all but the top-level scope is popped.
void ActOnEndOfTranslationUnitFragment (TUFragmentKind Kind)
ScopegetScopeForContext (DeclContext *Ctx)
 Determines the active Scope associated with the given declaration context.
void PushFunctionScope ()
 Enter a new function scope.
void PushBlockScope (Scope *BlockScope, BlockDecl *Block)
sema::LambdaScopeInfoPushLambdaScope ()
void RecordParsingTemplateParameterDepth (unsigned Depth)
 This is used to inform Sema what the current TemplateParameterDepth is during Parsing.
void PushCapturedRegionScope (Scope *RegionScope, CapturedDecl *CD, RecordDecl *RD, CapturedRegionKind K, unsigned OpenMPCaptureLevel=0)
PoppedFunctionScopePtr PopFunctionScopeInfo (const sema::AnalysisBasedWarnings::Policy *WP=nullptr, Decl *D=nullptr, QualType BlockType=QualType())
 Pop a function (or block or lambda or captured region) scope from the stack.
sema::FunctionScopeInfogetEnclosingFunction () const
void setFunctionHasBranchIntoScope ()
void setFunctionHasBranchProtectedScope ()
void setFunctionHasIndirectGoto ()
void setFunctionHasMustTail ()
void PushCompoundScope (bool IsStmtExpr)
void PopCompoundScope ()
bool hasAnyUnrecoverableErrorsInThisFunction () const
 Determine whether any errors occurred within this function/method/ block.
sema::BlockScopeInfogetCurBlock ()
 Retrieve the current block, if any.
sema::CapturingScopeInfogetEnclosingLambdaOrBlock () const
 Get the innermost lambda or block enclosing the current location, if any.
sema::LambdaScopeInfogetCurLambda (bool IgnoreNonLambdaCapturingScope=false)
 Retrieve the current lambda scope info, if any.
sema::LambdaScopeInfogetCurGenericLambda ()
 Retrieve the current generic lambda info, if any.
sema::CapturedRegionScopeInfogetCurCapturedRegion ()
 Retrieve the current captured region, if any.
void ActOnComment (SourceRange Comment)
ScopegetCurScope () const
 Retrieve the parser's current scope.
IdentifierInfogetSuperIdentifier () const
DeclContextgetCurLexicalContext () const
SemaDiagnosticBuilder targetDiag (SourceLocation Loc, unsigned DiagID, const FunctionDecl *FD=nullptr)
SemaDiagnosticBuilder targetDiag (SourceLocation Loc, const PartialDiagnostic &PD, const FunctionDecl *FD=nullptr)
void checkTypeSupport (QualType Ty, SourceLocation Loc, ValueDecl *D=nullptr)
 Check if the type is allowed to be used for the current target.
ExprResult ImpCastExprToType (Expr *E, QualType Type, CastKind CK, ExprValueKind VK=VK_PRValue, const CXXCastPath *BasePath=nullptr, CheckedConversionKind CCK=CheckedConversionKind::Implicit)
 ImpCastExprToType - If Expr is not of type 'Type', insert an implicit cast.
DeclContextgetFunctionLevelDeclContext (bool AllowLambda=false) const
 If AllowLambda is true, treat lambda as function.
FunctionDeclgetCurFunctionDecl (bool AllowLambda=false) const
 Returns a pointer to the innermost enclosing function, or nullptr if the current context is not inside a function.
ObjCMethodDeclgetCurMethodDecl ()
 getCurMethodDecl - If inside of a method body, this returns a pointer to the method decl for the method being parsed.
NamedDeclgetCurFunctionOrMethodDecl () const
 getCurFunctionOrMethodDecl - Return the Decl for the current ObjC method or C function we're in, otherwise return null.
void diagnoseNullableToNonnullConversion (QualType DstType, QualType SrcType, SourceLocation Loc)
 Warn if we're implicitly casting from a _Nullable pointer type to a _Nonnull one.
void diagnoseZeroToNullptrConversion (CastKind Kind, const Expr *E)
 Warn when implicitly casting 0 to nullptr.
void diagnoseFunctionEffectConversion (QualType DstType, QualType SrcType, SourceLocation Loc)
 Warn when implicitly changing function effects.
bool makeUnavailableInSystemHeader (SourceLocation loc, UnavailableAttr::ImplicitReason reason)
 makeUnavailableInSystemHeader - There is an error in the current context.
PrintingPolicy getPrintingPolicy () const
 Retrieve a suitable printing policy for diagnostics.
void ActOnTranslationUnitScope (Scope *S)
 Scope actions.
bool isDeclaratorFunctionLike (Declarator &D)
 Determine whether.
void incrementMSManglingNumber () const
bool tryToRecoverWithCall (ExprResult &E, const PartialDiagnostic &PD, bool ForceComplain=false, bool(*IsPlausibleResult)(QualType)=nullptr)
 Try to recover by turning the given expression into a call.
void addLifetimeBoundToImplicitThis (CXXMethodDecl *MD)
bool tryExprAsCall (Expr &E, QualType &ZeroArgCallReturnTy, UnresolvedSetImpl &NonTemplateOverloads)
 Figure out if an expression could be turned into a call.
sema::FunctionScopeInfogetCurFunction () const
void SetLateTemplateParser (LateTemplateParserCB *LTP, void *P)
ParsingDeclState PushParsingDeclaration (sema::DelayedDiagnosticPool &pool)
SemaAMDGPUAMDGPU ()
SemaARMARM ()
SemaAVRAVR ()
SemaBPFBPF ()
SemaCodeCompletionCodeCompletion ()
SemaCUDACUDA ()
SemaDirectXDirectX ()
SemaHLSLHLSL ()
SemaHexagonHexagon ()
SemaLoongArchLoongArch ()
SemaM68kM68k ()
SemaMIPSMIPS ()
SemaMSP430MSP430 ()
SemaNVPTXNVPTX ()
SemaObjCObjC ()
SemaOpenACCOpenACC ()
SemaOpenCLOpenCL ()
SemaOpenMPOpenMP ()
SemaPPCPPC ()
SemaPseudoObjectPseudoObject ()
SemaRISCVRISCV ()
SemaSPIRVSPIRV ()
SemaSYCLSYCL ()
SemaSwiftSwift ()
SemaSystemZSystemZ ()
SemaWasmWasm ()
SemaX86X86 ()
static CastKind ScalarTypeToBooleanCastKind (QualType ScalarTy)
 ScalarTypeToBooleanCastKind - Returns the cast kind corresponding to the conversion from scalar type ScalarTy to the Boolean type.
static PrintingPolicy getPrintingPolicy (const ASTContext &Ctx, const Preprocessor &PP)
 Retrieve a suitable printing policy for diagnostics.

C++ Template Argument Deduction

Implementations are in SemaTemplateDeduction.cpp

typedef llvm::DenseMap< Decl *, SmallVector< PartialDiagnosticAt, 1 > > SuppressedDiagnosticsMap
 For each declaration that involved template argument deduction, the set of diagnostics that were suppressed during that template argument deduction.
SuppressedDiagnosticsMap SuppressedDiagnostics
bool isSameOrCompatibleFunctionType (QualType Param, QualType Arg)
 Compare types for equality with respect to possibly compatible function types (noreturn adjustment, implicit calling conventions).
TemplateArgumentLoc getTrivialTemplateArgumentLoc (const TemplateArgument &Arg, QualType NTTPType, SourceLocation Loc, NamedDecl *TemplateParam=nullptr)
 Allocate a TemplateArgumentLoc where all locations have been initialized to the given location.
TemplateArgumentLoc getIdentityTemplateArgumentLoc (NamedDecl *Param, SourceLocation Location)
 Get a template argument mapping the given template parameter to itself, e.g.
QualType adjustCCAndNoReturn (QualType ArgFunctionType, QualType FunctionType, bool AdjustExceptionSpec=false)
 Adjust the type ArgFunctionType to match the calling convention, noreturn, and optionally the exception specification of FunctionType.
TemplateDeductionResult DeduceTemplateArguments (ClassTemplatePartialSpecializationDecl *Partial, ArrayRef< TemplateArgument > TemplateArgs, sema::TemplateDeductionInfo &Info)
TemplateDeductionResult DeduceTemplateArguments (VarTemplatePartialSpecializationDecl *Partial, ArrayRef< TemplateArgument > TemplateArgs, sema::TemplateDeductionInfo &Info)
TemplateDeductionResult DeduceTemplateArgumentsFromType (TemplateDecl *TD, QualType FromType, sema::TemplateDeductionInfo &Info)
 Deduce the template arguments of the given template from FromType.
TemplateDeductionResult DeduceTemplateArguments (TemplateParameterList *TemplateParams, ArrayRef< TemplateArgument > Ps, ArrayRef< TemplateArgument > As, sema::TemplateDeductionInfo &Info, SmallVectorImpl< DeducedTemplateArgument > &Deduced, bool NumberOfArgumentsMustMatch)
TemplateDeductionResult SubstituteExplicitTemplateArguments (FunctionTemplateDecl *FunctionTemplate, TemplateArgumentListInfo &ExplicitTemplateArgs, SmallVectorImpl< DeducedTemplateArgument > &Deduced, SmallVectorImpl< QualType > &ParamTypes, QualType *FunctionType, sema::TemplateDeductionInfo &Info)
 Substitute the explicitly-provided template arguments into the given function template according to C++ [temp.arg.explicit].
TemplateDeductionResult FinishTemplateArgumentDeduction (FunctionTemplateDecl *FunctionTemplate, SmallVectorImpl< DeducedTemplateArgument > &Deduced, unsigned NumExplicitlySpecified, FunctionDecl *&Specialization, sema::TemplateDeductionInfo &Info, SmallVectorImpl< OriginalCallArg > const *OriginalCallArgs, bool PartialOverloading, bool PartialOrdering, bool ForOverloadSetAddressResolution, llvm::function_ref< bool(bool)> CheckNonDependent=[](bool) { return false;})
 Finish template argument deduction for a function template, checking the deduced template arguments for completeness and forming the function template specialization.
TemplateDeductionResult DeduceTemplateArguments (FunctionTemplateDecl *FunctionTemplate, TemplateArgumentListInfo *ExplicitTemplateArgs, ArrayRef< Expr * > Args, FunctionDecl *&Specialization, sema::TemplateDeductionInfo &Info, bool PartialOverloading, bool AggregateDeductionCandidate, bool PartialOrdering, QualType ObjectType, Expr::Classification ObjectClassification, bool ForOverloadSetAddressResolution, llvm::function_ref< bool(ArrayRef< QualType >, bool)> CheckNonDependent)
 Perform template argument deduction from a function call (C++ [temp.deduct.call]).
TemplateDeductionResult DeduceTemplateArguments (FunctionTemplateDecl *FunctionTemplate, TemplateArgumentListInfo *ExplicitTemplateArgs, QualType ArgFunctionType, FunctionDecl *&Specialization, sema::TemplateDeductionInfo &Info, bool IsAddressOfFunction=false)
 Deduce template arguments when taking the address of a function template (C++ [temp.deduct.funcaddr]) or matching a specialization to a template.
TemplateDeductionResult DeduceTemplateArguments (FunctionTemplateDecl *FunctionTemplate, QualType ObjectType, Expr::Classification ObjectClassification, QualType ToType, CXXConversionDecl *&Specialization, sema::TemplateDeductionInfo &Info)
 Deduce template arguments for a templated conversion function (C++ [temp.deduct.conv]) and, if successful, produce a conversion function template specialization.
TemplateDeductionResult DeduceTemplateArguments (FunctionTemplateDecl *FunctionTemplate, TemplateArgumentListInfo *ExplicitTemplateArgs, FunctionDecl *&Specialization, sema::TemplateDeductionInfo &Info, bool IsAddressOfFunction=false)
 Deduce template arguments for a function template when there is nothing to deduce against (C++0x [temp.arg.explicit]p3).
QualType SubstAutoType (QualType TypeWithAuto, QualType Replacement)
 Substitute Replacement for auto in TypeWithAuto.
TypeSourceInfoSubstAutoTypeSourceInfo (TypeSourceInfo *TypeWithAuto, QualType Replacement)
 Substitute Replacement for auto in TypeWithAuto.
QualType SubstAutoTypeDependent (QualType TypeWithAuto)
TypeSourceInfoSubstAutoTypeSourceInfoDependent (TypeSourceInfo *TypeWithAuto)
QualType ReplaceAutoType (QualType TypeWithAuto, QualType Replacement)
 Completely replace the auto in TypeWithAuto by Replacement.
TypeSourceInfoReplaceAutoTypeSourceInfo (TypeSourceInfo *TypeWithAuto, QualType Replacement)
TemplateDeductionResult DeduceAutoType (TypeLoc AutoTypeLoc, Expr *Initializer, QualType &Result, sema::TemplateDeductionInfo &Info, bool DependentDeduction=false, bool IgnoreConstraints=false, TemplateSpecCandidateSet *FailedTSC=nullptr)
 Deduce the type for an auto type-specifier (C++11 [dcl.spec.auto]p6)
void DiagnoseAutoDeductionFailure (const VarDecl *VDecl, const Expr *Init)
bool DeduceReturnType (FunctionDecl *FD, SourceLocation Loc, bool Diagnose=true)
bool CheckIfFunctionSpecializationIsImmediate (FunctionDecl *FD, SourceLocation Loc)
ClassTemplatePartialSpecializationDeclgetMoreSpecializedPartialSpecialization (ClassTemplatePartialSpecializationDecl *PS1, ClassTemplatePartialSpecializationDecl *PS2, SourceLocation Loc)
 Returns the more specialized class template partial specialization according to the rules of partial ordering of class template partial specializations (C++ [temp.class.order]).
bool isMoreSpecializedThanPrimary (ClassTemplatePartialSpecializationDecl *T, sema::TemplateDeductionInfo &Info)
VarTemplatePartialSpecializationDeclgetMoreSpecializedPartialSpecialization (VarTemplatePartialSpecializationDecl *PS1, VarTemplatePartialSpecializationDecl *PS2, SourceLocation Loc)
bool isMoreSpecializedThanPrimary (VarTemplatePartialSpecializationDecl *T, sema::TemplateDeductionInfo &Info)
bool isTemplateTemplateParameterAtLeastAsSpecializedAs (TemplateParameterList *PParam, TemplateDecl *PArg, TemplateDecl *AArg, const DefaultArguments &DefaultArgs, SourceLocation ArgLoc, bool PartialOrdering, bool *StrictPackMatch)
void MarkUsedTemplateParameters (const Expr *E, bool OnlyDeduced, unsigned Depth, llvm::SmallBitVector &Used)
 Mark which template parameters are used in a given expression.
void MarkUsedTemplateParametersForSubsumptionParameterMapping (const Expr *E, unsigned Depth, llvm::SmallBitVector &Used)
 Mark which template parameters are named in a given expression.
void MarkUsedTemplateParameters (const TemplateArgumentList &TemplateArgs, bool OnlyDeduced, unsigned Depth, llvm::SmallBitVector &Used)
 Mark which template parameters can be deduced from a given template argument list.
void MarkUsedTemplateParameters (ArrayRef< TemplateArgument > TemplateArgs, unsigned Depth, llvm::SmallBitVector &Used)
void MarkUsedTemplateParameters (ArrayRef< TemplateArgumentLoc > TemplateArgs, unsigned Depth, llvm::SmallBitVector &Used)
void MarkDeducedTemplateParameters (const FunctionTemplateDecl *FunctionTemplate, llvm::SmallBitVector &Deduced)
FunctionTemplateDeclgetMoreSpecializedTemplate (FunctionTemplateDecl *FT1, FunctionTemplateDecl *FT2, SourceLocation Loc, TemplatePartialOrderingContext TPOC, unsigned NumCallArguments1, QualType RawObj1Ty={}, QualType RawObj2Ty={}, bool Reversed=false, bool PartialOverloading=false)
 Returns the more specialized function template according to the rules of function template partial ordering (C++ [temp.func.order]).
UnresolvedSetIterator getMostSpecialized (UnresolvedSetIterator SBegin, UnresolvedSetIterator SEnd, TemplateSpecCandidateSet &FailedCandidates, SourceLocation Loc, const PartialDiagnostic &NoneDiag, const PartialDiagnostic &AmbigDiag, const PartialDiagnostic &CandidateDiag, bool Complain=true, QualType TargetType=QualType())
 Retrieve the most specialized of the given function template specializations.
FunctionDeclgetMoreConstrainedFunction (FunctionDecl *FD1, FunctionDecl *FD2)
 Returns the more constrained function according to the rules of partial ordering by constraints (C++ [temp.constr.order]).
static void MarkDeducedTemplateParameters (ASTContext &Ctx, const FunctionTemplateDecl *FunctionTemplate, llvm::SmallBitVector &Deduced)
 Marks all of the template parameters that will be deduced by a call to the given function template.

C++ Template Instantiation

Implementations are in SemaTemplateInstantiate.cpp

typedef llvm::DenseMap< ParmVarDecl *, llvm::TinyPtrVector< ParmVarDecl * > > UnparsedDefaultArgInstantiationsMap
using InstantiatingSpecializationsKey = llvm::PointerIntPair<Decl *, 2>
using EntityPrinter = llvm::function_ref<void(llvm::raw_ostream &)>
LocalInstantiationScopeCurrentInstantiationScope
 The current instantiation scope used to store local variables.
UnparsedDefaultArgInstantiationsMap UnparsedDefaultArgInstantiations
 A mapping from parameters with unparsed default arguments to the set of instantiations of each parameter.
SmallVector< CodeSynthesisContext, 16 > CodeSynthesisContexts
 List of active code synthesis contexts.
llvm::DenseSet< InstantiatingSpecializationsKeyInstantiatingSpecializations
 Specializations whose definitions are currently being instantiated.
llvm::DenseSet< QualTypeInstantiatedNonDependentTypes
 Non-dependent types used in templates that have already been instantiated by some template instantiation.
SmallVector< Module *, 16 > CodeSynthesisContextLookupModules
 Extra modules inspected when performing a lookup during a template instantiation.
llvm::DenseSet< Module * > LookupModulesCache
 Cache of additional modules that should be used for name lookup within the current template instantiation.
llvm::DenseMap< NamedDecl *, NamedDecl * > VisibleNamespaceCache
 Map from the most recent declaration of a namespace to the most recent visible declaration of that namespace.
SFINAETrapCurrentSFINAEContext = nullptr
unsigned NonInstantiationEntries
 The number of CodeSynthesisContexts that are not template instantiations and, therefore, should not be counted as part of the instantiation depth.
unsigned LastEmittedCodeSynthesisContextDepth = 0
 The depth of the context stack at the point when the most recent error or warning was produced.
std::vector< std::unique_ptr< TemplateInstantiationCallback > > TemplateInstCallbacks
 The template instantiation callbacks to trace or track instantiations (objects can be chained).
UnsignedOrNone ArgPackSubstIndex
 The current index into pack expansion arguments that will be used for substitution of parameter packs.
bool SubstTemplateArgument (const TemplateArgumentLoc &Input, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateArgumentLoc &Output, SourceLocation Loc={}, const DeclarationName &Entity={})
bool SubstTemplateArguments (ArrayRef< TemplateArgumentLoc > Args, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateArgumentListInfo &Outputs)
ExprResult SubstConceptTemplateArguments (const ConceptSpecializationExpr *CSE, const Expr *ConstraintExpr, const MultiLevelTemplateArgumentList &MLTAL)
 Substitute concept template arguments in the constraint expression of a concept-id.
bool SubstTemplateArgumentsInParameterMapping (ArrayRef< TemplateArgumentLoc > Args, SourceLocation BaseLoc, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateArgumentListInfo &Out)
MultiLevelTemplateArgumentList getTemplateInstantiationArgs (const NamedDecl *D, const DeclContext *DC=nullptr, bool Final=false, std::optional< ArrayRef< TemplateArgument > > Innermost=std::nullopt, bool RelativeToPrimary=false, const FunctionDecl *Pattern=nullptr, bool ForConstraintInstantiation=false, bool SkipForSpecialization=false, bool ForDefaultArgumentSubstitution=false)
 Retrieve the template argument list(s) that should be used to instantiate the definition of the given declaration.
bool pushCodeSynthesisContext (CodeSynthesisContext Ctx)
void popCodeSynthesisContext ()
void PrintContextStack (InstantiationContextDiagFuncRef DiagFunc)
void PrintContextStack ()
void PrintInstantiationStack (InstantiationContextDiagFuncRef DiagFunc)
 Prints the current instantiation stack through a series of notes.
void PrintInstantiationStack ()
SFINAETrapgetSFINAEContext () const
 Returns a pointer to the current SFINAE context, if any.
bool isSFINAEContext () const
TypeSourceInfoSubstType (TypeSourceInfo *T, const MultiLevelTemplateArgumentList &TemplateArgs, SourceLocation Loc, DeclarationName Entity, bool AllowDeducedTST=false)
 Perform substitution on the type T with a given set of template arguments.
QualType SubstType (QualType T, const MultiLevelTemplateArgumentList &TemplateArgs, SourceLocation Loc, DeclarationName Entity, bool *IsIncompleteSubstitution=nullptr)
 Deprecated form of the above.
TypeSourceInfoSubstType (TypeLoc TL, const MultiLevelTemplateArgumentList &TemplateArgs, SourceLocation Loc, DeclarationName Entity)
TypeSourceInfoSubstFunctionDeclType (TypeSourceInfo *T, const MultiLevelTemplateArgumentList &TemplateArgs, SourceLocation Loc, DeclarationName Entity, CXXRecordDecl *ThisContext, Qualifiers ThisTypeQuals, bool EvaluateConstraints=true)
 A form of SubstType intended specifically for instantiating the type of a FunctionDecl.
void SubstExceptionSpec (FunctionDecl *New, const FunctionProtoType *Proto, const MultiLevelTemplateArgumentList &Args)
bool SubstExceptionSpec (SourceLocation Loc, FunctionProtoType::ExceptionSpecInfo &ESI, SmallVectorImpl< QualType > &ExceptionStorage, const MultiLevelTemplateArgumentList &Args)
ParmVarDeclSubstParmVarDecl (ParmVarDecl *D, const MultiLevelTemplateArgumentList &TemplateArgs, int indexAdjustment, UnsignedOrNone NumExpansions, bool ExpectParameterPack, bool EvaluateConstraints=true)
bool SubstParmTypes (SourceLocation Loc, ArrayRef< ParmVarDecl * > Params, const FunctionProtoType::ExtParameterInfo *ExtParamInfos, const MultiLevelTemplateArgumentList &TemplateArgs, SmallVectorImpl< QualType > &ParamTypes, SmallVectorImpl< ParmVarDecl * > *OutParams, ExtParameterInfoBuilder &ParamInfos)
 Substitute the given template arguments into the given set of parameters, producing the set of parameter types that would be generated from such a substitution.
bool SubstDefaultArgument (SourceLocation Loc, ParmVarDecl *Param, const MultiLevelTemplateArgumentList &TemplateArgs, bool ForCallExpr=false)
 Substitute the given template arguments into the default argument.
ExprResult SubstExpr (Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs)
ExprResult SubstCXXIdExpr (Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs)
 Substitute an expression as if it is a address-of-operand, which makes it act like a CXXIdExpression rather than an attempt to call.
ExprResult SubstConstraintExpr (Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs)
ExprResult SubstConstraintExprWithoutSatisfaction (Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs)
bool SubstExprs (ArrayRef< Expr * > Exprs, bool IsCall, const MultiLevelTemplateArgumentList &TemplateArgs, SmallVectorImpl< Expr * > &Outputs)
 Substitute the given template arguments into a list of expressions, expanding pack expansions if required.
StmtResult SubstStmt (Stmt *S, const MultiLevelTemplateArgumentList &TemplateArgs)
ExprResult SubstInitializer (Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs, bool CXXDirectInit)
bool SubstBaseSpecifiers (CXXRecordDecl *Instantiation, CXXRecordDecl *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs)
 Perform substitution on the base class specifiers of the given class template specialization.
bool InstantiateClass (SourceLocation PointOfInstantiation, CXXRecordDecl *Instantiation, CXXRecordDecl *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateSpecializationKind TSK, bool Complain=true)
 Instantiate the definition of a class from a given pattern.
bool InstantiateEnum (SourceLocation PointOfInstantiation, EnumDecl *Instantiation, EnumDecl *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateSpecializationKind TSK)
 Instantiate the definition of an enum from a given pattern.
bool InstantiateInClassInitializer (SourceLocation PointOfInstantiation, FieldDecl *Instantiation, FieldDecl *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs)
 Instantiate the definition of a field from the given pattern.
bool usesPartialOrExplicitSpecialization (SourceLocation Loc, ClassTemplateSpecializationDecl *ClassTemplateSpec)
bool InstantiateClassTemplateSpecialization (SourceLocation PointOfInstantiation, ClassTemplateSpecializationDecl *ClassTemplateSpec, TemplateSpecializationKind TSK, bool Complain, bool PrimaryStrictPackMatch)
void InstantiateClassMembers (SourceLocation PointOfInstantiation, CXXRecordDecl *Instantiation, const MultiLevelTemplateArgumentList &TemplateArgs, TemplateSpecializationKind TSK)
 Instantiates the definitions of all of the member of the given class, which is an instantiation of a class template or a member class of a template.
void InstantiateClassTemplateSpecializationMembers (SourceLocation PointOfInstantiation, ClassTemplateSpecializationDecl *ClassTemplateSpec, TemplateSpecializationKind TSK)
 Instantiate the definitions of all of the members of the given class template specialization, which was named as part of an explicit instantiation.
NestedNameSpecifierLoc SubstNestedNameSpecifierLoc (NestedNameSpecifierLoc NNS, const MultiLevelTemplateArgumentList &TemplateArgs)
DeclarationNameInfo SubstDeclarationNameInfo (const DeclarationNameInfo &NameInfo, const MultiLevelTemplateArgumentList &TemplateArgs)
 Do template substitution on declaration name info.
TemplateName SubstTemplateName (SourceLocation TemplateKWLoc, NestedNameSpecifierLoc &QualifierLoc, TemplateName Name, SourceLocation NameLoc, const MultiLevelTemplateArgumentList &TemplateArgs)
bool SubstTypeConstraint (TemplateTypeParmDecl *Inst, const TypeConstraint *TC, const MultiLevelTemplateArgumentList &TemplateArgs, bool EvaluateConstraint)
bool inTemplateInstantiation () const
 Determine whether we are currently performing template instantiation.
bool inConstraintSubstitution () const
 Determine whether we are currently performing constraint substitution.
bool inParameterMappingSubstitution () const
concepts::Requirement::SubstitutionDiagnosticcreateSubstDiagAt (SourceLocation Location, EntityPrinter Printer)
 create a Requirement::SubstitutionDiagnostic with only a SubstitutedEntity and DiagLoc using ASTContext's allocator.

C++ Template Declaration Instantiation

Implementations are in SemaTemplateInstantiateDecl.cpp

typedef std::pair< ValueDecl *, SourceLocationPendingImplicitInstantiation
 An entity for which implicit template instantiation is required.
typedef SmallVector< LateInstantiatedAttribute, 1 > LateInstantiatedAttrVec
std::deque< PendingImplicitInstantiationPendingInstantiations
 The queue of implicit template instantiations that are required but have not yet been performed.
SmallVector< PendingImplicitInstantiation, 1 > LateParsedInstantiations
 Queue of implicit template instantiations that cannot be performed eagerly.
SmallVector< SmallVector< VTableUse, 16 >, 8 > SavedVTableUses
SmallVector< std::deque< PendingImplicitInstantiation >, 8 > SavedPendingInstantiations
std::deque< PendingImplicitInstantiationPendingLocalImplicitInstantiations
 The queue of implicit template instantiations that are required and must be performed within the current local scope.
ExplicitSpecifier instantiateExplicitSpecifier (const MultiLevelTemplateArgumentList &TemplateArgs, ExplicitSpecifier ES)
void InstantiateAttrs (const MultiLevelTemplateArgumentList &TemplateArgs, const Decl *Pattern, Decl *Inst, LateInstantiatedAttrVec *LateAttrs=nullptr, LocalInstantiationScope *OuterMostScope=nullptr)
void updateAttrsForLateParsedTemplate (const Decl *Pattern, Decl *Inst)
 Update instantiation attributes after template was late parsed.
void InstantiateAttrsForDecl (const MultiLevelTemplateArgumentList &TemplateArgs, const Decl *Pattern, Decl *Inst, LateInstantiatedAttrVec *LateAttrs=nullptr, LocalInstantiationScope *OuterMostScope=nullptr)
void InstantiateDefaultCtorDefaultArgs (CXXConstructorDecl *Ctor)
 In the MS ABI, we need to instantiate default arguments of dllexported default constructors along with the constructor definition.
bool InstantiateDefaultArgument (SourceLocation CallLoc, FunctionDecl *FD, ParmVarDecl *Param)
void InstantiateExceptionSpec (SourceLocation PointOfInstantiation, FunctionDecl *Function)
FunctionDeclInstantiateFunctionDeclaration (FunctionTemplateDecl *FTD, const TemplateArgumentList *Args, SourceLocation Loc, CodeSynthesisContext::SynthesisKind CSC=CodeSynthesisContext::ExplicitTemplateArgumentSubstitution)
 Instantiate (or find existing instantiation of) a function template with a given set of template arguments.
void InstantiateFunctionDefinition (SourceLocation PointOfInstantiation, FunctionDecl *Function, bool Recursive=false, bool DefinitionRequired=false, bool AtEndOfTU=false)
 Instantiate the definition of the given function from its template.
VarTemplateSpecializationDeclBuildVarTemplateInstantiation (VarTemplateDecl *VarTemplate, VarDecl *FromVar, const TemplateArgumentList *PartialSpecArgs, SmallVectorImpl< TemplateArgument > &Converted, SourceLocation PointOfInstantiation, LateInstantiatedAttrVec *LateAttrs=nullptr, LocalInstantiationScope *StartingScope=nullptr)
VarTemplateSpecializationDeclCompleteVarTemplateSpecializationDecl (VarTemplateSpecializationDecl *VarSpec, VarDecl *PatternDecl, const MultiLevelTemplateArgumentList &TemplateArgs)
 Instantiates a variable template specialization by completing it with appropriate type information and initializer.
void BuildVariableInstantiation (VarDecl *NewVar, VarDecl *OldVar, const MultiLevelTemplateArgumentList &TemplateArgs, LateInstantiatedAttrVec *LateAttrs, DeclContext *Owner, LocalInstantiationScope *StartingScope, bool InstantiatingVarTemplate=false, VarTemplateSpecializationDecl *PrevVTSD=nullptr)
 BuildVariableInstantiation - Used after a new variable has been created.
void InstantiateVariableInitializer (VarDecl *Var, VarDecl *OldVar, const MultiLevelTemplateArgumentList &TemplateArgs)
 Instantiate the initializer of a variable.
void InstantiateVariableDefinition (SourceLocation PointOfInstantiation, VarDecl *Var, bool Recursive=false, bool DefinitionRequired=false, bool AtEndOfTU=false)
 Instantiate the definition of the given variable from its template.
void InstantiateMemInitializers (CXXConstructorDecl *New, const CXXConstructorDecl *Tmpl, const MultiLevelTemplateArgumentList &TemplateArgs)
NamedDeclFindInstantiatedDecl (SourceLocation Loc, NamedDecl *D, const MultiLevelTemplateArgumentList &TemplateArgs, bool FindingInstantiatedContext=false)
 Find the instantiation of the given declaration within the current instantiation.
DeclContextFindInstantiatedContext (SourceLocation Loc, DeclContext *DC, const MultiLevelTemplateArgumentList &TemplateArgs)
 Finds the instantiation of the given declaration context within the current instantiation.
DeclSubstDecl (Decl *D, DeclContext *Owner, const MultiLevelTemplateArgumentList &TemplateArgs)
FunctionDeclSubstSpaceshipAsEqualEqual (CXXRecordDecl *RD, FunctionDecl *Spaceship)
 Substitute the name and return type of a defaulted 'operator<=>' to form an implicit 'operator=='.
void PerformPendingInstantiations (bool LocalOnly=false, bool AtEndOfTU=true)
 Performs template instantiation for all implicit template instantiations we have seen until this point.
TemplateParameterListSubstTemplateParams (TemplateParameterList *Params, DeclContext *Owner, const MultiLevelTemplateArgumentList &TemplateArgs, bool EvaluateConstraints=true)
void PerformDependentDiagnostics (const DeclContext *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs)

Constraints and Concepts

Implementations are in SemaConcept.cpp

using SatisfactionStackEntryTy
using ConstrainedDeclOrNestedRequirement
llvm::DenseMap< llvm::FoldingSetNodeID, UnsubstitutedConstraintSatisfactionCacheResultUnsubstitutedConstraintSatisfactionCache
 Cache the satisfaction of an atomic constraint.
void PushSatisfactionStackEntry (const NamedDecl *D, const llvm::FoldingSetNodeID &ID)
void PopSatisfactionStackEntry ()
bool SatisfactionStackContains (const NamedDecl *D, const llvm::FoldingSetNodeID &ID) const
void SwapSatisfactionStack (llvm::SmallVectorImpl< SatisfactionStackEntryTy > &NewSS)
bool CheckConstraintExpression (const Expr *CE, Token NextToken=Token(), bool *PossibleNonPrimary=nullptr, bool IsTrailingRequiresClause=false)
 Check whether the given expression is a valid constraint expression.
bool CheckConstraintSatisfaction (ConstrainedDeclOrNestedRequirement Entity, ArrayRef< AssociatedConstraint > AssociatedConstraints, const MultiLevelTemplateArgumentList &TemplateArgLists, SourceRange TemplateIDRange, ConstraintSatisfaction &Satisfaction, const ConceptReference *TopLevelConceptId=nullptr, Expr **ConvertedExpr=nullptr)
 Check whether the given list of constraint expressions are satisfied (as if in a 'conjunction') given template arguments.
bool CheckFunctionConstraints (const FunctionDecl *FD, ConstraintSatisfaction &Satisfaction, SourceLocation UsageLoc=SourceLocation(), bool ForOverloadResolution=false)
 Check whether the given function decl's trailing requires clause is satisfied, if any.
bool AreConstraintExpressionsEqual (const NamedDecl *Old, const Expr *OldConstr, const TemplateCompareNewDeclInfo &New, const Expr *NewConstr)
bool FriendConstraintsDependOnEnclosingTemplate (const FunctionDecl *FD)
bool EnsureTemplateArgumentListConstraints (TemplateDecl *Template, const MultiLevelTemplateArgumentList &TemplateArgs, SourceRange TemplateIDRange)
 Ensure that the given template arguments satisfy the constraints associated with the given template, emitting a diagnostic if they do not.
bool CheckFunctionTemplateConstraints (SourceLocation PointOfInstantiation, FunctionDecl *Decl, ArrayRef< TemplateArgument > TemplateArgs, ConstraintSatisfaction &Satisfaction)
void DiagnoseUnsatisfiedConstraint (const ConstraintSatisfaction &Satisfaction, SourceLocation Loc={}, bool First=true)
 Emit diagnostics explaining why a constraint expression was deemed unsatisfied.
void DiagnoseUnsatisfiedConstraint (const ConceptSpecializationExpr *ConstraintExpr, bool First=true)
 Emit diagnostics explaining why a constraint expression was deemed unsatisfied.
const NormalizedConstraintgetNormalizedAssociatedConstraints (ConstrainedDeclOrNestedRequirement Entity, ArrayRef< AssociatedConstraint > AssociatedConstraints)
bool IsAtLeastAsConstrained (const NamedDecl *D1, MutableArrayRef< AssociatedConstraint > AC1, const NamedDecl *D2, MutableArrayRef< AssociatedConstraint > AC2, bool &Result)
 Check whether the given declaration's associated constraints are at least as constrained than another declaration's according to the partial ordering of constraints.
bool MaybeEmitAmbiguousAtomicConstraintsDiagnostic (const NamedDecl *D1, ArrayRef< AssociatedConstraint > AC1, const NamedDecl *D2, ArrayRef< AssociatedConstraint > AC2)
 If D1 was not at least as constrained as D2, but would've been if a pair of atomic constraints involved had been declared in a concept and not repeated in two separate places in code.

C++ Coroutines

Implementations are in SemaCoroutine.cpp

ClassTemplateDeclStdCoroutineTraitsCache
 The C++ "std::coroutine_traits" template, which is defined in <coroutine_traits>
bool ActOnCoroutineBodyStart (Scope *S, SourceLocation KwLoc, StringRef Keyword)
ExprResult ActOnCoawaitExpr (Scope *S, SourceLocation KwLoc, Expr *E)
ExprResult ActOnCoyieldExpr (Scope *S, SourceLocation KwLoc, Expr *E)
StmtResult ActOnCoreturnStmt (Scope *S, SourceLocation KwLoc, Expr *E)
ExprResult BuildOperatorCoawaitLookupExpr (Scope *S, SourceLocation Loc)
ExprResult BuildOperatorCoawaitCall (SourceLocation Loc, Expr *E, UnresolvedLookupExpr *Lookup)
 Build a call to 'operator co_await' if there is a suitable operator for the given expression.
ExprResult BuildResolvedCoawaitExpr (SourceLocation KwLoc, Expr *Operand, Expr *Awaiter, bool IsImplicit=false)
ExprResult BuildUnresolvedCoawaitExpr (SourceLocation KwLoc, Expr *Operand, UnresolvedLookupExpr *Lookup)
ExprResult BuildCoyieldExpr (SourceLocation KwLoc, Expr *E)
StmtResult BuildCoreturnStmt (SourceLocation KwLoc, Expr *E, bool IsImplicit=false)
StmtResult BuildCoroutineBodyStmt (CoroutineBodyStmt::CtorArgs)
bool buildCoroutineParameterMoves (SourceLocation Loc)
VarDeclbuildCoroutinePromise (SourceLocation Loc)
void CheckCompletedCoroutineBody (FunctionDecl *FD, Stmt *&Body)
void CheckCoroutineWrapper (FunctionDecl *FD)
ClassTemplateDecllookupCoroutineTraits (SourceLocation KwLoc, SourceLocation FuncLoc)
 Lookup 'coroutine_traits' in std namespace and std::experimental namespace.
bool checkFinalSuspendNoThrow (const Stmt *FinalSuspend)
 Check that the expression co_await promise.final_suspend() shall not be potentially-throwing.

C++ Exception Specifications

Implementations are in SemaExceptionSpec.cpp

SmallVector< std::pair< const CXXMethodDecl *, const CXXMethodDecl * >, 2 > DelayedOverridingExceptionSpecChecks
 All the overriding functions seen during a class definition that had their exception spec checks delayed, plus the overridden function.
SmallVector< std::pair< FunctionDecl *, FunctionDecl * >, 2 > DelayedEquivalentExceptionSpecChecks
 All the function redeclarations seen during a class definition that had their exception spec checks delayed, plus the prior declaration they should be checked against.
bool isLibstdcxxEagerExceptionSpecHack (const Declarator &D)
 Determine if we're in a case where we need to (incorrectly) eagerly parse an exception specification to work around a libstdc++ bug.
ExprResult ActOnNoexceptSpec (Expr *NoexceptExpr, ExceptionSpecificationType &EST)
 Check the given noexcept-specifier, convert its expression, and compute the appropriate ExceptionSpecificationType.
CanThrowResult canThrow (const Stmt *E)
const FunctionProtoTypeResolveExceptionSpec (SourceLocation Loc, const FunctionProtoType *FPT)
void UpdateExceptionSpec (FunctionDecl *FD, const FunctionProtoType::ExceptionSpecInfo &ESI)
bool CheckSpecifiedExceptionType (QualType &T, SourceRange Range)
 CheckSpecifiedExceptionType - Check if the given type is valid in an exception specification.
bool CheckDistantExceptionSpec (QualType T)
 CheckDistantExceptionSpec - Check if the given type is a pointer or pointer to member to a function with an exception specification.
bool CheckEquivalentExceptionSpec (FunctionDecl *Old, FunctionDecl *New)
bool CheckEquivalentExceptionSpec (const FunctionProtoType *Old, SourceLocation OldLoc, const FunctionProtoType *New, SourceLocation NewLoc)
 CheckEquivalentExceptionSpec - Check if the two types have equivalent exception specifications.
bool CheckEquivalentExceptionSpec (const PartialDiagnostic &DiagID, const PartialDiagnostic &NoteID, const FunctionProtoType *Old, SourceLocation OldLoc, const FunctionProtoType *New, SourceLocation NewLoc)
bool handlerCanCatch (QualType HandlerType, QualType ExceptionType)
bool CheckExceptionSpecSubset (const PartialDiagnostic &DiagID, const PartialDiagnostic &NestedDiagID, const PartialDiagnostic &NoteID, const PartialDiagnostic &NoThrowDiagID, const FunctionProtoType *Superset, bool SkipSupersetFirstParameter, SourceLocation SuperLoc, const FunctionProtoType *Subset, bool SkipSubsetFirstParameter, SourceLocation SubLoc)
 CheckExceptionSpecSubset - Check whether the second function type's exception specification is a subset (or equivalent) of the first function type.
bool CheckParamExceptionSpec (const PartialDiagnostic &NestedDiagID, const PartialDiagnostic &NoteID, const FunctionProtoType *Target, bool SkipTargetFirstParameter, SourceLocation TargetLoc, const FunctionProtoType *Source, bool SkipSourceFirstParameter, SourceLocation SourceLoc)
 CheckParamExceptionSpec - Check if the parameter and return types of the two functions have equivalent exception specs.
bool CheckExceptionSpecCompatibility (Expr *From, QualType ToType)
bool CheckOverridingFunctionExceptionSpec (const CXXMethodDecl *New, const CXXMethodDecl *Old)
 CheckOverridingFunctionExceptionSpec - Checks whether the exception spec is a subset of base spec.
static CanThrowResult canCalleeThrow (Sema &S, const Expr *E, const Decl *D, SourceLocation Loc=SourceLocation())
 Determine whether the callee of a particular function call can throw.

C++ Expressions

Implementations are in SemaExprCXX.cpp

LazyDeclPtr StdBadAlloc
 The C++ "std::bad_alloc" class, which is defined by the C++ standard library.
LazyDeclPtr StdAlignValT
 The C++ "std::align_val_t" enum class, which is defined by the C++ standard library.
RecordDeclCXXTypeInfoDecl
 The C++ "type_info" declaration, which is defined in <typeinfo>.
bool GlobalNewDeleteDeclared
 A flag to remember whether the implicit forms of operator new and delete have been declared.
llvm::MapVector< FieldDecl *, DeleteLocsDeleteExprs
 Delete-expressions to be analyzed at the end of translation unit.
QualType CXXThisTypeOverride
 When non-NULL, the C++ 'this' expression is allowed despite the current context not being a non-static member function.
ParsedType getInheritingConstructorName (CXXScopeSpec &SS, SourceLocation NameLoc, const IdentifierInfo &Name)
 Handle the result of the special case name lookup for inheriting constructor declarations.
ParsedType getConstructorName (const IdentifierInfo &II, SourceLocation NameLoc, Scope *S, CXXScopeSpec &SS, bool EnteringContext)
ParsedType getDestructorName (const IdentifierInfo &II, SourceLocation NameLoc, Scope *S, CXXScopeSpec &SS, ParsedType ObjectType, bool EnteringContext)
ParsedType getDestructorTypeForDecltype (const DeclSpec &DS, ParsedType ObjectType)
ExprResult BuildCXXTypeId (QualType TypeInfoType, SourceLocation TypeidLoc, TypeSourceInfo *Operand, SourceLocation RParenLoc)
 Build a C++ typeid expression with a type operand.
ExprResult BuildCXXTypeId (QualType TypeInfoType, SourceLocation TypeidLoc, Expr *Operand, SourceLocation RParenLoc)
 Build a C++ typeid expression with an expression operand.
ExprResult ActOnCXXTypeid (SourceLocation OpLoc, SourceLocation LParenLoc, bool isType, void *TyOrExpr, SourceLocation RParenLoc)
 ActOnCXXTypeid - Parse typeid( something ).
ExprResult BuildCXXUuidof (QualType TypeInfoType, SourceLocation TypeidLoc, TypeSourceInfo *Operand, SourceLocation RParenLoc)
 Build a Microsoft __uuidof expression with a type operand.
ExprResult BuildCXXUuidof (QualType TypeInfoType, SourceLocation TypeidLoc, Expr *Operand, SourceLocation RParenLoc)
 Build a Microsoft __uuidof expression with an expression operand.
ExprResult ActOnCXXUuidof (SourceLocation OpLoc, SourceLocation LParenLoc, bool isType, void *TyOrExpr, SourceLocation RParenLoc)
 ActOnCXXUuidof - Parse __uuidof( something ).
ExprResult ActOnCXXThis (SourceLocation Loc)
bool CheckCXXThisType (SourceLocation Loc, QualType Type)
 Check whether the type of 'this' is valid in the current context.
ExprBuildCXXThisExpr (SourceLocation Loc, QualType Type, bool IsImplicit)
 Build a CXXThisExpr and mark it referenced in the current context.
void MarkThisReferenced (CXXThisExpr *This)
QualType getCurrentThisType ()
 Try to retrieve the type of the 'this' pointer.
bool CheckCXXThisCapture (SourceLocation Loc, bool Explicit=false, bool BuildAndDiagnose=true, const unsigned *const FunctionScopeIndexToStopAt=nullptr, bool ByCopy=false)
 Make sure the value of 'this' is actually available in the current context, if it is a potentially evaluated context.
bool isThisOutsideMemberFunctionBody (QualType BaseType)
 Determine whether the given type is the type of *this that is used outside of the body of a member function for a type that is currently being defined.
ExprResult ActOnCXXBoolLiteral (SourceLocation OpLoc, tok::TokenKind Kind)
 ActOnCXXBoolLiteral - Parse {true,false} literals.
ExprResult ActOnCXXNullPtrLiteral (SourceLocation Loc)
 ActOnCXXNullPtrLiteral - Parse 'nullptr'.
ExprResult ActOnCXXThrow (Scope *S, SourceLocation OpLoc, Expr *expr)
ExprResult BuildCXXThrow (SourceLocation OpLoc, Expr *Ex, bool IsThrownVarInScope)
bool CheckCXXThrowOperand (SourceLocation ThrowLoc, QualType ThrowTy, Expr *E)
 CheckCXXThrowOperand - Validate the operand of a throw.
ExprResult ActOnCXXTypeConstructExpr (ParsedType TypeRep, SourceLocation LParenOrBraceLoc, MultiExprArg Exprs, SourceLocation RParenOrBraceLoc, bool ListInitialization)
 ActOnCXXTypeConstructExpr - Parse construction of a specified type.
ExprResult BuildCXXTypeConstructExpr (TypeSourceInfo *Type, SourceLocation LParenLoc, MultiExprArg Exprs, SourceLocation RParenLoc, bool ListInitialization)
ExprResult ActOnCXXNew (SourceLocation StartLoc, bool UseGlobal, SourceLocation PlacementLParen, MultiExprArg PlacementArgs, SourceLocation PlacementRParen, SourceRange TypeIdParens, Declarator &D, Expr *Initializer)
 Parsed a C++ 'new' expression (C++ 5.3.4).
ExprResult BuildCXXNew (SourceRange Range, bool UseGlobal, SourceLocation PlacementLParen, MultiExprArg PlacementArgs, SourceLocation PlacementRParen, SourceRange TypeIdParens, QualType AllocType, TypeSourceInfo *AllocTypeInfo, std::optional< Expr * > ArraySize, SourceRange DirectInitRange, Expr *Initializer)
bool isUnavailableAlignedAllocationFunction (const FunctionDecl &FD) const
 Determine whether FD is an aligned allocation or deallocation function that is unavailable.
void diagnoseUnavailableAlignedAllocation (const FunctionDecl &FD, SourceLocation Loc)
 Produce diagnostics if FD is an aligned allocation or deallocation function that is unavailable.
bool CheckAllocatedType (QualType AllocType, SourceLocation Loc, SourceRange R)
 Checks that a type is suitable as the allocated type in a new-expression.
bool FindAllocationFunctions (SourceLocation StartLoc, SourceRange Range, AllocationFunctionScope NewScope, AllocationFunctionScope DeleteScope, QualType AllocType, bool IsArray, ImplicitAllocationParameters &IAP, MultiExprArg PlaceArgs, FunctionDecl *&OperatorNew, FunctionDecl *&OperatorDelete, bool Diagnose=true)
 Finds the overloads of operator new and delete that are appropriate for the allocation.
void DeclareGlobalNewDelete ()
 DeclareGlobalNewDelete - Declare the global forms of operator new and delete.
void DeclareGlobalAllocationFunction (DeclarationName Name, QualType Return, ArrayRef< QualType > Params)
 DeclareGlobalAllocationFunction - Declares a single implicit global allocation function if it doesn't already exist.
bool FindDeallocationFunction (SourceLocation StartLoc, CXXRecordDecl *RD, DeclarationName Name, FunctionDecl *&Operator, ImplicitDeallocationParameters, bool Diagnose=true)
FunctionDeclFindUsualDeallocationFunction (SourceLocation StartLoc, ImplicitDeallocationParameters, DeclarationName Name, bool Diagnose=true)
FunctionDeclFindDeallocationFunctionForDestructor (SourceLocation StartLoc, CXXRecordDecl *RD, bool Diagnose, bool LookForGlobal, DeclarationName Name)
ExprResult ActOnCXXDelete (SourceLocation StartLoc, bool UseGlobal, bool ArrayForm, Expr *Operand)
 ActOnCXXDelete - Parsed a C++ 'delete' expression (C++ 5.3.5), as in:
void CheckVirtualDtorCall (CXXDestructorDecl *dtor, SourceLocation Loc, bool IsDelete, bool CallCanBeVirtual, bool WarnOnNonAbstractTypes, SourceLocation DtorLoc)
ExprResult ActOnNoexceptExpr (SourceLocation KeyLoc, SourceLocation LParen, Expr *Operand, SourceLocation RParen)
ExprResult BuildCXXNoexceptExpr (SourceLocation KeyLoc, Expr *Operand, SourceLocation RParen)
ExprResult ActOnStartCXXMemberReference (Scope *S, Expr *Base, SourceLocation OpLoc, tok::TokenKind OpKind, ParsedType &ObjectType, bool &MayBePseudoDestructor)
ExprResult BuildPseudoDestructorExpr (Expr *Base, SourceLocation OpLoc, tok::TokenKind OpKind, const CXXScopeSpec &SS, TypeSourceInfo *ScopeType, SourceLocation CCLoc, SourceLocation TildeLoc, PseudoDestructorTypeStorage DestroyedType)
ExprResult ActOnPseudoDestructorExpr (Scope *S, Expr *Base, SourceLocation OpLoc, tok::TokenKind OpKind, CXXScopeSpec &SS, UnqualifiedId &FirstTypeName, SourceLocation CCLoc, SourceLocation TildeLoc, UnqualifiedId &SecondTypeName)
ExprResult ActOnPseudoDestructorExpr (Scope *S, Expr *Base, SourceLocation OpLoc, tok::TokenKind OpKind, SourceLocation TildeLoc, const DeclSpec &DS)
ExprMaybeCreateExprWithCleanups (Expr *SubExpr)
 MaybeCreateExprWithCleanups - If the current full-expression requires any cleanups, surround it with a ExprWithCleanups node.
StmtMaybeCreateStmtWithCleanups (Stmt *SubStmt)
ExprResult MaybeCreateExprWithCleanups (ExprResult SubExpr)
ExprResult ActOnFinishFullExpr (Expr *Expr, bool DiscardedValue)
ExprResult ActOnFinishFullExpr (Expr *Expr, SourceLocation CC, bool DiscardedValue, bool IsConstexpr=false, bool IsTemplateArgument=false)
StmtResult ActOnFinishFullStmt (Stmt *Stmt)
ExprResult ActOnDecltypeExpression (Expr *E)
 Process the expression contained within a decltype.
bool checkLiteralOperatorId (const CXXScopeSpec &SS, const UnqualifiedId &Id, bool IsUDSuffix)
bool isUsualDeallocationFunction (const CXXMethodDecl *FD)
ConditionResult ActOnConditionVariable (Decl *ConditionVar, SourceLocation StmtLoc, ConditionKind CK)
ExprResult CheckConditionVariable (VarDecl *ConditionVar, SourceLocation StmtLoc, ConditionKind CK)
 Check the use of the given variable as a C++ condition in an if, while, do-while, or switch statement.
ExprResult CheckCXXBooleanCondition (Expr *CondExpr, bool IsConstexpr=false)
 CheckCXXBooleanCondition - Returns true if conversion to bool is invalid.
bool IsStringLiteralToNonConstPointerConversion (Expr *From, QualType ToType)
 Helper function to determine whether this is the (deprecated) C++ conversion from a string literal to a pointer to non-const char or non-const wchar_t (for narrow and wide string literals, respectively).
ExprResult PerformImplicitConversion (Expr *From, QualType ToType, const ImplicitConversionSequence &ICS, AssignmentAction Action, CheckedConversionKind CCK=CheckedConversionKind::Implicit)
 PerformImplicitConversion - Perform an implicit conversion of the expression From to the type ToType using the pre-computed implicit conversion sequence ICS.
ExprResult PerformImplicitConversion (Expr *From, QualType ToType, const StandardConversionSequence &SCS, AssignmentAction Action, CheckedConversionKind CCK)
 PerformImplicitConversion - Perform an implicit conversion of the expression From to the type ToType by following the standard conversion sequence SCS.
bool CheckTypeTraitArity (unsigned Arity, SourceLocation Loc, size_t N)
ExprResult ActOnTypeTrait (TypeTrait Kind, SourceLocation KWLoc, ArrayRef< ParsedType > Args, SourceLocation RParenLoc)
 Parsed one of the type trait support pseudo-functions.
ExprResult BuildTypeTrait (TypeTrait Kind, SourceLocation KWLoc, ArrayRef< TypeSourceInfo * > Args, SourceLocation RParenLoc)
ExprResult ActOnArrayTypeTrait (ArrayTypeTrait ATT, SourceLocation KWLoc, ParsedType LhsTy, Expr *DimExpr, SourceLocation RParen)
 ActOnArrayTypeTrait - Parsed one of the binary type trait support pseudo-functions.
ExprResult BuildArrayTypeTrait (ArrayTypeTrait ATT, SourceLocation KWLoc, TypeSourceInfo *TSInfo, Expr *DimExpr, SourceLocation RParen)
ExprResult ActOnExpressionTrait (ExpressionTrait OET, SourceLocation KWLoc, Expr *Queried, SourceLocation RParen)
 ActOnExpressionTrait - Parsed one of the unary type trait support pseudo-functions.
ExprResult BuildExpressionTrait (ExpressionTrait OET, SourceLocation KWLoc, Expr *Queried, SourceLocation RParen)
QualType CheckPointerToMemberOperands (ExprResult &LHS, ExprResult &RHS, ExprValueKind &VK, SourceLocation OpLoc, bool isIndirect)
QualType CheckVectorConditionalTypes (ExprResult &Cond, ExprResult &LHS, ExprResult &RHS, SourceLocation QuestionLoc)
bool IsCXXTriviallyRelocatableType (QualType T)
 Determines if a type is trivially relocatable according to the C++26 rules.
bool IsCXXTriviallyRelocatableType (const CXXRecordDecl &RD)
QualType CXXCheckConditionalOperands (ExprResult &cond, ExprResult &lhs, ExprResult &rhs, ExprValueKind &VK, ExprObjectKind &OK, SourceLocation questionLoc)
 Check the operands of ?
QualType FindCompositePointerType (SourceLocation Loc, Expr *&E1, Expr *&E2, bool ConvertArgs=true)
 Find a merged pointer type and convert the two expressions to it.
QualType FindCompositePointerType (SourceLocation Loc, ExprResult &E1, ExprResult &E2, bool ConvertArgs=true)
ExprResult MaybeBindToTemporary (Expr *E)
 MaybeBindToTemporary - If the passed in expression has a record type with a non-trivial destructor, this will return CXXBindTemporaryExpr.
ExprResult IgnoredValueConversions (Expr *E)
 IgnoredValueConversions - Given that an expression's result is syntactically ignored, perform any conversions that are required.
ExprResult CheckUnevaluatedOperand (Expr *E)
IfExistsResult CheckMicrosoftIfExistsSymbol (Scope *S, CXXScopeSpec &SS, const DeclarationNameInfo &TargetNameInfo)
IfExistsResult CheckMicrosoftIfExistsSymbol (Scope *S, SourceLocation KeywordLoc, bool IsIfExists, CXXScopeSpec &SS, UnqualifiedId &Name)
RequiresExprBodyDeclActOnStartRequiresExpr (SourceLocation RequiresKWLoc, ArrayRef< ParmVarDecl * > LocalParameters, Scope *BodyScope)
void ActOnFinishRequiresExpr ()
concepts::RequirementActOnSimpleRequirement (Expr *E)
concepts::RequirementActOnTypeRequirement (SourceLocation TypenameKWLoc, CXXScopeSpec &SS, SourceLocation NameLoc, const IdentifierInfo *TypeName, TemplateIdAnnotation *TemplateId)
concepts::RequirementActOnCompoundRequirement (Expr *E, SourceLocation NoexceptLoc)
concepts::RequirementActOnCompoundRequirement (Expr *E, SourceLocation NoexceptLoc, CXXScopeSpec &SS, TemplateIdAnnotation *TypeConstraint, unsigned Depth)
concepts::RequirementActOnNestedRequirement (Expr *Constraint)
concepts::ExprRequirementBuildExprRequirement (Expr *E, bool IsSatisfied, SourceLocation NoexceptLoc, concepts::ExprRequirement::ReturnTypeRequirement ReturnTypeRequirement)
concepts::ExprRequirementBuildExprRequirement (concepts::Requirement::SubstitutionDiagnostic *ExprSubstDiag, bool IsSatisfied, SourceLocation NoexceptLoc, concepts::ExprRequirement::ReturnTypeRequirement ReturnTypeRequirement)
concepts::TypeRequirementBuildTypeRequirement (TypeSourceInfo *Type)
concepts::TypeRequirementBuildTypeRequirement (concepts::Requirement::SubstitutionDiagnostic *SubstDiag)
concepts::NestedRequirementBuildNestedRequirement (Expr *E)
concepts::NestedRequirementBuildNestedRequirement (StringRef InvalidConstraintEntity, const ASTConstraintSatisfaction &Satisfaction)
ExprResult ActOnRequiresExpr (SourceLocation RequiresKWLoc, RequiresExprBodyDecl *Body, SourceLocation LParenLoc, ArrayRef< ParmVarDecl * > LocalParameters, SourceLocation RParenLoc, ArrayRef< concepts::Requirement * > Requirements, SourceLocation ClosingBraceLoc)

Initializers

Implementations are in SemaInit.cpp

llvm::SmallVector< QualType, 4 > CurrentParameterCopyTypes
 Stack of types that correspond to the parameter entities that are currently being copy-initialized.
llvm::DenseMap< unsigned, CXXDeductionGuideDecl * > AggregateDeductionCandidates
bool IsStringInit (Expr *Init, const ArrayType *AT)
bool CanPerformAggregateInitializationForOverloadResolution (const InitializedEntity &Entity, InitListExpr *From)
 Determine whether we can perform aggregate initialization for the purposes of overload resolution.
ExprResult ActOnDesignatedInitializer (Designation &Desig, SourceLocation EqualOrColonLoc, bool GNUSyntax, ExprResult Init)
void checkInitializerLifetime (const InitializedEntity &Entity, Expr *Init)
 Check that the lifetime of the initializer (and its subobjects) is sufficient for initializing the entity, and perform lifetime extension (when permitted) if not.
MaterializeTemporaryExprCreateMaterializeTemporaryExpr (QualType T, Expr *Temporary, bool BoundToLvalueReference)
ExprResult TemporaryMaterializationConversion (Expr *E)
 If E is a prvalue denoting an unmaterialized temporary, materialize it as an xvalue.
ExprResult PerformQualificationConversion (Expr *E, QualType Ty, ExprValueKind VK=VK_PRValue, CheckedConversionKind CCK=CheckedConversionKind::Implicit)
bool CanPerformCopyInitialization (const InitializedEntity &Entity, ExprResult Init)
ExprResult PerformCopyInitialization (const InitializedEntity &Entity, SourceLocation EqualLoc, ExprResult Init, bool TopLevelOfInitList=false, bool AllowExplicit=false)
QualType DeduceTemplateSpecializationFromInitializer (TypeSourceInfo *TInfo, const InitializedEntity &Entity, const InitializationKind &Kind, MultiExprArg Init)

Function Effects

Implementations are in SemaFunctionEffects.cpp

SmallVector< const Decl * > DeclsWithEffectsToVerify
 All functions/lambdas/blocks which have bodies and which have a non-empty FunctionEffectsRef to be verified.
FunctionEffectKindSet AllEffectsToVerify
 The union of all effects present on DeclsWithEffectsToVerify.
bool diagnoseConflictingFunctionEffect (const FunctionEffectsRef &FX, const FunctionEffectWithCondition &EC, SourceLocation NewAttrLoc)
 Warn and return true if adding a function effect to a set would create a conflict.
void diagnoseFunctionEffectMergeConflicts (const FunctionEffectSet::Conflicts &Errs, SourceLocation NewLoc, SourceLocation OldLoc)
template<class FuncOrBlockDecl>
void maybeAddDeclWithEffects (FuncOrBlockDecl *D)
 Inline checks from the start of maybeAddDeclWithEffects, to minimize performance impact on code not using effects.
void maybeAddDeclWithEffects (const Decl *D, const FunctionEffectsRef &FX)
 Potentially add a FunctionDecl or BlockDecl to DeclsWithEffectsToVerify.
void addDeclWithEffects (const Decl *D, const FunctionEffectsRef &FX)
 Unconditionally add a Decl to DeclsWithEfffectsToVerify.
void performFunctionEffectAnalysis (TranslationUnitDecl *TU)

API Notes

Implementations are in SemaAPINotes.cpp

void ProcessAPINotes (Decl *D)
 Map any API notes provided for this declaration to attributes on the declaration.
void ApplyNullability (Decl *D, NullabilityKind Nullability)
 Apply the 'Nullability:' annotation to the specified declaration.
void ApplyAPINotesType (Decl *D, StringRef TypeString)
 Apply the 'Type:' annotation to the specified declaration.
bool captureSwiftVersionIndependentAPINotes ()
 Whether APINotes should be gathered for all applicable Swift language versions, without being applied.

Availability Attribute Handling

Implementations are in SemaAvailability.cpp

void DiagnoseUnguardedAvailabilityViolations (Decl *FD)
 Issue any -Wunguarded-availability warnings in FD.
void handleDelayedAvailabilityCheck (sema::DelayedDiagnostic &DD, Decl *Ctx)
sema::FunctionScopeInfogetCurFunctionAvailabilityContext ()
 Retrieve the current function, if any, that should be analyzed for potential availability violations.
void DiagnoseAvailabilityOfDecl (NamedDecl *D, ArrayRef< SourceLocation > Locs, const ObjCInterfaceDecl *UnknownObjCClass, bool ObjCPropertyAccess, bool AvoidPartialAvailabilityChecks, ObjCInterfaceDecl *ClassReceiver)
void DiagnoseAvailabilityOfDecl (NamedDecl *D, ArrayRef< SourceLocation > Locs)
std::pair< AvailabilityResult, const NamedDecl * > ShouldDiagnoseAvailabilityOfDecl (const NamedDecl *D, std::string *Message, ObjCInterfaceDecl *ClassReceiver)
 The diagnostic we should emit for D, and the declaration that originated it, or AR_Available.

Bounds Safety

Implementations are in SemaBoundsSafety.cpp

bool CheckCountedByAttrOnField (FieldDecl *FD, Expr *E, bool CountInBytes, bool OrNull)
 Check if applying the specified attribute variant from the "counted by" family of attributes to FieldDecl FD is semantically valid.
bool BoundsSafetyCheckAssignmentToCountAttrPtr (QualType LHSTy, Expr *RHSExpr, AssignmentAction Action, SourceLocation Loc, const ValueDecl *Assignee, bool ShowFullyQualifiedAssigneeName)
 Perform Bounds Safety Semantic checks for assigning to a __counted_by or __counted_by_or_null pointer type.
bool BoundsSafetyCheckInitialization (const InitializedEntity &Entity, const InitializationKind &Kind, AssignmentAction Action, QualType LHSType, Expr *RHSExpr)
 Perform Bounds Safety Semantic checks for initializing a Bounds Safety pointer.
bool BoundsSafetyCheckUseOfCountAttrPtr (const Expr *E)
 Perform Bounds Safety semantic checks for uses of invalid uses counted_by or counted_by_or_null pointers in.

Casts

Implementations are in SemaCast.cpp

ExprResult ActOnCXXNamedCast (SourceLocation OpLoc, tok::TokenKind Kind, SourceLocation LAngleBracketLoc, Declarator &D, SourceLocation RAngleBracketLoc, SourceLocation LParenLoc, Expr *E, SourceLocation RParenLoc)
 ActOnCXXNamedCast - Parse {dynamic,static,reinterpret,const,addrspace}_cast's.
ExprResult BuildCXXNamedCast (SourceLocation OpLoc, tok::TokenKind Kind, TypeSourceInfo *Ty, Expr *E, SourceRange AngleBrackets, SourceRange Parens)
ExprResult ActOnBuiltinBitCastExpr (SourceLocation KWLoc, Declarator &Dcl, ExprResult Operand, SourceLocation RParenLoc)
ExprResult BuildBuiltinBitCastExpr (SourceLocation KWLoc, TypeSourceInfo *TSI, Expr *Operand, SourceLocation RParenLoc)
void CheckCompatibleReinterpretCast (QualType SrcType, QualType DestType, bool IsDereference, SourceRange Range)
bool ShouldSplatAltivecScalarInCast (const VectorType *VecTy)
bool CheckAltivecInitFromScalar (SourceRange R, QualType VecTy, QualType SrcTy)
ExprResult BuildCStyleCastExpr (SourceLocation LParenLoc, TypeSourceInfo *Ty, SourceLocation RParenLoc, Expr *Op)
ExprResult BuildCXXFunctionalCastExpr (TypeSourceInfo *TInfo, QualType Type, SourceLocation LParenLoc, Expr *CastExpr, SourceLocation RParenLoc)
static bool isCast (CheckedConversionKind CCK)

C++ Scope Specifiers

Implementations are in SemaCXXScopeSpec.cpp

bool RequireCompleteDeclContext (CXXScopeSpec &SS, DeclContext *DC)
 Require that the context specified by SS be complete.
bool RequireCompleteEnumDecl (EnumDecl *D, SourceLocation L, CXXScopeSpec *SS=nullptr)
 Require that the EnumDecl is completed with its enumerators defined or instantiated.
DeclContextcomputeDeclContext (QualType T)
 Compute the DeclContext that is associated with the given type.
DeclContextcomputeDeclContext (const CXXScopeSpec &SS, bool EnteringContext=false)
 Compute the DeclContext that is associated with the given scope specifier.
bool isDependentScopeSpecifier (const CXXScopeSpec &SS)
CXXRecordDeclgetCurrentInstantiationOf (NestedNameSpecifier NNS)
 If the given nested name specifier refers to the current instantiation, return the declaration that corresponds to that current instantiation (C++0x [temp.dep.type]p1).
bool ActOnCXXGlobalScopeSpecifier (SourceLocation CCLoc, CXXScopeSpec &SS)
 The parser has parsed a global nested-name-specifier '::'.
bool ActOnSuperScopeSpecifier (SourceLocation SuperLoc, SourceLocation ColonColonLoc, CXXScopeSpec &SS)
 The parser has parsed a '__super' nested-name-specifier.
bool isAcceptableNestedNameSpecifier (const NamedDecl *SD, bool *CanCorrect=nullptr)
 Determines whether the given declaration is an valid acceptable result for name lookup of a nested-name-specifier.
NamedDeclFindFirstQualifierInScope (Scope *S, NestedNameSpecifier NNS)
 If the given nested-name-specifier begins with a bare identifier (e.g., Base::), perform name lookup for that identifier as a nested-name-specifier within the given scope, and return the result of that name lookup.
bool BuildCXXNestedNameSpecifier (Scope *S, NestedNameSpecInfo &IdInfo, bool EnteringContext, CXXScopeSpec &SS, NamedDecl *ScopeLookupResult, bool ErrorRecoveryLookup, bool *IsCorrectedToColon=nullptr, bool OnlyNamespace=false)
 Build a new nested-name-specifier for "identifier::", as described by ActOnCXXNestedNameSpecifier.
bool ActOnCXXNestedNameSpecifier (Scope *S, NestedNameSpecInfo &IdInfo, bool EnteringContext, CXXScopeSpec &SS, bool *IsCorrectedToColon=nullptr, bool OnlyNamespace=false)
 The parser has parsed a nested-name-specifier 'identifier::'.
bool ActOnCXXNestedNameSpecifier (Scope *S, CXXScopeSpec &SS, SourceLocation TemplateKWLoc, TemplateTy TemplateName, SourceLocation TemplateNameLoc, SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgs, SourceLocation RAngleLoc, SourceLocation CCLoc, bool EnteringContext)
 The parser has parsed a nested-name-specifier 'template[opt] template-name < template-args >::'.
bool ActOnCXXNestedNameSpecifierDecltype (CXXScopeSpec &SS, const DeclSpec &DS, SourceLocation ColonColonLoc)
bool ActOnCXXNestedNameSpecifierIndexedPack (CXXScopeSpec &SS, const DeclSpec &DS, SourceLocation ColonColonLoc, QualType Type)
bool IsInvalidUnlessNestedName (Scope *S, CXXScopeSpec &SS, NestedNameSpecInfo &IdInfo, bool EnteringContext)
 IsInvalidUnlessNestedName - This method is used for error recovery purposes to determine whether the specified identifier is only valid as a nested name specifier, for example a namespace name.
void * SaveNestedNameSpecifierAnnotation (CXXScopeSpec &SS)
 Given a C++ nested-name-specifier, produce an annotation value that the parser can use later to reconstruct the given nested-name-specifier.
void RestoreNestedNameSpecifierAnnotation (void *Annotation, SourceRange AnnotationRange, CXXScopeSpec &SS)
 Given an annotation pointer for a nested-name-specifier, restore the nested-name-specifier structure.
bool ShouldEnterDeclaratorScope (Scope *S, const CXXScopeSpec &SS)
bool ActOnCXXEnterDeclaratorScope (Scope *S, CXXScopeSpec &SS)
 ActOnCXXEnterDeclaratorScope - Called when a C++ scope specifier (global scope or nested-name-specifier) is parsed, part of a declarator-id.
void ActOnCXXExitDeclaratorScope (Scope *S, const CXXScopeSpec &SS)
 ActOnCXXExitDeclaratorScope - Called when a declarator that previously invoked ActOnCXXEnterDeclaratorScope(), is finished.

Member Access Expressions

Implementations are in SemaExprMember.cpp

bool isPotentialImplicitMemberAccess (const CXXScopeSpec &SS, LookupResult &R, bool IsAddressOfOperand)
 Check whether an expression might be an implicit class member access.
ExprResult BuildPossibleImplicitMemberExpr (const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, LookupResult &R, const TemplateArgumentListInfo *TemplateArgs, const Scope *S)
 Builds an expression which might be an implicit member expression.
ExprResult BuildImplicitMemberExpr (const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, LookupResult &R, const TemplateArgumentListInfo *TemplateArgs, bool IsDefiniteInstance, const Scope *S)
 Builds an implicit member access expression.
ExprResult ActOnDependentMemberExpr (Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OpLoc, const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierInScope, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs)
ExprResult ActOnMemberAccessExpr (Scope *S, Expr *Base, SourceLocation OpLoc, tok::TokenKind OpKind, CXXScopeSpec &SS, SourceLocation TemplateKWLoc, UnqualifiedId &Member, Decl *ObjCImpDecl)
 The main callback when the parser finds something like expression .
MemberExprBuildMemberExpr (Expr *Base, bool IsArrow, SourceLocation OpLoc, NestedNameSpecifierLoc NNS, SourceLocation TemplateKWLoc, ValueDecl *Member, DeclAccessPair FoundDecl, bool HadMultipleCandidates, const DeclarationNameInfo &MemberNameInfo, QualType Ty, ExprValueKind VK, ExprObjectKind OK, const TemplateArgumentListInfo *TemplateArgs=nullptr)
bool CheckQualifiedMemberReference (Expr *BaseExpr, QualType BaseType, const CXXScopeSpec &SS, const LookupResult &R)
ExprResult BuildMemberReferenceExpr (Expr *Base, QualType BaseType, SourceLocation OpLoc, bool IsArrow, CXXScopeSpec &SS, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierInScope, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs, const Scope *S, ActOnMemberAccessExtraArgs *ExtraArgs=nullptr)
ExprResult BuildMemberReferenceExpr (Expr *Base, QualType BaseType, SourceLocation OpLoc, bool IsArrow, const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierInScope, LookupResult &R, const TemplateArgumentListInfo *TemplateArgs, const Scope *S, bool SuppressQualifierCheck=false, ActOnMemberAccessExtraArgs *ExtraArgs=nullptr)
ExprResult BuildFieldReferenceExpr (Expr *BaseExpr, bool IsArrow, SourceLocation OpLoc, const CXXScopeSpec &SS, FieldDecl *Field, DeclAccessPair FoundDecl, const DeclarationNameInfo &MemberNameInfo)
ExprResult PerformMemberExprBaseConversion (Expr *Base, bool IsArrow)
 Perform conversions on the LHS of a member access expression.
ExprResult BuildAnonymousStructUnionMemberReference (const CXXScopeSpec &SS, SourceLocation nameLoc, IndirectFieldDecl *indirectField, DeclAccessPair FoundDecl=DeclAccessPair::make(nullptr, AS_none), Expr *baseObjectExpr=nullptr, SourceLocation opLoc=SourceLocation())

C++ Lambda Expressions

Implementations are in SemaLambda.cpp

CXXRecordDeclcreateLambdaClosureType (SourceRange IntroducerRange, TypeSourceInfo *Info, unsigned LambdaDependencyKind, LambdaCaptureDefault CaptureDefault)
 Create a new lambda closure type.
void handleLambdaNumbering (CXXRecordDecl *Class, CXXMethodDecl *Method, std::optional< CXXRecordDecl::LambdaNumbering > NumberingOverride=std::nullopt)
 Number lambda for linkage purposes if necessary.
void buildLambdaScope (sema::LambdaScopeInfo *LSI, CXXMethodDecl *CallOperator, SourceRange IntroducerRange, LambdaCaptureDefault CaptureDefault, SourceLocation CaptureDefaultLoc, bool ExplicitParams, bool Mutable)
 Endow the lambda scope info with the relevant properties.
CXXMethodDeclCreateLambdaCallOperator (SourceRange IntroducerRange, CXXRecordDecl *Class)
void AddTemplateParametersToLambdaCallOperator (CXXMethodDecl *CallOperator, CXXRecordDecl *Class, TemplateParameterList *TemplateParams)
void CompleteLambdaCallOperator (CXXMethodDecl *Method, SourceLocation LambdaLoc, SourceLocation CallOperatorLoc, const AssociatedConstraint &TrailingRequiresClause, TypeSourceInfo *MethodTyInfo, ConstexprSpecKind ConstexprKind, StorageClass SC, ArrayRef< ParmVarDecl * > Params, bool HasExplicitResultType)
bool DiagnoseInvalidExplicitObjectParameterInLambda (CXXMethodDecl *Method, SourceLocation CallLoc)
 Returns true if the explicit object parameter was invalid.
ParsedType actOnLambdaInitCaptureInitialization (SourceLocation Loc, bool ByRef, SourceLocation EllipsisLoc, IdentifierInfo *Id, LambdaCaptureInitKind InitKind, Expr *&Init)
 Perform initialization analysis of the init-capture and perform any implicit conversions such as an lvalue-to-rvalue conversion if not being used to initialize a reference.
QualType buildLambdaInitCaptureInitialization (SourceLocation Loc, bool ByRef, SourceLocation EllipsisLoc, UnsignedOrNone NumExpansions, IdentifierInfo *Id, bool DirectInit, Expr *&Init)
VarDeclcreateLambdaInitCaptureVarDecl (SourceLocation Loc, QualType InitCaptureType, SourceLocation EllipsisLoc, IdentifierInfo *Id, unsigned InitStyle, Expr *Init, DeclContext *DeclCtx)
 Create a dummy variable within the declcontext of the lambda's call operator, for name lookup purposes for a lambda init capture.
void addInitCapture (sema::LambdaScopeInfo *LSI, VarDecl *Var, bool ByRef)
 Add an init-capture to a lambda scope.
void finishLambdaExplicitCaptures (sema::LambdaScopeInfo *LSI)
 Note that we have finished the explicit captures for the given lambda.
void deduceClosureReturnType (sema::CapturingScopeInfo &CSI)
 Deduce a block or lambda's return type based on the return statements present in the body.
void ActOnLambdaExpressionAfterIntroducer (LambdaIntroducer &Intro, Scope *CurContext)
 Once the Lambdas capture are known, we can start to create the closure, call operator method, and keep track of the captures.
void ActOnLambdaExplicitTemplateParameterList (LambdaIntroducer &Intro, SourceLocation LAngleLoc, ArrayRef< NamedDecl * > TParams, SourceLocation RAngleLoc, ExprResult RequiresClause)
 This is called after parsing the explicit template parameter list on a lambda (if it exists) in C++2a.
void ActOnLambdaClosureQualifiers (LambdaIntroducer &Intro, SourceLocation MutableLoc)
void ActOnLambdaClosureParameters (Scope *LambdaScope, MutableArrayRef< DeclaratorChunk::ParamInfo > ParamInfo)
void ActOnStartOfLambdaDefinition (LambdaIntroducer &Intro, Declarator &ParamInfo, const DeclSpec &DS)
 ActOnStartOfLambdaDefinition - This is called just before we start parsing the body of a lambda; it analyzes the explicit captures and arguments, and sets up various data-structures for the body of the lambda.
void ActOnLambdaError (SourceLocation StartLoc, Scope *CurScope, bool IsInstantiation=false)
 ActOnLambdaError - If there is an error parsing a lambda, this callback is invoked to pop the information about the lambda.
ExprResult ActOnLambdaExpr (SourceLocation StartLoc, Stmt *Body)
 ActOnLambdaExpr - This is called when the body of a lambda expression was successfully completed.
bool CaptureHasSideEffects (const sema::Capture &From)
 Does copying/destroying the captured variable have side effects?
bool DiagnoseUnusedLambdaCapture (SourceRange CaptureRange, SourceRange FixItRange, const sema::Capture &From)
 Diagnose if an explicit lambda capture is unused.
FieldDeclBuildCaptureField (RecordDecl *RD, const sema::Capture &Capture)
 Build a FieldDecl suitable to hold the given capture.
ExprResult BuildCaptureInit (const sema::Capture &Capture, SourceLocation ImplicitCaptureLoc, bool IsOpenMPMapping=false)
 Initialize the given capture with a suitable expression.
ExprResult BuildLambdaExpr (SourceLocation StartLoc, SourceLocation EndLoc)
 Complete a lambda-expression having processed and attached the lambda body.
QualType getLambdaConversionFunctionResultType (const FunctionProtoType *CallOpType, CallingConv CC)
 Get the return type to use for a lambda's conversion function(s) to function pointer type, given the type of the call operator.
ExprResult BuildBlockForLambdaConversion (SourceLocation CurrentLocation, SourceLocation ConvLocation, CXXConversionDecl *Conv, Expr *Src)
std::tuple< MangleNumberingContext *, Decl * > getCurrentMangleNumberContext (const DeclContext *DC)
 Compute the mangling number context for a lambda expression or block literal.

<tt>inline asm</tt> Statement

Implementations are in SemaStmtAsm.cpp

ExprResult ActOnGCCAsmStmtString (Expr *Stm, bool ForAsmLabel)
StmtResult ActOnGCCAsmStmt (SourceLocation AsmLoc, bool IsSimple, bool IsVolatile, unsigned NumOutputs, unsigned NumInputs, IdentifierInfo **Names, MultiExprArg Constraints, MultiExprArg Exprs, Expr *AsmString, MultiExprArg Clobbers, unsigned NumLabels, SourceLocation RParenLoc)
void FillInlineAsmIdentifierInfo (Expr *Res, llvm::InlineAsmIdentifierInfo &Info)
ExprResult LookupInlineAsmIdentifier (CXXScopeSpec &SS, SourceLocation TemplateKWLoc, UnqualifiedId &Id, bool IsUnevaluatedContext)
bool LookupInlineAsmField (StringRef Base, StringRef Member, unsigned &Offset, SourceLocation AsmLoc)
ExprResult LookupInlineAsmVarDeclField (Expr *RefExpr, StringRef Member, SourceLocation AsmLoc)
StmtResult ActOnMSAsmStmt (SourceLocation AsmLoc, SourceLocation LBraceLoc, ArrayRef< Token > AsmToks, StringRef AsmString, unsigned NumOutputs, unsigned NumInputs, ArrayRef< StringRef > Constraints, ArrayRef< StringRef > Clobbers, ArrayRef< Expr * > Exprs, SourceLocation EndLoc)
LabelDeclGetOrCreateMSAsmLabel (StringRef ExternalLabelName, SourceLocation Location, bool AlwaysCreate)

Statement Attribute Handling

Implementations are in SemaStmtAttr.cpp

bool CheckNoInlineAttr (const Stmt *OrigSt, const Stmt *CurSt, const AttributeCommonInfo &A)
bool CheckAlwaysInlineAttr (const Stmt *OrigSt, const Stmt *CurSt, const AttributeCommonInfo &A)
CodeAlignAttr * BuildCodeAlignAttr (const AttributeCommonInfo &CI, Expr *E)
bool CheckRebuiltStmtAttributes (ArrayRef< const Attr * > Attrs)
void ProcessStmtAttributes (Stmt *Stmt, const ParsedAttributes &InAttrs, SmallVectorImpl< const Attr * > &OutAttrs)
 Process the attributes before creating an attributed statement.
ExprResult ActOnCXXAssumeAttr (Stmt *St, const ParsedAttr &A, SourceRange Range)
ExprResult BuildCXXAssumeExpr (Expr *Assumption, const IdentifierInfo *AttrName, SourceRange Range)

C++ Template Deduction Guide

Implementations are in SemaTemplateDeductionGuide.cpp

void DeclareImplicitDeductionGuides (TemplateDecl *Template, SourceLocation Loc)
 Declare implicit deduction guides for a class template if we've not already done so.
FunctionTemplateDeclDeclareAggregateDeductionGuideFromInitList (TemplateDecl *Template, MutableArrayRef< QualType > ParamTypes, SourceLocation Loc)

FixIt Helpers

Implementations are in SemaFixItUtils.cpp

std::string getFixItZeroInitializerForType (QualType T, SourceLocation Loc) const
 Get a string to suggest for zero-initialization of a type.
std::string getFixItZeroLiteralForType (QualType T, SourceLocation Loc) const

Additional Inherited Members

Public Member Functions inherited from clang::SemaBase
 SemaBase (Sema &S)
ASTContextgetASTContext () const
DiagnosticsEnginegetDiagnostics () const
const LangOptionsgetLangOpts () const
DeclContextgetCurContext () const
SemaDiagnosticBuilder Diag (SourceLocation Loc, unsigned DiagID)
 Emit a diagnostic.
SemaDiagnosticBuilder Diag (SourceLocation Loc, const PartialDiagnostic &PD)
 Emit a partial diagnostic.
SemaDiagnosticBuilder DiagCompat (SourceLocation Loc, unsigned CompatDiagId)
 Emit a compatibility diagnostic.
PartialDiagnostic PDiag (unsigned DiagID=0)
 Build a partial diagnostic.
Public Attributes inherited from clang::SemaBase
SemaSemaRef

Detailed Description

Sema - This implements semantic analysis and AST building for C.

Definition at line 856 of file Sema.h.

Member Typedef Documentation

◆ ADLCallKind

Definition at line 7493 of file Sema.h.

◆ AssociatedClassSet

◆ AssociatedNamespaceSet

◆ CapturedParamNameType

typedef std::pair<StringRef, QualType> clang::Sema::CapturedParamNameType

Definition at line 11248 of file Sema.h.

◆ ConstrainedDeclOrNestedRequirement

Initial value:
llvm::PointerUnion<const NamedDecl *,
This represents a decl that may have a name.
Definition Decl.h:274
A requires-expression requirement which is satisfied when a general constraint expression is satisfie...

Definition at line 14882 of file Sema.h.

◆ DeclGroupPtrTy

Definition at line 1279 of file Sema.h.

◆ DelegatingCtorDeclsType

◆ DeleteExprLoc

Definition at line 968 of file Sema.h.

◆ DeleteLocs

Definition at line 969 of file Sema.h.

◆ DiagReceiverTy

typedef llvm::function_ref<void(SourceLocation Loc, PartialDiagnostic PD)> clang::Sema::DiagReceiverTy

Definition at line 4598 of file Sema.h.

◆ EntityPrinter

using clang::Sema::EntityPrinter = llvm::function_ref<void(llvm::raw_ostream &)>

Definition at line 13979 of file Sema.h.

◆ ExtVectorDeclsType

◆ IdentifierSourceLocations

Definition at line 9299 of file Sema.h.

◆ ImmediateInvocationCandidate

using clang::Sema::ImmediateInvocationCandidate = llvm::PointerIntPair<ConstantExpr *, 1>

Definition at line 6782 of file Sema.h.

◆ InstantiatingSpecializationsKey

using clang::Sema::InstantiatingSpecializationsKey = llvm::PointerIntPair<Decl *, 2>

Definition at line 13087 of file Sema.h.

◆ InstantiationContextDiagFuncRef

Initial value:
llvm::function_ref<void(SourceLocation, PartialDiagnostic)>
Encodes a location in the source.

Definition at line 2291 of file Sema.h.

◆ LateInstantiatedAttrVec

◆ LateParsedTemplateMapT

typedef llvm::MapVector<const FunctionDecl *, std::unique_ptr<LateParsedTemplate> > clang::Sema::LateParsedTemplateMapT

Definition at line 11387 of file Sema.h.

◆ LateTemplateParserCB

typedef void clang::Sema::LateTemplateParserCB(void *P, LateParsedTemplate &LPT)

Callback to the parser to parse templated functions when needed.

Definition at line 1330 of file Sema.h.

◆ MaybeODRUseExprSet

Store a set of either DeclRefExprs or MemberExprs that contain a reference to a variable (constant) that may or may not be odr-used in this Expr, and we won't know until all lvalue-to-rvalue and discarded value conversions have been applied to all subexpressions of the enclosing full expression.

This is cleared at the end of each full expression.

Definition at line 6779 of file Sema.h.

◆ NamedDeclSetType

Definition at line 6521 of file Sema.h.

◆ ParsingClassState

◆ ParsingDeclState

◆ PendingImplicitInstantiation

An entity for which implicit template instantiation is required.

The source location associated with the declaration is the first place in the source code where the declaration was "used". It is not necessarily the point of instantiation (which will be either before or after the namespace-scope declaration that triggered this implicit instantiation), However, it is the location that diagnostics should generally refer to, because users will need to know what code triggered the instantiation.

Definition at line 14007 of file Sema.h.

◆ PoppedFunctionScopePtr

Initial value:
std::unique_ptr<sema::FunctionScopeInfo, PoppedFunctionScopeDeleter>

Definition at line 1061 of file Sema.h.

◆ ProcessingContextState

◆ RecordDeclSetTy

Definition at line 6525 of file Sema.h.

◆ ReferenceConversions

◆ SatisfactionStackEntryTy

Initial value:
std::pair<const NamedDecl *, llvm::FoldingSetNodeID>

Definition at line 14853 of file Sema.h.

◆ SkippedDefinitionContext

Definition at line 4387 of file Sema.h.

◆ SpecialMemberDecl

Definition at line 6560 of file Sema.h.

◆ SrcLocSet

typedef llvm::SmallSet<SourceLocation, 2> clang::Sema::SrcLocSet

Definition at line 9298 of file Sema.h.

◆ SuppressedDiagnosticsMap

For each declaration that involved template argument deduction, the set of diagnostics that were suppressed during that template argument deduction.

FIXME: Serialize this structure to the AST file.

Definition at line 12546 of file Sema.h.

◆ TemplateTy

Definition at line 1280 of file Sema.h.

◆ TentativeDefinitionsType

◆ TypeTagMagicValue

typedef std::pair<const IdentifierInfo *, uint64_t> clang::Sema::TypeTagMagicValue

A pair of ArgumentKind identifier and magic value.

This uniquely identifies the magic value.

Definition at line 2692 of file Sema.h.

◆ TypeTy

Definition at line 1281 of file Sema.h.

◆ UnparsedDefaultArgInstantiationsMap

typedef llvm::DenseMap<ParmVarDecl *, llvm::TinyPtrVector<ParmVarDecl *> > clang::Sema::UnparsedDefaultArgInstantiationsMap

Definition at line 13076 of file Sema.h.

◆ UnusedFileScopedDeclsType

◆ UTTKind

using clang::Sema::UTTKind = UnaryTransformType::UTTKind

Definition at line 15396 of file Sema.h.

◆ VTableUse

The list of classes whose vtables have been used within this translation unit, and the source locations at which the first use occurred.

Definition at line 5872 of file Sema.h.

Member Enumeration Documentation

◆ AbstractDiagSelID

Enumerator
AbstractNone 
AbstractReturnType 
AbstractParamType 
AbstractVariableType 
AbstractFieldType 
AbstractIvarType 
AbstractSynthesizedIvarType 
AbstractArrayType 

Definition at line 6247 of file Sema.h.

◆ AcceptableKind

enum class clang::Sema::AcceptableKind
strong
Enumerator
Visible 
Reachable 

Definition at line 9341 of file Sema.h.

◆ AccessResult

Enumerator
AR_accessible 
AR_inaccessible 
AR_dependent 
AR_delayed 

Definition at line 1660 of file Sema.h.

◆ AllowedExplicit

enum class clang::Sema::AllowedExplicit
strong
Enumerator
None 

Allow no explicit functions to be used.

Conversions 

Allow explicit conversion functions but not explicit constructors.

All 

Allow both explicit conversion functions and explicit constructors.

Definition at line 10129 of file Sema.h.

◆ AssumedTemplateKind

Enumerator
None 

This is not assumed to be a template name.

FoundNothing 

This is assumed to be a template name because lookup found nothing.

FoundFunctions 

This is assumed to be a template name because lookup found one or more functions (but no function templates).

Definition at line 11438 of file Sema.h.

◆ AtomicArgumentOrder

Enumerator
API 
AST 

Definition at line 2719 of file Sema.h.

◆ AvailabilityPriority

Describes the kind of priority given to an availability attribute.

The sum of priorities deteremines the final priority of the attribute. The final priority determines how the attribute will be merged. An attribute with a lower priority will always remove higher priority attributes for the specified platform when it is being applied. An attribute with a higher priority will not be applied if the declaration already has an availability attribute with a lower priority for the specified platform. The final prirority values are not expected to match the values in this enumeration, but instead should be treated as a plain integer value. This enumeration just names the priority weights that are used to calculate that final vaue.

Enumerator
AP_Explicit 

The availability attribute was specified explicitly next to the declaration.

AP_PragmaClangAttribute 

The availability attribute was applied using '#pragma clang attribute'.

AP_InferredFromOtherPlatform 

The availability attribute for a specific platform was inferred from an availability attribute for another platform.

Definition at line 4823 of file Sema.h.

◆ BuildForRangeKind

Enumerator
BFRK_Build 

Initial building of a for-range statement.

BFRK_Rebuild 

Instantiation or recovery rebuild of a for-range statement.

Don't attempt any typo-correction.

BFRK_Check 

Determining whether a for-range statement could be built.

Avoid any unnecessary or irreversible actions.

Definition at line 11071 of file Sema.h.

◆ CallingConventionIgnoredReason

Describes the reason a calling convention specification was ignored, used for diagnostics.

Enumerator
ForThisTarget 
VariadicFunction 
ConstructorDestructor 
BuiltinFunction 

Definition at line 4838 of file Sema.h.

◆ CheckConstexprKind

Enumerator
Diagnose 

Diagnose issues that are non-constant or that are extensions.

CheckValid 

Identify whether this function satisfies the formal rules for constexpr functions in the current lanugage mode (with no extensions).

Definition at line 6436 of file Sema.h.

◆ CheckTemplateArgumentKind

Specifies the context in which a particular template argument is being checked.

Enumerator
CTAK_Specified 

The template argument was specified in the code or was instantiated with some deduced template arguments.

CTAK_Deduced 

The template argument was deduced via template argument deduction.

CTAK_DeducedFromArrayBound 

The template argument was deduced from an array bound via template argument deduction.

Definition at line 11986 of file Sema.h.

◆ ComparisonCategoryUsage

Enumerator
OperatorInExpression 

The '<=>' operator was used in an expression and a builtin operator was selected.

DefaultedOperator 

A defaulted 'operator<=>' needed the comparison category.

This typically only applies to 'std::strong_ordering', due to the implicit fallback return value.

Definition at line 5256 of file Sema.h.

◆ CompleteTypeKind

enum class clang::Sema::CompleteTypeKind
strong
Enumerator
Normal 

Apply the normal rules for complete types.

In particular, treat all sizeless types as incomplete.

AcceptSizeless 

Relax the normal rules for complete types so that they include sizeless built-in types.

Default 

Definition at line 15085 of file Sema.h.

◆ ConditionKind

enum class clang::Sema::ConditionKind
strong
Enumerator
Boolean 

A boolean condition, from 'if', 'while', 'for', or 'do'.

ConstexprIf 

A constant boolean condition from 'if constexpr'.

Switch 

An integral condition for a 'switch' statement.

Definition at line 7859 of file Sema.h.

◆ DefaultedComparisonKind

Kinds of defaulted comparison operator functions.

Enumerator
None 

This is not a defaultable comparison operator.

Equal 

This is an operator== that should be implemented as a series of subobject comparisons.

ThreeWay 

This is an operator<=> that should be implemented as a series of subobject comparisons.

NotEqual 

This is an operator!= that should be implemented as a rewrite in terms of a == comparison.

Relational 

This is an <, <=, >, or >= that should be implemented as a rewrite in terms of a <=> comparison.

Definition at line 6097 of file Sema.h.

◆ DiagCtorKind

enum class clang::Sema::DiagCtorKind
strong
Enumerator
None 
Implicit 
Typename 

Definition at line 3607 of file Sema.h.

◆ EltwiseBuiltinArgTyRestriction

Enumerator
None 
FloatTy 
IntegerTy 
SignedIntOrFloatTy 

Definition at line 2785 of file Sema.h.

◆ ExpressionEvaluationContext

Describes how the expressions currently being parsed are evaluated at run-time, if at all.

Enumerator
Unevaluated 

The current expression and its subexpressions occur within an unevaluated operand (C++11 [expr]p7), such as the subexpression of sizeof, where the type of the expression may be significant but no code will be generated to evaluate the value of the expression at run time.

UnevaluatedList 

The current expression occurs within a braced-init-list within an unevaluated operand.

This is mostly like a regular unevaluated context, except that we still instantiate constexpr functions that are referenced here so that we can perform narrowing checks correctly.

DiscardedStatement 

The current expression occurs within a discarded statement.

This behaves largely similarly to an unevaluated operand in preventing definitions from being required, but not in other ways.

UnevaluatedAbstract 

The current expression occurs within an unevaluated operand that unconditionally permits abstract references to fields, such as a SIZE operator in MS-style inline assembly.

ConstantEvaluated 

The current context is "potentially evaluated" in C++11 terms, but the expression is evaluated at compile-time (like the values of cases in a switch statement).

ImmediateFunctionContext 

In addition of being constant evaluated, the current expression occurs in an immediate function context - either a consteval function or a consteval if statement.

PotentiallyEvaluated 

The current expression is potentially evaluated at run time, which means that code may be generated to evaluate the value of the expression at run time.

PotentiallyEvaluatedIfUsed 

The current expression is potentially evaluated, but any declarations referenced inside that expression are only used if in fact the current expression is used.

This value is used when parsing default function arguments, for which we would like to provide diagnostics (e.g., passing non-POD arguments through varargs) but do not want to mark declarations as "referenced" until the default argument is used.

Definition at line 6724 of file Sema.h.

◆ FnBodyKind

enum class clang::Sema::FnBodyKind
strong
Enumerator
Other 

C++26 [dcl.fct.def.general]p1 function-body: ctor-initializer[opt] compound-statement function-try-block.

Default 

= default ;

Delete 

deleted-function-body

deleted-function-body: = delete ; = delete ( unevaluated-string ) ;

Definition at line 4156 of file Sema.h.

◆ FormatArgumentPassingKind

Enumerator
FAPK_Fixed 
FAPK_Variadic 
FAPK_VAList 
FAPK_Elsewhere 

Definition at line 2622 of file Sema.h.

◆ ForRangeStatus

Enumerator
FRS_Success 
FRS_NoViableFunction 
FRS_DiagnosticIssued 

Definition at line 10799 of file Sema.h.

◆ FunctionEmissionStatus

Status of the function emission on the CUDA/HIP/OpenMP host/device attrs.

Enumerator
Emitted 
CUDADiscarded 
OMPDiscarded 
TemplateDiscarded 
Unknown 

Definition at line 4760 of file Sema.h.

◆ LiteralOperatorLookupResult

The possible outcomes of name lookup for a literal operator.

Enumerator
LOLR_Error 

The lookup resulted in an error.

LOLR_ErrorNoDiagnostic 

The lookup found no match but no diagnostic was issued.

LOLR_Cooked 

The lookup found a single 'cooked' literal operator, which expects a normal literal to be built and passed to it.

LOLR_Raw 

The lookup found a single 'raw' literal operator, which expects a string literal containing the spelling of the literal token.

LOLR_Template 

The lookup found an overload set of literal operator templates, which expect the characters of the spelling of the literal token to be passed as a non-type template argument pack.

LOLR_StringTemplatePack 

The lookup found an overload set of literal operator templates, which expect the character type and characters of the spelling of the string literal token to be passed as template arguments.

Definition at line 9402 of file Sema.h.

◆ LookupNameKind

Describes the kind of name lookup to perform.

Enumerator
LookupOrdinaryName 

Ordinary name lookup, which finds ordinary names (functions, variables, typedefs, etc.) in C and most kinds of names (functions, variables, members, types, etc.) in C++.

LookupTagName 

Tag name lookup, which finds the names of enums, classes, structs, and unions.

LookupLabel 

Label name lookup.

LookupMemberName 

Member name lookup, which finds the names of class/struct/union members.

LookupOperatorName 

Look up of an operator name (e.g., operator+) for use with operator overloading.

This lookup is similar to ordinary name lookup, but will ignore any declarations that are class members.

LookupDestructorName 

Look up a name following ~ in a destructor name.

This is an ordinary lookup, but prefers tags to typedefs.

LookupNestedNameSpecifierName 

Look up of a name that precedes the '::' scope resolution operator in C++.

This lookup completely ignores operator, object, function, and enumerator names (C++ [basic.lookup.qual]p1).

LookupNamespaceName 

Look up a namespace name within a C++ using directive or namespace alias definition, ignoring non-namespace names (C++ [basic.lookup.udir]p1).

LookupUsingDeclName 

Look up all declarations in a scope with the given name, including resolved using declarations.

This is appropriate for checking redeclarations for a using declaration.

LookupRedeclarationWithLinkage 

Look up an ordinary name that is going to be redeclared as a name with linkage.

This lookup ignores any declarations that are outside of the current scope unless they have linkage. See C99 6.2.2p4-5 and C++ [basic.link]p6.

LookupLocalFriendName 

Look up a friend of a local class.

This lookup does not look outside the innermost non-class scope. See C++11 [class.friend]p11.

LookupObjCProtocolName 

Look up the name of an Objective-C protocol.

LookupObjCImplicitSelfParam 

Look up implicit 'self' parameter of an objective-c method.

LookupOMPReductionName 

Look up the name of an OpenMP user-defined reduction operation.

LookupOMPMapperName 

Look up the name of an OpenMP user-defined mapper.

LookupAnyName 

Look up any declaration with any name.

Definition at line 9349 of file Sema.h.

◆ MemberPointerConversionDirection

Enumerator
Downcast 
Upcast 

Definition at line 10253 of file Sema.h.

◆ MemberPointerConversionResult

Enumerator
Success 
DifferentPointee 
NotDerived 
Ambiguous 
Virtual 
Inaccessible 

Definition at line 10245 of file Sema.h.

◆ MissingImportKind

enum class clang::Sema::MissingImportKind
strong

Kinds of missing import.

Note, the values of these enumerators correspond to select values in diagnostics.

Enumerator
Declaration 
Definition 
DefaultArgument 
ExplicitSpecialization 
PartialSpecialization 

Definition at line 9787 of file Sema.h.

◆ ModuleDeclKind

enum class clang::Sema::ModuleDeclKind
strong
Enumerator
Interface 

'export module X;'

Implementation 

'module X;'

PartitionInterface 

'export module X:Y;'

PartitionImplementation 

'module X:Y;'

Definition at line 9896 of file Sema.h.

◆ ModuleImportState

enum class clang::Sema::ModuleImportState
strong

An enumeration to represent the transition of states in parsing module fragments and imports.

If we are not parsing a C++20 TU, or we find an error in state transition, the state is set to NotACXX20Module.

Enumerator
FirstDecl 

Parsing the first decl in a TU.

GlobalFragment 

after 'module;' but before 'module X;'

ImportAllowed 

after 'module X;' but before any non-import decl.

ImportFinished 

after any non-import decl.

PrivateFragmentImportAllowed 

after 'module :private;' but before any non-import decl.

PrivateFragmentImportFinished 

after 'module :private;' but a non-import decl has already been seen.

NotACXX20Module 

Not a C++20 TU, or an invalid state was found.

Definition at line 9906 of file Sema.h.

◆ NonTrivialCUnionKind

Enumerator
NTCUK_Init 
NTCUK_Destruct 
NTCUK_Copy 

Definition at line 4100 of file Sema.h.

◆ PragmaAlignPackDiagnoseKind

Enumerator
NonDefaultStateAtInclude 
ChangedStateAtExit 

Definition at line 2195 of file Sema.h.

◆ PragmaMsStackAction

Enumerator
PSK_Reset 
PSK_Set 
PSK_Push 
PSK_Pop 
PSK_Show 
PSK_Push_Set 
PSK_Pop_Set 

Definition at line 1824 of file Sema.h.

◆ PragmaSectionKind

Enumerator
PSK_DataSeg 
PSK_BSSSeg 
PSK_ConstSeg 
PSK_CodeSeg 

Definition at line 2062 of file Sema.h.

◆ ReferenceCompareResult

ReferenceCompareResult - Expresses the result of comparing two types (cv1 T1 and cv2 T2) to determine their compatibility for the purposes of initialization by reference (C++ [dcl.init.ref]p4).

Enumerator
Ref_Incompatible 

Ref_Incompatible - The two types are incompatible, so direct reference binding is not possible.

Ref_Related 

Ref_Related - The two types are reference-related, which means that their unqualified forms (T1 and T2) are either the same or T1 is a base class of T2.

Ref_Compatible 

Ref_Compatible - The two types are reference-compatible.

Definition at line 10412 of file Sema.h.

◆ RetainOwnershipKind

Enumerator
NS 
CF 
OS 

Definition at line 5063 of file Sema.h.

◆ ReuseLambdaContextDecl_t

Enumerator
ReuseLambdaContextDecl 

Definition at line 7038 of file Sema.h.

◆ SimplerImplicitMoveMode

Enumerator
ForceOff 
Normal 
ForceOn 

Definition at line 11142 of file Sema.h.

◆ StringEvaluationContext

Enumerator
StaticAssert 
Asm 

Definition at line 5992 of file Sema.h.

◆ TemplateNameIsRequiredTag

Enumerator
TemplateNameIsRequired 

Definition at line 11415 of file Sema.h.

◆ TemplateNameKindForDiagnostics

Describes the detailed kind of a template name. Used in diagnostics.

Enumerator
ClassTemplate 
FunctionTemplate 
VarTemplate 
AliasTemplate 
TemplateTemplateParam 
Concept 
DependentTemplate 

Definition at line 3833 of file Sema.h.

◆ TemplateParameterListEqualKind

Enumeration describing how template parameter lists are compared for equality.

Enumerator
TPL_TemplateMatch 

We are matching the template parameter lists of two templates that might be redeclarations.

template<typename T> struct X;
template<typename T> struct X;
#define X(type, name)
Definition Value.h:97
TPL_TemplateTemplateParmMatch 

We are matching the template parameter lists of two template template parameters as part of matching the template parameter lists of two templates that might be redeclarations.

template<template<int I> class TT> struct X;
template<template<int Value> class Other> struct X;
@ Other
C++26 [dcl.fct.def.general]p1 function-body: ctor-initializer[opt] compound-statement function-try-bl...
Definition Sema.h:4161
TPL_TemplateParamsEquivalent 

We are determining whether the template-parameters are equivalent according to C++ [temp.over.link]/6.

This comparison does not consider constraints.

template<C1 T> void f(T);
template<C2 T> void f(T);
const FunctionProtoType * T

Definition at line 12166 of file Sema.h.

◆ TemplateParamListContext

The context in which we are checking a template parameter list.

Enumerator
TPC_Other 
TPC_FunctionTemplate 
TPC_ClassTemplateMember 
TPC_FriendClassTemplate 
TPC_FriendFunctionTemplate 
TPC_FriendFunctionTemplateDefinition 
TPC_TemplateTemplateParameterPack 

Definition at line 11598 of file Sema.h.

◆ UnexpandedParameterPackContext

The context in which an unexpanded parameter pack is being diagnosed.

Note that the values of this enumeration line up with the first argument to the err_unexpanded_parameter_pack diagnostic.

Enumerator
UPPC_Expression 

An arbitrary expression.

UPPC_BaseType 

The base type of a class type.

UPPC_DeclarationType 

The type of an arbitrary declaration.

UPPC_DataMemberType 

The type of a data member.

UPPC_BitFieldWidth 

The size of a bit-field.

UPPC_StaticAssertExpression 

The expression in a static assertion.

UPPC_FixedUnderlyingType 

The fixed underlying type of an enumeration.

UPPC_EnumeratorValue 

The enumerator value.

UPPC_UsingDeclaration 

A using declaration.

UPPC_FriendDeclaration 

A friend declaration.

UPPC_DeclarationQualifier 

A declaration qualifier.

UPPC_Initializer 

An initializer.

UPPC_DefaultArgument 

A default argument.

UPPC_NonTypeTemplateParameterType 

The type of a non-type template parameter.

UPPC_ExceptionType 

The type of an exception.

UPPC_ExplicitSpecialization 

Explicit specialization.

UPPC_PartialSpecialization 

Partial specialization.

UPPC_IfExists 

Microsoft __if_exists.

UPPC_IfNotExists 

Microsoft __if_not_exists.

UPPC_Lambda 

Lambda expression.

UPPC_Block 

Block expression.

UPPC_TypeConstraint 

A type constraint.

UPPC_Requirement 
UPPC_RequiresClause 

Definition at line 14409 of file Sema.h.

Constructor & Destructor Documentation

◆ Sema()

Sema::Sema ( Preprocessor & pp,
ASTContext & ctxt,
ASTConsumer & consumer,
TranslationUnitKind TUKind = TU_Complete,
CodeCompleteConsumer * CompletionConsumer = nullptr )

Definition at line 272 of file Sema.cpp.

References AlignPackStack, AnalysisWarnings, APINotes, ArgPackSubstIndex, BSSSegStack, CodeSegStack, CollectStats, ConstSegStack, Consumer, Context, clang::CPlusPlus, CurContext, CurFPFeatures, CurInitSeg, CurrentInstantiationScope, CXXTypeInfoDecl, DataSegStack, Diags, DisableTypoCorrection, clang::Sema::ExpressionEvaluationContextRecord::EK_Other, ExprEvalContexts, ExternalSource, false, FieldCollector, clang::FormatASTNodeDiagnosticArgument(), FpPragmaStack, getDiagnostics(), getLangOpts(), getSourceManager(), GlobalNewDeleteDeclared, IdResolver, IsBuildingRecoveryCallExpr, LangOpts, clang::Last, LateTemplateParser, MSPointerToMemberRepresentationMethod, MSStructPragmaOn, NonInstantiationEntries, clang::SemaObjC::NSAPIObj, clang::SemaObjC::NSNumberLiteralMethods, clang::nullptr, clang::NSAPI::NumNSNumberLiteralMethods, ObjC(), OpaqueParser, OpenMP(), OriginalLexicalContext, PotentiallyEvaluated, PP, PragmaAttributeCurrentTargetDecl, clang::SemaBase::SemaBase(), SourceMgr, StdCoroutineTraitsCache, StdInitializerList, StdSourceLocationImplDecl, StdTypeIdentity, StrictGuardStackCheckStack, ThreadSafetyDeclCache, clang::Preprocessor::TUKind, TUKind, TUScope, TyposCorrected, VisContext, and VtorDispStack.

Referenced by ActOnCXXDelete(), clang::Sema::ArgPackSubstIndexRAII::ArgPackSubstIndexRAII(), ASTWriter, BuildCXXNew(), canCalleeThrow(), CheckCallReturnType(), CheckSwitchCondition(), CheckTemplateArgument(), clang::Sema::CompoundScopeRAII::CompoundScopeRAII(), clang::Sema::ContextRAII::ContextRAII(), clang::Sema::CXXThisScopeRAII::CXXThisScopeRAII(), clang::Sema::DeferDiagsRAII::DeferDiagsRAII(), clang::Sema::BoundTypeDiagnoser< Ts >::diagnose(), clang::Sema::SizelessTypeDiagnoser< Ts >::diagnose(), clang::Sema::TypeDiagnoser::diagnose(), clang::Sema::ContextualImplicitConverter::diagnoseAmbiguous(), clang::Sema::ContextualImplicitConverter::diagnoseConversion(), clang::Sema::ContextualImplicitConverter::diagnoseExplicitConv(), diagnoseExprIntendedAsTemplateName(), clang::Sema::VerifyICEDiagnoser::diagnoseFold(), DiagnoseImmediateEscalatingReason(), clang::Sema::ContextualImplicitConverter::diagnoseIncomplete(), clang::Sema::ContextualImplicitConverter::diagnoseNoMatch(), clang::Sema::ICEConvertDiagnoser::diagnoseNoMatch(), clang::Sema::VerifyICEDiagnoser::diagnoseNotICE(), clang::Sema::VerifyICEDiagnoser::diagnoseNotICEType(), clang::Sema::ICEConvertDiagnoser::diagnoseNotInt(), clang::Sema::FPFeaturesStateRAII::FPFeaturesStateRAII(), clang::Sema::FpPragmaStackSaveRAII::FpPragmaStackSaveRAII(), clang::Sema::FunctionScopeRAII::FunctionScopeRAII(), clang::Sema::GlobalEagerInstantiationScope::GlobalEagerInstantiationScope(), clang::Sema::ImplicitExceptionSpecification::ImplicitExceptionSpecification(), clang::Sema::InheritedConstructorInfo::InheritedConstructorInfo(), InitializeExplicitObjectArgument(), InstantiateFunctionDefinition(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), clang::Sema::InstantiatingTemplate::InstantiatingTemplate(), IsRedefinitionInModule(), clang::Sema::LambdaScopeForCallOperatorInstantiationRAII::LambdaScopeForCallOperatorInstantiationRAII(), clang::Sema::LocalEagerInstantiationScope::LocalEagerInstantiationScope(), clang::Sema::NonSFINAEContext::NonSFINAEContext(), clang::Sema::ContextualImplicitConverter::noteAmbiguous(), clang::Sema::ContextualImplicitConverter::noteExplicitConv(), clang::Sema::CompoundScopeRAII::operator=(), clang::Sema::FpPragmaStackSaveRAII::operator=(), clang::Sema::GlobalEagerInstantiationScope::operator=(), clang::Sema::LocalEagerInstantiationScope::operator=(), clang::Sema::PragmaStackSentinelRAII::operator=(), parentEvaluationContext(), PerformContextualImplicitConversion(), clang::Sema::PoppedFunctionScopeDeleter::PoppedFunctionScopeDeleter(), clang::Sema::PragmaStackSentinelRAII::PragmaStackSentinelRAII(), clang::Sema::RecursiveInstGuard::RecursiveInstGuard(), clang::Sema::SatisfactionStackResetRAII::SatisfactionStackResetRAII(), clang::Sema::SFINAEContextBase::SFINAEContextBase(), clang::Sema::SFINAETrap::SFINAETrap(), clang::Sema::SFINAETrap::SFINAETrap(), SubstConceptTemplateArguments(), clang::Sema::SynthesizedFunctionScope::SynthesizedFunctionScope(), clang::Sema::TentativeAnalysisScope::TentativeAnalysisScope(), VerifyIntegerConstantExpression(), VerifyIntegerConstantExpression(), and VerifyIntegerConstantExpression().

◆ ~Sema()

Member Function Documentation

◆ ActOnAbortSEHFinallyBlock()

void Sema::ActOnAbortSEHFinallyBlock ( )

Definition at line 4571 of file SemaStmt.cpp.

References CurrentSEHFinally.

◆ ActOnAccessSpecifier()

bool Sema::ActOnAccessSpecifier ( AccessSpecifier Access,
SourceLocation ASLoc,
SourceLocation ColonLoc,
const ParsedAttributesView & Attrs )

ActOnAccessSpecifier - Parsed an access specifier followed by a colon.

Definition at line 3233 of file SemaDeclCXX.cpp.

References clang::AS_none, Context, clang::AccessSpecDecl::Create(), CurContext, and ProcessAccessDeclAttributeList().

◆ ActOnAddrLabel()

ExprResult Sema::ActOnAddrLabel ( SourceLocation OpLoc,
SourceLocation LabLoc,
LabelDecl * TheDecl )

ActOnAddrLabel - Parse the GNU address of label extension: "&&foo".

Definition at line 16277 of file SemaExpr.cpp.

References clang::sema::FunctionScopeInfo::AddrLabels, Context, getCurFunction(), and clang::Decl::markUsed().

Referenced by clang::TreeTransform< AdjustConstraints >::RebuildAddrLabelExpr().

◆ ActOnAfterCompoundStatementLeadingPragmas()

void Sema::ActOnAfterCompoundStatementLeadingPragmas ( )

◆ ActOnAliasDeclaration()

Decl * Sema::ActOnAliasDeclaration ( Scope * CurScope,
AccessSpecifier AS,
MultiTemplateParamsArg TemplateParams,
SourceLocation UsingLoc,
UnqualifiedId & Name,
const ParsedAttributesView & AttrList,
TypeResult Type,
Decl * DeclFromDeclSpec )

Definition at line 13717 of file SemaDeclCXX.cpp.

References ActOnDocumentableDecl(), ActOnTypedefNameDecl(), AddPragmaAttributes(), CheckRedeclarationInModule(), CheckTemplateDeclScope(), CheckTemplateParameterList(), CheckTypedefForVariablyModifiedType(), Context, clang::TypeAliasDecl::Create(), clang::TypeAliasTemplateDecl::Create(), CurContext, Diag(), DiagnoseClassNameShadow(), DiagnoseTemplateParameterShadow(), DiagnoseUnexpandedParameterPack(), FilterLookupForScope(), forRedeclarationInCurContext(), ForVisibleRedeclaration, clang::TypeLoc::getBeginLoc(), clang::Scope::getDeclParent(), clang::UnqualifiedId::getKind(), clang::Decl::getLocation(), clang::RedeclarableTemplateDecl::getMostRecentDecl(), GetNameFromUnqualifiedId(), clang::TypeAliasTemplateDecl::getTemplatedDecl(), clang::TemplateDecl::getTemplateParameters(), GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), clang::TypedefNameDecl::getUnderlyingType(), handleTagNumbering(), clang::UnqualifiedId::Identifier, clang::IK_Identifier, clang::Invalid, clang::Decl::isInvalidDecl(), clang::SourceLocation::isValid(), LookupName(), LookupOrdinaryName, Previous, ProcessAPINotes(), ProcessDeclAttributeList(), PushOnScopeChains(), clang::Redeclaration, clang::Decl::setAccess(), clang::TypeAliasDecl::setDescribedAliasTemplate(), clang::Decl::setInvalidDecl(), clang::Redeclarable< decl_type >::setPreviousDecl(), setTagNameForLinkagePurposes(), clang::UnqualifiedId::StartLocation, TemplateParameterListsAreEqual(), TPC_Other, TPL_TemplateMatch, and UPPC_DeclarationType.

◆ ActOnAlignasTypeArgument()

bool Sema::ActOnAlignasTypeArgument ( StringRef KWName,
ParsedType Ty,
SourceLocation OpLoc,
SourceRange R )

ActOnAlignasTypeArgument - Handle alignas(type-id) and _Alignas(type-name) .

[dcl.align] An alignment-specifier of the form alignas(type-id) has the same effect as alignas(alignof(type-id)).

[N1570 6.7.5] _Alignas(type-name) is equivalent to _Alignas(_Alignof(type-name)).

Definition at line 4798 of file SemaExpr.cpp.

References CheckAlignasTypeArgument(), clang::OpaquePtr< PtrTy >::getAsOpaquePtr(), clang::OpaquePtr< QualType >::getFromOpaquePtr(), and GetTypeFromParser().

◆ ActOnAnnotModuleBegin()

void Sema::ActOnAnnotModuleBegin ( SourceLocation DirectiveLoc,
Module * Mod )

The parsed has entered a submodule.

Definition at line 768 of file SemaModule.cpp.

References clang::cast(), checkModuleImportContext(), CurContext, getLangOpts(), clang::Decl::Visible, and clang::Decl::VisibleWhenImported.

◆ ActOnAnnotModuleEnd()

◆ ActOnAnnotModuleInclude()

void Sema::ActOnAnnotModuleInclude ( SourceLocation DirectiveLoc,
Module * Mod )

The parser has processed a module import translated from a #include or similar preprocessing directive.

Definition at line 724 of file SemaModule.cpp.

References BuildModuleInclude(), checkModuleImportContext(), and CurContext.

◆ ActOnArraySubscriptExpr()

◆ ActOnArrayTypeTrait()

ExprResult Sema::ActOnArrayTypeTrait ( ArrayTypeTrait ATT,
SourceLocation KWLoc,
ParsedType LhsTy,
Expr * DimExpr,
SourceLocation RParen )

ActOnArrayTypeTrait - Parsed one of the binary type trait support pseudo-functions.

Definition at line 1804 of file SemaTypeTraits.cpp.

References BuildArrayTypeTrait(), Context, GetTypeFromParser(), and clang::T.

◆ ActOnAsTypeExpr()

ExprResult Sema::ActOnAsTypeExpr ( Expr * E,
ParsedType ParsedDestTy,
SourceLocation BuiltinLoc,
SourceLocation RParenLoc )

Parse a __builtin_astype expression.

__builtin_astype( value, dst type )

Definition at line 6883 of file SemaExpr.cpp.

References BuildAsTypeExpr(), and GetTypeFromParser().

◆ ActOnAttributedStmt()

StmtResult Sema::ActOnAttributedStmt ( const ParsedAttributes & AttrList,
Stmt * SubStmt )

◆ ActOnBaseSpecifier()

BaseResult Sema::ActOnBaseSpecifier ( Decl * classdecl,
SourceRange SpecifierRange,
const ParsedAttributesView & Attrs,
bool Virtual,
AccessSpecifier Access,
ParsedType basetype,
SourceLocation BaseLoc,
SourceLocation EllipsisLoc )

ActOnBaseSpecifier - Parsed a base specifier.

A base specifier is one entry in the base class list of a class specifier, for example: class foo : public bar, virtual private baz { 'public bar' and 'virtual private baz' are each base-specifiers.

Definition at line 2861 of file SemaDeclCXX.cpp.

References AdjustDeclIfTemplate(), CheckBaseSpecifier(), clang::Class, Diag(), DiagnoseUnexpandedParameterPack(), DiagnoseUnknownAttribute(), clang::SourceRange::getBegin(), GetTypeFromParser(), clang::AttributeCommonInfo::IgnoredAttribute, clang::SourceLocation::isInvalid(), clang::AttributeCommonInfo::UnknownAttribute, UPPC_BaseType, and Virtual.

◆ ActOnBaseSpecifiers()

void Sema::ActOnBaseSpecifiers ( Decl * ClassDecl,
MutableArrayRef< CXXBaseSpecifier * > Bases )

ActOnBaseSpecifiers - Attach the given base specifiers to the class, after checking whether there are any duplicate base classes.

Definition at line 3041 of file SemaDeclCXX.cpp.

References AdjustDeclIfTemplate(), AttachBaseSpecifiers(), and clang::cast().

◆ ActOnBinOp()

ExprResult Sema::ActOnBinOp ( Scope * S,
SourceLocation TokLoc,
tok::TokenKind Kind,
Expr * LHSExpr,
Expr * RHSExpr )

◆ ActOnBlockArguments()

void Sema::ActOnBlockArguments ( SourceLocation CaretLoc,
Declarator & ParamInfo,
Scope * CurScope )

◆ ActOnBlockError()

void Sema::ActOnBlockError ( SourceLocation CaretLoc,
Scope * CurScope )

ActOnBlockError - If there is an error parsing a block, this callback is invoked to pop the information about the block from the action impl.

Definition at line 16738 of file SemaExpr.cpp.

References DiscardCleanupsInEvaluationContext(), PopDeclContext(), PopExpressionEvaluationContext(), and PopFunctionScopeInfo().

◆ ActOnBlockStart()

◆ ActOnBlockStmtExpr()

ExprResult Sema::ActOnBlockStmtExpr ( SourceLocation CaretLoc,
Stmt * Body,
Scope * CurScope )

ActOnBlockStmtExpr - This is called when the body of a block statement literal was successfully completed.

^(int x){...}

Definition at line 16748 of file SemaExpr.cpp.

References clang::sema::FunctionScopeInfo::addBlock(), AnalysisWarnings, BuildDeclarationNameExpr(), clang::sema::CapturingScopeInfo::Captures, clang::cast(), clang::Type::castAs(), checkNonTrivialCUnion(), Cleanup, computeNRVO(), clang::sema::CapturingScopeInfo::ContainsUnexpandedParameterPack, Context, clang::CPlusPlus, CreateRecoveryExpr(), clang::sema::CapturingScopeInfo::CXXThisCaptureIndex, deduceClosureReturnType(), clang::SemaBase::Diag(), DiagnoseInvalidJumps(), DiagnoseUnguardedAvailabilityViolations(), DiagnoseUnusedParameters(), DiscardCleanupsInEvaluationContext(), clang::QualType::DK_none, ExprCleanupObjects, clang::FunctionProtoType::ExtProtoInfo::ExtInfo, FinalizeVarWithDestructor(), clang::FunctionReturn, FunctionScopes, clang::sema::BlockScopeInfo::FunctionType, clang::Type::getAsCXXRecordDecl(), clang::sema::Capture::getCaptureType(), clang::BlockDecl::getCaretLocation(), getCurFunction(), clang::Stmt::getEndLoc(), clang::FunctionType::getExtInfo(), clang::FunctionProtoType::getExtProtoInfo(), getLangOpts(), clang::sema::Capture::getLocation(), clang::FunctionType::getNoReturnAttr(), clang::FunctionProtoType::getParamTypes(), clang::FunctionType::getReturnType(), clang::sema::Capture::getVariable(), hasAnyUnrecoverableErrorsInThisFunction(), clang::Decl::hasAttr(), clang::sema::CapturingScopeInfo::HasImplicitReturnType, clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::QualType::hasNonTrivialToPrimitiveDestructCUnion(), ImpCastExprToType(), clang::InitializedEntity::InitializeBlock(), clang::isa(), clang::sema::Capture::isBlockCapture(), clang::sema::Capture::isCopyCapture(), clang::DeclContext::isDependentContext(), clang::sema::Capture::isInvalid(), clang::Decl::isInvalidDecl(), clang::sema::Capture::isNested(), clang::QualType::isNull(), clang::Type::isRecordType(), clang::sema::Capture::isThisCapture(), LangOpts, maybeAddDeclWithEffects(), MaybeCreateExprWithCleanups(), NTCUK_Copy, NTCUK_Destruct, clang::BlockDecl::parameters(), PerformCopyInitialization(), PopDeclContext(), PopExpressionEvaluationContext(), PopFunctionScopeInfo(), PotentiallyEvaluated, PP, clang::Result, clang::sema::CapturingScopeInfo::ReturnType, clang::BlockDecl::setBody(), clang::BlockDecl::setCaptures(), setFunctionHasBranchProtectedScope(), clang::sema::BlockScopeInfo::TheDecl, clang::FunctionProtoType::ExtProtoInfo::TypeQuals, clang::VK_LValue, and clang::FunctionType::ExtInfo::withNoReturn().

◆ ActOnBreakStmt()

◆ ActOnBuiltinBitCastExpr()

ExprResult Sema::ActOnBuiltinBitCastExpr ( SourceLocation KWLoc,
Declarator & Dcl,
ExprResult Operand,
SourceLocation RParenLoc )

◆ ActOnBuiltinOffsetOf()

ExprResult Sema::ActOnBuiltinOffsetOf ( Scope * S,
SourceLocation BuiltinLoc,
SourceLocation TypeLoc,
ParsedType ParsedArgTy,
ArrayRef< OffsetOfComponent > Components,
SourceLocation RParenLoc )

◆ ActOnCallExpr()

ExprResult Sema::ActOnCallExpr ( Scope * S,
Expr * Fn,
SourceLocation LParenLoc,
MultiExprArg ArgExprs,
SourceLocation RParenLoc,
Expr * ExecConfig = nullptr )

ActOnCallExpr - Handle a call to Fn with the specified array of arguments.

This provides the location of the left/right parens and a list of comma locations.

Definition at line 6595 of file SemaExpr.cpp.

References clang::SemaOpenMP::ActOnOpenMPCall(), BuildCallExpr(), clang::Call, currentEvaluationContext(), clang::SemaBase::DiagCompat(), DiagnosedUnqualifiedCallsToStdFunctions(), LangOpts, OpenMP(), and clang::Sema::ExpressionEvaluationContextRecord::ReferenceToConsteval.

Referenced by BuiltinInvoke(), and clang::TreeTransform< AdjustConstraints >::RebuildCallExpr().

◆ ActOnCapScopeReturnStmt()

StmtResult Sema::ActOnCapScopeReturnStmt ( SourceLocation ReturnLoc,
Expr * RetValExp,
NamedReturnInfo & NRInfo,
bool SupressSimplerImplicitMoves )

◆ ActOnCapturedRegionEnd()

◆ ActOnCapturedRegionError()

◆ ActOnCapturedRegionStart() [1/2]

◆ ActOnCapturedRegionStart() [2/2]

◆ ActOnCaseExpr()

◆ ActOnCaseStmt()

◆ ActOnCaseStmtBody()

void Sema::ActOnCaseStmtBody ( Stmt * CaseStmt,
Stmt * SubStmt )

ActOnCaseStmtBody - This installs a statement as the body of a case.

Definition at line 563 of file SemaStmt.cpp.

References clang::cast().

Referenced by clang::TreeTransform< AdjustConstraints >::RebuildCaseStmtBody().

◆ ActOnCastExpr()

◆ ActOnCharacterConstant()

◆ ActOnChooseExpr()

◆ ActOnClassTemplateSpecialization()

DeclResult Sema::ActOnClassTemplateSpecialization ( Scope * S,
unsigned TagSpec,
TagUseKind TUK,
SourceLocation KWLoc,
SourceLocation ModulePrivateLoc,
CXXScopeSpec & SS,
TemplateIdAnnotation & TemplateId,
const ParsedAttributesView & Attr,
MultiTemplateParamsArg TemplateParameterLists,
SkipBodyInfo * SkipBody = nullptr )

Definition at line 8730 of file SemaTemplate.cpp.

References AddAlignmentAttributesForRecord(), AddMsStructLayoutForRecord(), clang::AS_none, clang::AS_public, clang::Sema::CheckTemplateArgumentInfo::CanonicalConverted, clang::cast(), CheckClassTemplate(), CheckTemplateArgumentList(), CheckTemplateDeclScope(), CheckTemplatePartialSpecialization(), CheckTemplatePartialSpecializationArgs(), CheckTemplateSpecializationScope(), ClassTemplate, Context, clang::ClassTemplatePartialSpecializationDecl::Create(), clang::ClassTemplateSpecializationDecl::Create(), clang::FriendDecl::Create(), clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), clang::CanQual< Type >::CreateUnsafe(), CurContext, clang::Definition, clang::SemaBase::Diag(), diagnoseQualifiedDeclaration(), DiagnoseUnexpandedParameterPack(), EnterTemplatedContext(), clang::Enum, clang::Friend, clang::OpaquePtr< PtrTy >::get(), clang::TemplateName::getAsTemplateDecl(), clang::TemplateTemplateParmDecl::getDefaultArgument(), clang::ClassTemplatePartialSpecializationDecl::getInstantiatedFromMember(), clang::Decl::getLocation(), clang::TemplateArgumentLoc::getLocation(), clang::TemplateParameterList::getParam(), clang::ClassTemplateSpecializationDecl::getPointOfInstantiation(), clang::CXXRecordDecl::getPreviousDecl(), clang::TemplateParameterList::getRAngleLoc(), clang::TemplateArgumentLoc::getSourceRange(), clang::KeywordHelpers::getTagTypeKindForTypeSpec(), clang::TemplateParameterList::getTemplateLoc(), clang::CXXRecordDecl::getTemplateSpecializationKind(), getTemplateSpecializationKind(), clang::CXXScopeSpec::getWithLocInContext(), clang::TemplateParameterList::hasAssociatedConstraints(), clang::TemplateTemplateParmDecl::hasDefaultArgument(), inferGslOwnerPointerAttribute(), clang::Invalid, clang::isa(), isAcceptableTagRedeclaration(), clang::TemplateName::isDependent(), clang::DeclContext::isDependentContext(), isRedefinitionAllowedFor(), clang::CXXScopeSpec::isSet(), clang::Scope::isTemplateParamScope(), clang::SourceLocation::isValid(), clang::TemplateIdAnnotation::LAngleLoc, LangOpts, makeMergedDefinitionVisible(), makeTemplateArgumentListInfo(), MatchTemplateParametersToScopeSpecifier(), clang::None, clang::SkipBodyInfo::Previous, ProcessAPINotes(), ProcessDeclAttributeList(), clang::TemplateIdAnnotation::RAngleLoc, RebuildTemplateParamsInCurrentInstantiation(), clang::Reference, clang::TemplateTemplateParmDecl::removeDefaultArgument(), clang::ClassTemplatePartialSpecializationDecl::setMemberSpecialization(), SetNestedNameSpecifier(), clang::ClassTemplateSpecializationDecl::setTemplateArgsAsWritten(), clang::TagDecl::setTemplateParameterListsInfo(), clang::SkipBodyInfo::ShouldSkip, clang::TemplateArgumentListInfo::size(), clang::TemplateParameterList::size(), clang::Specialization, clang::Sema::CheckTemplateArgumentInfo::StrictPackMatch, clang::TemplateIdAnnotation::Template, clang::TemplateIdAnnotation::TemplateNameLoc, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, UPPC_ExplicitSpecialization, and UPPC_PartialSpecialization.

◆ ActOnCleanupAttr()

◆ ActOnCoawaitExpr()

◆ ActOnComment()

◆ ActOnCompoundLiteral()

ExprResult Sema::ActOnCompoundLiteral ( SourceLocation LParenLoc,
ParsedType Ty,
SourceLocation RParenLoc,
Expr * InitExpr )

Definition at line 7214 of file SemaExpr.cpp.

References BuildCompoundLiteralExpr(), Context, and GetTypeFromParser().

◆ ActOnCompoundRequirement() [1/2]

concepts::Requirement * Sema::ActOnCompoundRequirement ( Expr * E,
SourceLocation NoexceptLoc )

Definition at line 7842 of file SemaExprCXX.cpp.

References BuildExprRequirement().

◆ ActOnCompoundRequirement() [2/2]

◆ ActOnCompoundStmt()

◆ ActOnCondition()

◆ ActOnConditionalOp()

◆ ActOnConditionVariable()

◆ ActOnConstantExpression()

◆ ActOnContinueStmt()

◆ ActOnConversionDeclarator()

◆ ActOnConvertVectorExpr()

ExprResult Sema::ActOnConvertVectorExpr ( Expr * E,
ParsedType ParsedDestTy,
SourceLocation BuiltinLoc,
SourceLocation RParenLoc )

ActOnConvertVectorExpr - create a new convert-vector expression from the provided arguments.

__builtin_convertvector( value, dst type )

Definition at line 6904 of file SemaExpr.cpp.

References ConvertVectorExpr(), and GetTypeFromParser().

◆ ActOnCoreturnStmt()

StmtResult Sema::ActOnCoreturnStmt ( Scope * S,
SourceLocation KwLoc,
Expr * E )

◆ ActOnCoroutineBodyStart()

◆ ActOnCoyieldExpr()

◆ ActOnCXXAssumeAttr()

◆ ActOnCXXBoolLiteral()

ExprResult Sema::ActOnCXXBoolLiteral ( SourceLocation OpLoc,
tok::TokenKind Kind )

ActOnCXXBoolLiteral - Parse {true,false} literals.

Definition at line 805 of file SemaExprCXX.cpp.

References Context.

Referenced by BuildEmptyCXXFoldExpr().

◆ ActOnCXXCatchBlock()

StmtResult Sema::ActOnCXXCatchBlock ( SourceLocation CatchLoc,
Decl * ExDecl,
Stmt * HandlerBlock )

ActOnCXXCatchBlock - Takes an exception declaration and a handler block and creates a proper catch handler from them.

Definition at line 4272 of file SemaStmt.cpp.

References Context.

◆ ActOnCXXConditionDeclaration()

DeclResult Sema::ActOnCXXConditionDeclaration ( Scope * S,
Declarator & D )

ActOnCXXConditionDeclarationExpr - Parsed a condition declaration of a C++ if/switch/while/for statement.

e.g: "if (int x = f()) {...}"

Definition at line 18955 of file SemaDeclCXX.cpp.

References ActOnDeclarator(), Diag(), clang::Declarator::getDeclSpec(), clang::Decl::getLocation(), clang::Declarator::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::isa(), clang::DeclSpec::SCS_typedef, and clang::VarDecl::setCXXCondDecl().

◆ ActOnCXXDelete()

ExprResult Sema::ActOnCXXDelete ( SourceLocation StartLoc,
bool UseGlobal,
bool ArrayForm,
Expr * Operand )

ActOnCXXDelete - Parsed a C++ 'delete' expression (C++ 5.3.5), as in:

::delete ptr;

or

delete [] ptr;

Definition at line 3980 of file SemaExprCXX.cpp.

References clang::alignedAllocationModeFromBool(), clang::AS_public, clang::Type::castAs(), CheckDestructorAccess(), CheckVirtualDtorCall(), Context, clang::FixItHint::CreateInsertion(), clang::Default, DefaultLvalueConversion(), clang::SemaBase::Diag(), DiagnoseUseOfDecl(), doesUsualArrayDeleteWantSize(), clang::ExprError(), FindDeallocationFunction(), FindUsualDeallocationFunction(), clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), clang::Qualifiers::getAddressSpaceAttributePrintValue(), clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), clang::Stmt::getBeginLoc(), clang::CXXRecordDecl::getDestructor(), clang::Expr::getExprLoc(), getLangOpts(), clang::Decl::getLocation(), getLocForEndOfToken(), clang::Type::getPointeeType(), getPointeeType(), clang::QualType::getQualifiers(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::Qualifiers::hasCVRQualifiers(), clang::CXXRecordDecl::hasIrrelevantDestructor(), hasNewExtendedAlignment(), ImpCastExprToType(), clang::Type::isArrayType(), isCompleteType(), clang::Type::isDependentType(), clang::QualType::isDestructedType(), clang::Type::isEnumeralType(), clang::Type::isFunctionType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), isSFINAEContext(), clang::isSizedDeallocation(), clang::Type::isSizelessType(), clang::Expr::isTypeDependent(), clang::Type::isVoidType(), LangOpts, LookupDestructor(), clang::DeclAccessPair::make(), MarkFunctionReferenced(), clang::ast_matchers::match(), clang::No, clang::Passing, clang::ImplicitDeallocationParameters::PassSize, clang::ImplicitDeallocationParameters::PassTypeIdentity, clang::SemaBase::PDiag(), PerformContextualImplicitConversion(), PerformImplicitConversion(), clang::Qualifiers::removeCVRQualifiers(), RequireCompleteType(), clang::Result, Sema(), ShouldUseTypeAwareOperatorNewOrDelete(), clang::sizedDeallocationModeFromBool(), and clang::T.

Referenced by clang::TreeTransform< AdjustConstraints >::RebuildCXXDeleteExpr().

◆ ActOnCXXEnterDeclaratorScope()

bool Sema::ActOnCXXEnterDeclaratorScope ( Scope * S,
CXXScopeSpec & SS )

ActOnCXXEnterDeclaratorScope - Called when a C++ scope specifier (global scope or nested-name-specifier) is parsed, part of a declarator-id.

After this method is called, according to [C++ 3.4.3p3], names should be looked up in the declarator-id's scope, until the declarator is parsed and ActOnCXXExitDeclaratorScope is called. The 'SS' should be a non-empty valid CXXScopeSpec.

Definition at line 1012 of file SemaCXXScopeSpec.cpp.

References computeDeclContext(), EnterDeclaratorContext(), clang::DeclContext::isDependentContext(), clang::CXXScopeSpec::isInvalid(), clang::CXXScopeSpec::isSet(), RebuildNestedNameSpecifierInCurrentInstantiation(), and RequireCompleteDeclContext().

◆ ActOnCXXEnterDeclInitializer()

void Sema::ActOnCXXEnterDeclInitializer ( Scope * S,
Decl * D )

ActOnCXXEnterDeclInitializer - Invoked when we are about to parse an initializer for the declaration 'Dcl'.

Invoked when we are about to parse an initializer for the declaration 'Dcl'.

After this method is called, according to [C++ 3.4.1p13], if 'Dcl' is a static data member of class X, names should be looked up in the scope of class X.

After this method is called, according to [C++ 3.4.1p13], if 'Dcl' is a static data member of class X, names should be looked up in the scope of class X. If the declaration had a scope specifier, a scope will have been created and passed in for this purpose. Otherwise, S will be null.

Definition at line 18931 of file SemaDeclCXX.cpp.

References clang::Sema::ExpressionEvaluationContextRecord::EK_VariableInit, EnterDeclaratorContext(), clang::Decl::getDeclContext(), clang::Decl::isInvalidDecl(), clang::Decl::isOutOfLine(), PotentiallyEvaluated, and PushExpressionEvaluationContext().

◆ ActOnCXXExitDeclaratorScope()

void Sema::ActOnCXXExitDeclaratorScope ( Scope * S,
const CXXScopeSpec & SS )

ActOnCXXExitDeclaratorScope - Called when a declarator that previously invoked ActOnCXXEnterDeclaratorScope(), is finished.

'SS' is the same CXXScopeSpec that was passed to ActOnCXXEnterDeclaratorScope as well. Used to indicate that names should revert to being looked up in the defining scope.

Definition at line 1034 of file SemaCXXScopeSpec.cpp.

References computeDeclContext(), ExitDeclaratorContext(), clang::CXXScopeSpec::isInvalid(), and clang::CXXScopeSpec::isSet().

◆ ActOnCXXExitDeclInitializer()

void Sema::ActOnCXXExitDeclInitializer ( Scope * S,
Decl * Dcl )

ActOnCXXExitDeclInitializer - Invoked after we are finished parsing an initializer for the declaration 'Dcl'.

Definition at line 18946 of file SemaDeclCXX.cpp.

References ExitDeclaratorContext(), clang::Decl::isOutOfLine(), and PopExpressionEvaluationContext().

◆ ActOnCXXFoldExpr()

◆ ActOnCXXForRangeDecl()

◆ ActOnCXXForRangeIdentifier()

◆ ActOnCXXForRangeStmt()

StmtResult Sema::ActOnCXXForRangeStmt ( Scope * S,
SourceLocation ForLoc,
SourceLocation CoawaitLoc,
Stmt * InitStmt,
Stmt * LoopVar,
SourceLocation ColonLoc,
Expr * Collection,
SourceLocation RParenLoc,
BuildForRangeKind Kind,
ArrayRef< MaterializeTemporaryExpr * > LifetimeExtendTemps = {} )

ActOnCXXForRangeStmt - Check and build a C++11 for-range statement.

C++11 [stmt.ranged]: A range-based for statement is equivalent to

{ auto && __range = range-init; for ( auto __begin = begin-expr, __end = end-expr; __begin != __end; ++__begin ) { for-range-declaration = *__begin; statement } }

The body of the loop is not available yet, since it cannot be analysed until we have determined the type of the for-range-declaration.

Definition at line 2431 of file SemaStmt.cpp.

References ActOnCoroutineBodyStart(), ActOnDeclStmt(), ActOnInitializerError(), clang::SemaObjC::ActOnObjCForCollectionStmt(), BuildCXXForRangeStmt(), BuildDeclaratorGroup(), Context, clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), FinishForRangeVarDecl(), clang::First, clang::ActionResult< PtrTy, Compress >::get(), clang::DeclStmt::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::Scope::getDepth(), clang::DeclStmt::getSingleDecl(), clang::Stmt::getSourceRange(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::SourceLocation::isInvalid(), clang::Decl::isInvalidDecl(), clang::DeclStmt::isSingleDecl(), ObjC(), ObjCEnumerationCollection(), clang::StmtError(), and UPPC_Expression.

Referenced by RebuildForRangeWithDereference().

◆ ActOnCXXGlobalScopeSpecifier()

bool Sema::ActOnCXXGlobalScopeSpecifier ( SourceLocation CCLoc,
CXXScopeSpec & SS )

The parser has parsed a global nested-name-specifier '::'.

Parameters
CCLocThe location of the '::'.
SSThe nested-name-specifier, which will be updated in-place to reflect the parsed nested-name-specifier.
Returns
true if an error occurred, false otherwise.

Definition at line 266 of file SemaCXXScopeSpec.cpp.

References Context, and clang::CXXScopeSpec::MakeGlobal().

◆ ActOnCXXMemberDeclarator()

NamedDecl * Sema::ActOnCXXMemberDeclarator ( Scope * S,
AccessSpecifier AS,
Declarator & D,
MultiTemplateParamsArg TemplateParameterLists,
Expr * BitfieldWidth,
const VirtSpecifiers & VS,
InClassInitStyle InitStyle )

ActOnCXXMemberDeclarator - This is invoked when a C++ class member declarator is parsed.

'AS' is the access specifier, 'BW' specifies the bitfield width if there is one, 'InitExpr' specifies the initializer if one has been parsed, and 'InitStyle' is set if an in-class initializer is present (but parsing it has been deferred).

Definition at line 3443 of file SemaDeclCXX.cpp.

References clang::AS_public, clang::cast(), CheckOverrideControl(), clang::CXXScopeSpec::clear(), clang::DeclSpec::ClearConstexprSpec(), clang::DeclSpec::ClearStorageClassSpecs(), computeDeclContext(), Context, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), CurContext, clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXConversionFunctionName, clang::DeclarationName::CXXDestructorName, clang::DeclarationName::CXXOperatorName, Diag(), diagnoseQualifiedDeclaration(), Diags, FieldCollector, clang::DeclarationName::getAsIdentifierInfo(), clang::DeclSpec::getAttributes(), clang::Decl::getBeginLoc(), clang::Declarator::getBeginLoc(), clang::DeclSpec::getConstexprSpecLoc(), clang::Declarator::getCXXScopeSpec(), clang::Declarator::getDeclSpec(), clang::VirtSpecifiers::getFinalLoc(), clang::Declarator::getIdentifierLoc(), clang::UnqualifiedId::getKind(), getLangOpts(), clang::VirtSpecifiers::getLastLocation(), clang::DeclarationNameInfo::getLoc(), clang::Decl::getLocation(), clang::ParsedAttributesView::getMSPropertyAttr(), clang::Declarator::getMutableDeclSpec(), clang::DeclarationNameInfo::getName(), clang::Declarator::getName(), GetNameForDeclarator(), clang::DeclarationName::getNameKind(), clang::VirtSpecifiers::getOverrideLoc(), clang::CXXScopeSpec::getRange(), clang::Stmt::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::DeclSpec::getStorageClassSpecLoc(), clang::DeclSpec::getTypeQualifiers(), HandleDeclarator(), HandleField(), HandleMSProperty(), clang::DeclSpec::hasConstexprSpecifier(), clang::ICIS_NoInit, clang::IK_TemplateId, clang::isa(), clang::Declarator::isDeclarationOfFunction(), clang::VirtSpecifiers::isFinalSpecified(), clang::VirtSpecifiers::isFinalSpelledSealed(), clang::DeclSpec::isFriendSpecified(), clang::DeclarationName::isIdentifier(), clang::CXXScopeSpec::isInvalid(), clang::SourceLocation::isInvalid(), clang::VirtSpecifiers::isOverrideSpecified(), clang::CXXScopeSpec::isSet(), IsUnusedPrivateField(), clang::SourceLocation::isValid(), clang::TemplateIdAnnotation::LAngleLoc, clang::Member, clang::TemplateIdAnnotation::RAngleLoc, clang::DeclSpec::SCS_mutable, clang::DeclSpec::SCS_static, clang::DeclSpec::SCS_typedef, clang::DeclSpec::SCS_unspecified, clang::Decl::setAccess(), clang::Declarator::SetIdentifier(), clang::DeclSpec::SetStorageClassSpec(), clang::DeclSpec::SetTypeQual(), clang::UnqualifiedId::TemplateId, clang::DeclSpec::TQ_const, and UnusedPrivateFields.

◆ ActOnCXXNamedCast()

ExprResult Sema::ActOnCXXNamedCast ( SourceLocation OpLoc,
tok::TokenKind Kind,
SourceLocation LAngleBracketLoc,
Declarator & D,
SourceLocation RAngleBracketLoc,
SourceLocation LParenLoc,
Expr * E,
SourceLocation RParenLoc )

ActOnCXXNamedCast - Parse {dynamic,static,reinterpret,const,addrspace}_cast's.

Definition at line 314 of file SemaCast.cpp.

References BuildCXXNamedCast(), CheckExtraCXXDefaultArguments(), clang::CPlusPlus, clang::ExprError(), getLangOpts(), clang::Expr::getType(), GetTypeForDeclaratorCast(), and clang::Declarator::isInvalidType().

◆ ActOnCXXNestedNameSpecifier() [1/2]

bool Sema::ActOnCXXNestedNameSpecifier ( Scope * S,
CXXScopeSpec & SS,
SourceLocation TemplateKWLoc,
TemplateTy TemplateName,
SourceLocation TemplateNameLoc,
SourceLocation LAngleLoc,
ASTTemplateArgsPtr TemplateArgs,
SourceLocation RAngleLoc,
SourceLocation CCLoc,
bool EnteringContext )

The parser has parsed a nested-name-specifier 'template[opt] template-name < template-args >::'.

Parameters
SThe scope in which this nested-name-specifier occurs.
SSThe nested-name-specifier, which is both an input parameter (the nested-name-specifier before this type) and an output parameter (containing the full nested-name-specifier, including this new type).
TemplateKWLocthe location of the 'template' keyword, if any.
TemplateNamethe template name.
TemplateNameLocThe location of the template name.
LAngleLocThe location of the opening angle bracket ('<').
TemplateArgsThe template arguments.
RAngleLocThe location of the closing angle bracket ('>').
CCLocThe location of the '::'.
EnteringContextWhether we're entering the context of the nested-name-specifier.
Returns
true if an error occurred, false otherwise.

Definition at line 891 of file SemaCXXScopeSpec.cpp.

References CheckTemplateIdType(), clang::CXXScopeSpec::clear(), Context, clang::SemaBase::Diag(), clang::OpaquePtr< PtrTy >::get(), clang::TypeLocBuilder::getTypeLocInContext(), clang::CXXScopeSpec::getWithLocInContext(), clang::isa(), clang::CXXScopeSpec::isInvalid(), clang::CXXScopeSpec::Make(), clang::None, NoteAllFoundTemplates(), clang::TypeLocBuilder::push(), clang::T, and translateTemplateArguments().

◆ ActOnCXXNestedNameSpecifier() [2/2]

bool Sema::ActOnCXXNestedNameSpecifier ( Scope * S,
NestedNameSpecInfo & IdInfo,
bool EnteringContext,
CXXScopeSpec & SS,
bool * IsCorrectedToColon = nullptr,
bool OnlyNamespace = false )

The parser has parsed a nested-name-specifier 'identifier::'.

Parameters
SThe scope in which this nested-name-specifier occurs.
IdInfoParser information about an identifier in the nested-name-spec.
EnteringContextWhether we're entering the context nominated by this nested-name-specifier.
SSThe nested-name-specifier, which is both an input parameter (the nested-name-specifier before this type) and an output parameter (containing the full nested-name-specifier, including this new type).
IsCorrectedToColonIf not null, suggestions to replace '::' -> ':' are allowed. The bool value pointed by this parameter is set to 'true' if the identifier is treated as if it was followed by ':', not '::'.
OnlyNamespaceIf true, only considers namespaces in lookup.
Returns
true if an error occurred, false otherwise.

Definition at line 817 of file SemaCXXScopeSpec.cpp.

References BuildCXXNestedNameSpecifier(), and clang::CXXScopeSpec::isInvalid().

◆ ActOnCXXNestedNameSpecifierDecltype()

◆ ActOnCXXNestedNameSpecifierIndexedPack()

◆ ActOnCXXNew()

ExprResult Sema::ActOnCXXNew ( SourceLocation StartLoc,
bool UseGlobal,
SourceLocation PlacementLParen,
MultiExprArg PlacementArgs,
SourceLocation PlacementRParen,
SourceRange TypeIdParens,
Declarator & D,
Expr * Initializer )

Parsed a C++ 'new' expression (C++ 5.3.4).

E.g.:

new (memory) int[size][4]

or

::new Foo(23, "hello")
Parameters
StartLocThe first location of the expression.
UseGlobalTrue if 'new' was prefixed with '::'.
PlacementLParenOpening paren of the placement arguments.
PlacementArgsPlacement new arguments.
PlacementRParenClosing paren of the placement arguments.
TypeIdParensIf the type is in parens, the source range.
DThe type to be allocated, as well as array dimensions.
InitializerThe initializing expression or initializer-list, or null if there is none.

Definition at line 2018 of file SemaExprCXX.cpp.

References clang::Allow, clang::DeclaratorChunk::Arr, clang::DeclaratorChunk::Array, clang::ArrayBound, BuildCXXNew(), CheckConvertedConstantExpression(), Context, clang::CPlusPlus14, clang::SemaBase::Diag(), clang::Declarator::DropFirstTypeObject(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Declarator::getDeclSpec(), clang::Declarator::getEndLoc(), getLangOpts(), clang::Declarator::getNumTypeObjects(), clang::Declarator::getSourceRange(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), clang::Declarator::getTypeObject(), clang::DeclSpec::hasAutoTypeSpec(), clang::DeclaratorChunk::ArrayTypeInfo::hasStatic, clang::Initializer, clang::Declarator::isInvalidType(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::Loc, clang::DeclaratorChunk::ArrayTypeInfo::NumElts, and VerifyIntegerConstantExpression().

◆ ActOnCXXNullPtrLiteral()

ExprResult Sema::ActOnCXXNullPtrLiteral ( SourceLocation Loc)

ActOnCXXNullPtrLiteral - Parse 'nullptr'.

Definition at line 813 of file SemaExprCXX.cpp.

References Context.

◆ ActOnCXXParenListInitExpr()

ExprResult Sema::ActOnCXXParenListInitExpr ( ArrayRef< Expr * > Args,
QualType T,
unsigned NumUserSpecifiedExprs,
SourceLocation InitLoc,
SourceLocation LParenLoc,
SourceLocation RParenLoc )

◆ ActOnCXXThis()

◆ ActOnCXXThrow()

◆ ActOnCXXTryBlock()

◆ ActOnCXXTypeConstructExpr()

ExprResult Sema::ActOnCXXTypeConstructExpr ( ParsedType TypeRep,
SourceLocation LParenOrBraceLoc,
MultiExprArg Exprs,
SourceLocation RParenOrBraceLoc,
bool ListInitialization )

ActOnCXXTypeConstructExpr - Parse construction of a specified type.

Can be interpreted either as function-style casting ("int(x)") or class type construction ("ClassType(x,y,z)") or creation of a value-initialized type ("int()").

Definition at line 1500 of file SemaExprCXX.cpp.

References BuildCXXTypeConstructExpr(), Context, CreateRecoveryExpr(), clang::ExprError(), clang::TypeLoc::getBeginLoc(), GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), and clang::Result.

◆ ActOnCXXTypeid()

◆ ActOnCXXUuidof()

ExprResult Sema::ActOnCXXUuidof ( SourceLocation OpLoc,
SourceLocation LParenLoc,
bool isType,
void * TyOrExpr,
SourceLocation RParenLoc )

ActOnCXXUuidof - Parse __uuidof( something ).

ActOnCXXUuidof - Parse __uuidof( type-id ) or __uuidof (expression);.

Definition at line 781 of file SemaExprCXX.cpp.

References clang::QualType::addConst(), BuildCXXUuidof(), Context, clang::ExprError(), clang::OpaquePtr< QualType >::getFromOpaquePtr(), GetTypeFromParser(), and clang::T.

◆ ActOnDeclarator()

◆ ActOnDeclStmt()

◆ ActOnDecltypeExpression()

◆ ActOnDecompositionDeclarator()

NamedDecl * Sema::ActOnDecompositionDeclarator ( Scope * S,
Declarator & D,
MultiTemplateParamsArg TemplateParamLists )

Definition at line 722 of file SemaDeclCXX.cpp.

References ActOnVariableDeclarator(), clang::Scope::AddDecl(), clang::DecompositionDeclarator::bindings(), clang::cast(), CheckShadow(), clang::Condition, clang::Consteval, Context, clang::CPlusPlus17, clang::CPlusPlus20, clang::CPlusPlus26, clang::BindingDecl::Create(), clang::FixItHint::CreateRemoval(), CurContext, Diag(), clang::SemaBase::DiagCompat(), DiagnoseTemplateParameterShadow(), DiagnoseUnexpandedParameterPack(), DiagPlaceholderVariableDefinition(), FilterLookupForScope(), ForVisibleRedeclaration, clang::Declarator::getContext(), clang::Declarator::getCXXScopeSpec(), clang::Declarator::getDeclSpec(), clang::Declarator::getDecompositionDeclarator(), clang::Declarator::getIdentifierLoc(), getLangOpts(), clang::DecompositionDeclarator::getLSquareLoc(), clang::Declarator::getNumTypeObjects(), clang::DeclContext::getRedeclContext(), getShadowedDeclaration(), clang::DecompositionDeclarator::getSourceRange(), clang::DeclSpec::getSpecifierName(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), clang::Declarator::getTypeObject(), clang::Declarator::hasGroupingParens(), isDeclInScope(), clang::Declarator::isDecompositionDeclarator(), clang::CXXScopeSpec::isEmpty(), clang::DeclContext::isFunctionOrMethod(), clang::Type::isFunctionType(), clang::IdentifierInfo::isPlaceholder(), clang::Declarator::isRedeclaration(), clang::DeclContext::isTranslationUnit(), clang::SourceLocation::isValid(), clang::DeclaratorChunk::Kind, clang::TemplateIdAnnotation::Kind, LookupName(), LookupOrdinaryName, clang::Declarator::mayHaveDecompositionDeclarator(), New, OpenMP(), clang::DeclaratorChunk::Paren, ParsingInitForAutoVars, Previous, ProcessDeclAttributeList(), PushOnScopeChains(), clang::TemplateIdAnnotation::RAngleLoc, clang::DeclaratorChunk::Reference, clang::DeclSpec::SCS_extern, clang::DeclSpec::SCS_static, clang::DeclSpec::SCS_typedef, clang::Declarator::setInvalidType(), clang::TemplateIdAnnotation::TemplateNameLoc, clang::TNK_Concept_template, clang::DeclSpec::TQ_volatile, clang::DeclSpec::TST_auto, clang::Unspecified, and UPPC_DeclarationType.

Referenced by HandleDeclarator().

◆ ActOnDefaultCtorInitializers()

void Sema::ActOnDefaultCtorInitializers ( Decl * CDtorDecl)

Definition at line 5976 of file SemaDeclCXX.cpp.

References clang::Constructor, and SetCtorInitializers().

◆ ActOnDefaultStmt()

◆ ActOnDeferStmtError()

void Sema::ActOnDeferStmtError ( Scope * CurScope)

Definition at line 3957 of file SemaStmt.cpp.

References CurrentDefer.

◆ ActOnDefinedDeclarationSpecifier()

void Sema::ActOnDefinedDeclarationSpecifier ( Decl * D)

Called once it is known whether a tag declaration is an anonymous union or struct.

Definition at line 5510 of file SemaDecl.cpp.

References DiagPlaceholderFieldDeclDefinitions().

◆ ActOnDelayedCXXMethodParameter()

void Sema::ActOnDelayedCXXMethodParameter ( Scope * S,
Decl * ParamD )

ActOnDelayedCXXMethodParameter - We've already started a delayed C++ method declaration.

We're (re-)introducing the given function parameter into scope for use in parsing later parts of the method declaration. For example, we could see an ActOnParamDefaultArgument event for this parameter.

Definition at line 10957 of file SemaDeclCXX.cpp.

References clang::Scope::AddDecl(), clang::cast(), and IdResolver.

◆ actOnDelayedExceptionSpecification()

void Sema::actOnDelayedExceptionSpecification ( Decl * D,
ExceptionSpecificationType EST,
SourceRange SpecificationRange,
ArrayRef< ParsedType > DynamicExceptions,
ArrayRef< SourceRange > DynamicExceptionRanges,
Expr * NoexceptExpr )

Add an exception-specification to the given member or friend function (or function template).

The exception-specification was parsed after the function itself was declared.

Definition at line 19461 of file SemaDeclCXX.cpp.

References checkExceptionSpecification(), CheckOverridingFunctionExceptionSpec(), checkThisInStaticMemberFunctionExceptionSpec(), Context, clang::CXXMethodDecl::isStatic(), clang::CXXMethodDecl::isVirtual(), and clang::CXXMethodDecl::overridden_methods().

◆ ActOnDependentIdExpression()

ExprResult Sema::ActOnDependentIdExpression ( const CXXScopeSpec & SS,
SourceLocation TemplateKWLoc,
const DeclarationNameInfo & NameInfo,
bool isAddressOfOperand,
const TemplateArgumentListInfo * TemplateArgs )

ActOnDependentIdExpression - Handle a dependent id-expression that was just parsed.

This is only possible with an explicit scope specifier naming a dependent type.

Definition at line 737 of file SemaTemplate.cpp.

References BuildDependentDeclRefExpr(), Context, clang::CXXDependentScopeMemberExpr::Create(), clang::ExprError(), getCurrentThisType(), clang::CXXScopeSpec::isEmpty(), and clang::QualType::isNull().

Referenced by ActOnIdExpression(), and ActOnNameClassifiedAsDependentNonType().

◆ ActOnDependentMemberExpr()

◆ ActOnDependentTag()

◆ ActOnDesignatedInitializer()

◆ ActOnDocumentableDecl()

void Sema::ActOnDocumentableDecl ( Decl * D)

◆ ActOnDocumentableDecls()

void Sema::ActOnDocumentableDecls ( ArrayRef< Decl * > Group)

Definition at line 15460 of file SemaDecl.cpp.

References Context, Diags, getPreprocessor(), and clang::isa().

Referenced by ActOnDocumentableDecl(), and BuildDeclaratorGroup().

◆ ActOnDoStmt()

◆ ActOnDuplicateDefinition()

bool Sema::ActOnDuplicateDefinition ( Scope * S,
Decl * Prev,
SkipBodyInfo & SkipBody )

Perform ODR-like check for C/ObjC when merging tag types from modules.

Differently from C++, actually parse the body and reject / error out in case of a structural mismatch.

Definition at line 18850 of file SemaDecl.cpp.

References CleanupMergedEnum(), hasStructuralCompatLayout(), makeMergedDefinitionVisible(), clang::SkipBodyInfo::New, and clang::SkipBodyInfo::Previous.

◆ ActOnDuplicateODRHashDefinition()

template<typename T, typename = std::enable_if_t<std::is_base_of<NamedDecl, T>::value>>
bool clang::Sema::ActOnDuplicateODRHashDefinition ( T * Duplicate,
T * Previous )
inline

Check ODR hashes for C/ObjC when merging types from modules.

Differently from C++, actually parse the body and reject in case of a mismatch.

Definition at line 9610 of file Sema.h.

References makeMergedDefinitionVisible(), Previous, and clang::T.

◆ ActOnEffectExpression()

std::optional< FunctionEffectMode > Sema::ActOnEffectExpression ( Expr * CondExpr,
StringRef AttributeName )

◆ ActOnEmbedExpr()

ExprResult Sema::ActOnEmbedExpr ( SourceLocation EmbedKeywordLoc,
StringLiteral * BinaryData,
StringRef FileName )

Definition at line 17238 of file SemaExpr.cpp.

References Context, clang::Data, and clang::FileName.

◆ ActOnEmptyDeclaration()

Decl * Sema::ActOnEmptyDeclaration ( Scope * S,
const ParsedAttributesView & AttrList,
SourceLocation SemiLoc )

Handle a C++11 empty-declaration and attribute-declaration.

Definition at line 17266 of file SemaDeclCXX.cpp.

References Context, clang::EmptyDecl::Create(), CurContext, and ProcessDeclAttributeList().

◆ ActOnEndOfDeferStmt()

StmtResult Sema::ActOnEndOfDeferStmt ( Stmt * Body,
Scope * CurScope )

◆ ActOnEndOfTranslationUnit()

void Sema::ActOnEndOfTranslationUnit ( )

ActOnEndOfTranslationUnit - This is called at the very end of the translation unit when EOF is reached and all but the top-level scope is popped.

Definition at line 1231 of file Sema.cpp.

References clang::SemaHLSL::ActOnEndOfTranslationUnit(), clang::SemaOpenACC::ActOnEndOfTranslationUnit(), ActOnEndOfTranslationUnitFragment(), AnalysisWarnings, clang::cast(), CheckCompleteVariableDeclaration(), CheckDelayedMemberExceptionSpecs(), CheckDelegatingCtorCycles(), checkUndefinedButUsed(), clang::LangOptionsBase::CMK_ModuleInterface, Consumer, Context, clang::CPlusPlus, DelayedDllExportClasses, DelayedDllExportMemberFunctions, DelayedEquivalentExceptionSpecChecks, DelayedOverridingExceptionSpecChecks, DeleteExprs, clang::SemaBase::Diag(), DiagnosePrecisionLossInComplexDivision(), clang::SemaOpenMP::DiagnoseUnterminatedOpenMPDeclareTarget(), DiagnoseUnterminatedPragmaAlignPack(), DiagnoseUnterminatedPragmaAttribute(), clang::SemaObjC::DiagnoseUseOfUnimplementedSelectors(), Diags, emitAndClearUnusedLocalTypedefWarnings(), clang::ExpectedVariableOrFunction, clang::Module::ExplicitGlobalModuleFragment, ExternalDeclarations, ExternalSource, clang::VarDecl::getActingDefinition(), clang::VarDecl::getAnyInitializer(), getASTContext(), getCurrentModule(), clang::Sema::DelayedDiagnostics::getCurrentPool(), clang::VarDecl::getDescribedVarTemplate(), getLangOpts(), clang::Decl::getLocation(), getSourceManager(), clang::VarDecl::getStorageDuration(), clang::FunctionDecl::getTemplateSpecializationArgsAsWritten(), clang::ValueDecl::getType(), HLSL(), clang::Module::Imports, clang::isa(), clang::QualType::isConstQualified(), clang::FunctionDecl::isDeleted(), clang::Module::isInterfaceOrPartition(), clang::Decl::isInvalidDecl(), clang::Module::isNamedModuleInterfaceHasInit(), IsRecordFullyDefined(), clang::Decl::isReferenced(), clang::TagDecl::isUnion(), LangOpts, LateParsedInstantiations, LoadExternalWeakUndeclaredIdentifiers(), LookupOrdinaryName, LookupSingleName(), clang::Normal, ObjC(), OpenACC(), OpenMP(), ParsingInitForAutoVars, PendingExportedNames, PendingInstantiations, performFunctionEffectAnalysis(), PerformPendingInstantiations(), PP, clang::Private, clang::Module::PrivateModuleFragment, RequireCompleteType(), clang::ModuleMap::resolveConflicts(), clang::ModuleMap::resolveExports(), clang::ModuleMap::resolveUses(), clang::SC_Static, clang::SD_Static, clang::SD_Thread, clang::SourceRange::setEnd(), clang::Decl::setInvalidDecl(), clang::ValueDecl::setType(), ShouldRemoveFromUnused(), SM, SourceMgr, clang::Module::submodules(), clang::T, TentativeDefinitions, clang::TU_ClangModule, clang::TU_Prefix, TUKind, TUScope, UndefinedButUsed, UnusedFileScopedDecls, UnusedPrivateFields, and WeakUndeclaredIdentifiers.

◆ ActOnEndOfTranslationUnitFragment()

◆ ActOnEnumBody()

◆ ActOnEnumConstant()

◆ ActOnExceptionDeclarator()

◆ ActOnExitFunctionContext()

void Sema::ActOnExitFunctionContext ( )

Definition at line 1517 of file SemaDecl.cpp.

References CurContext.

◆ ActOnExplicitBoolSpecifier()

ExplicitSpecifier Sema::ActOnExplicitBoolSpecifier ( Expr * E)

ActOnExplicitBoolSpecifier - Build an ExplicitSpecifier from an expression found in an explicit(bool) specifier.

Definition at line 14039 of file SemaDeclCXX.cpp.

References clang::Expr::isTypeDependent(), tryResolveExplicitSpecifier(), and clang::Unresolved.

◆ ActOnExplicitInstantiation() [1/3]

DeclResult Sema::ActOnExplicitInstantiation ( Scope * S,
SourceLocation ExternLoc,
SourceLocation TemplateLoc,
Declarator & D )

Definition at line 10597 of file SemaTemplate.cpp.

References clang::OverloadCandidateSet::addCandidate(), clang::TemplateSpecCandidateSet::addCandidate(), clang::UnresolvedSetImpl::addDecl(), adjustCCAndNoReturn(), clang::UnresolvedSetImpl::begin(), clang::OverloadCandidateSet::BestViableFunction(), clang::C, clang::cast(), CheckEquivalentExceptionSpec(), CheckExplicitInstantiation(), CheckFunctionConstraints(), CheckSpecializationInstantiationRedecl(), CheckVarTemplateId(), clang::DeclSpec::ClearStorageClassSpecs(), Consumer, Context, clang::CPlusPlus11, clang::FixItHint::CreateRemoval(), clang::OverloadCandidateSet::CSK_Normal, CUDA(), clang::CUDATargetMismatch, clang::DeclarationName::CXXDeductionGuideName, DeduceTemplateArguments(), clang::SemaBase::Diag(), clang::OverloadCandidateSet::empty(), clang::UnresolvedSetImpl::end(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::DeclSpec::getAttributes(), clang::Declarator::getBeginLoc(), clang::DeclSpec::getBeginLoc(), clang::DeclSpec::getConstexprSpecLoc(), clang::Declarator::getCXXScopeSpec(), clang::Scope::getDeclParent(), clang::Declarator::getDeclSpec(), clang::Declarator::getIdentifierLoc(), clang::DeclSpec::getInlineSpecLoc(), clang::VarDecl::getInstantiatedFromStaticDataMember(), clang::UnqualifiedId::getKind(), getLangOpts(), clang::Decl::getLocation(), clang::TemplateSpecCandidateSet::getLocation(), getMostSpecialized(), clang::Declarator::getMutableDeclSpec(), clang::DeclarationNameInfo::getName(), clang::Declarator::getName(), GetNameForDeclarator(), clang::DeclarationName::getNameKind(), clang::FunctionDecl::getPointOfInstantiation(), clang::VarDecl::getPointOfInstantiation(), clang::CXXScopeSpec::getRange(), clang::Declarator::getSourceRange(), clang::DeclSpec::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::DeclSpec::getStorageClassSpecLoc(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::FunctionDecl::getTemplateSpecializationKind(), clang::VarDecl::getTemplateSpecializationKind(), clang::ValueDecl::getType(), GetTypeForDeclarator(), clang::DeclSpec::hasConstexprSpecifier(), clang::IK_TemplateId, InstantiateFunctionDefinition(), InstantiateVariableDefinition(), clang::Type::isFunctionType(), clang::DeclSpec::isInlineSpecified(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::SourceLocation::isInvalid(), clang::Declarator::isInvalidType(), clang::QualType::isNull(), clang::ConstraintSatisfaction::IsSatisfied, clang::CXXScopeSpec::isSet(), clang::VarDecl::isStaticDataMember(), clang::Type::isUndeducedType(), clang::ActionResult< PtrTy, Compress >::isUsable(), LangOpts, LookupOrdinaryName, LookupParsedName(), clang::MakeDeductionFailureInfo(), makeTemplateArgumentListInfo(), clang::Method, clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::ovl_fail_constraints_not_satisfied, clang::SemaBase::PDiag(), Previous, ProcessAPINotes(), ProcessDeclAttributeList(), clang::Result, ScopeSpecifierHasTemplateId(), clang::DeclSpec::SCS_typedef, clang::DeclSpec::SCS_unspecified, clang::TemplateSpecCandidate::set(), clang::VarDecl::setTemplateSpecializationKind(), clang::Specialization, clang::Success, clang::T, clang::UnqualifiedId::TemplateId, clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ExplicitSpecialization, and clang::TSK_Undeclared.

◆ ActOnExplicitInstantiation() [2/3]

DeclResult Sema::ActOnExplicitInstantiation ( Scope * S,
SourceLocation ExternLoc,
SourceLocation TemplateLoc,
unsigned TagSpec,
SourceLocation KWLoc,
const CXXScopeSpec & SS,
TemplateTy Template,
SourceLocation TemplateNameLoc,
SourceLocation LAngleLoc,
ASTTemplateArgsPtr TemplateArgs,
SourceLocation RAngleLoc,
const ParsedAttributesView & Attr )

◆ ActOnExplicitInstantiation() [3/3]

◆ ActOnExpressionTrait()

ExprResult Sema::ActOnExpressionTrait ( ExpressionTrait OET,
SourceLocation KWLoc,
Expr * Queried,
SourceLocation RParen )

ActOnExpressionTrait - Parsed one of the unary type trait support pseudo-functions.

Definition at line 1890 of file SemaTypeTraits.cpp.

References BuildExpressionTrait(), clang::ExprError(), and clang::Result.

◆ ActOnExprStmt()

◆ ActOnExprStmtError()

StmtResult Sema::ActOnExprStmtError ( )

Definition at line 65 of file SemaStmt.cpp.

References DiscardCleanupsInEvaluationContext(), and clang::StmtError().

◆ ActOnField()

Decl * Sema::ActOnField ( Scope * S,
Decl * TagD,
SourceLocation DeclStart,
Declarator & D,
Expr * BitfieldWidth )

ActOnField - Each field of a C struct/union is passed into this in order to create a FieldDecl object for it.

Definition at line 19076 of file SemaDecl.cpp.

References clang::AS_public, HandleField(), and clang::ICIS_NoInit.

◆ ActOnFields()

void Sema::ActOnFields ( Scope * S,
SourceLocation RecLoc,
Decl * TagDecl,
ArrayRef< Decl * > Fields,
SourceLocation LBrac,
SourceLocation RBrac,
const ParsedAttributesView & AttrList )

A field cannot be an Objective-c object

Definition at line 19716 of file SemaDecl.cpp.

References AbstractIvarType, clang::Decl::addAttr(), AddImplicitlyDeclaredMembersToClass(), clang::C2y, clang::C99, clang::CanNeverPassInRegs, clang::cast(), CheckAlignasUnderalignment(), clang::SemaObjC::CheckImplementationIvars(), checkMSInheritanceAttrOnDefinition(), ComputeSelectedDestructor(), ComputeSpecialMemberFunctionsEligiblity(), Context, clang::CPlusPlus, clang::FixItHint::CreateInsertion(), clang::Destructor, clang::SemaBase::Diag(), clang::SemaObjC::DiagnoseDuplicateIvars(), Diags, clang::Type::getAsRecordDecl(), clang::NamedDecl::getDeclName(), clang::NamedDecl::getIdentifier(), clang::ObjCContainerDecl::getIvarDecl(), clang::Decl::getKind(), getLangOpts(), clang::Decl::getLocation(), clang::Qualifiers::getObjCLifetime(), clang::QualType::getObjCLifetime(), clang::Scope::getParent(), clang::QualType::getPointerAuth(), clang::QualType::getQualifiers(), clang::CharUnits::getQuantity(), getSourceManager(), clang::ValueDecl::getType(), clang::QualType::getTypePtr(), clang::Decl::hasAttr(), clang::QualType::hasNonTrivialObjCLifetime(), clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::QualType::hasNonTrivialToPrimitiveDefaultInitializeCUnion(), clang::QualType::hasNonTrivialToPrimitiveDestructCUnion(), inTemplateInstantiation(), clang::isa(), clang::PointerAuthQualifier::isAddressDiscriminated(), clang::FieldDecl::isAnonymousStructOrUnion(), clang::FieldDecl::isBitField(), clang::Type::isDependentType(), clang::QualType::isDestructedType(), clang::Type::isFunctionType(), clang::Type::isIncompleteArrayType(), clang::Type::isIncompleteType(), clang::Decl::isInvalidDecl(), clang::QualType::isNonTrivialToPrimitiveCopy(), clang::QualType::isNonTrivialToPrimitiveDefaultInitialize(), clang::QualType::isObjCGCStrong(), clang::Type::isObjCObjectPointerType(), clang::Type::isObjCObjectType(), clang::Scope::isTemplateParamScope(), clang::Scope::isTypeAliasScope(), clang::QualType::isVolatileQualified(), clang::ObjCInterfaceDecl::known_extensions(), LangOpts, clang::LangOptionsBase::NonGC, ObjC(), clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, clang::QualType::PCK_Trivial, clang::QualType::PCK_VolatileTrivial, ProcessAPINotes(), ProcessDeclAttributeList(), clang::randstruct::randomizeStructureLayout(), RequireCompleteSizedType(), RequireCompleteType(), RequireNonAbstractType(), SetDeclDeleted(), clang::Decl::setInvalidDecl(), clang::Decl::setLexicalDeclContext(), clang::ValueDecl::setType(), ShouldDeleteSpecialMember(), and clang::T.

Referenced by ActOnCapturedRegionError(), ActOnFinishCXXMemberSpecification(), ActOnLambdaError(), and BuildLambdaExpr().

◆ ActOnFileScopeAsmDecl()

Decl * Sema::ActOnFileScopeAsmDecl ( Expr * expr,
SourceLocation AsmLoc,
SourceLocation RParenLoc )

◆ ActOnFinishConceptDefinition()

◆ ActOnFinishCXXInClassMemberInitializer()

◆ ActOnFinishCXXMemberDecls()

void Sema::ActOnFinishCXXMemberDecls ( )

Perform any semantic analysis which needs to be delayed until all pending class member declarations have been parsed.

Definition at line 14592 of file SemaDeclCXX.cpp.

References checkForMultipleExportedDefaultConstructors(), CurContext, DelayedEquivalentExceptionSpecChecks, and DelayedOverridingExceptionSpecChecks.

◆ ActOnFinishCXXMemberSpecification()

void Sema::ActOnFinishCXXMemberSpecification ( Scope * S,
SourceLocation RLoc,
Decl * TagDecl,
SourceLocation LBrac,
SourceLocation RBrac,
const ParsedAttributesView & AttrList )

◆ ActOnFinishCXXNonNestedClass()

◆ ActOnFinishDelayedAttribute()

void Sema::ActOnFinishDelayedAttribute ( Scope * S,
Decl * D,
ParsedAttributes & Attrs )

ActOnFinishDelayedAttribute - Invoked when we have finished parsing an attribute for which parsing is delayed.

When we finish delayed parsing of an attribute, we must attach it to the relevant Decl.

Definition at line 16993 of file SemaDecl.cpp.

References checkThisInStaticMemberFunctionAttributes(), clang::Method, ProcessAPINotes(), and ProcessDeclAttributeList().

◆ ActOnFinishDelayedCXXMethodDeclaration()

void Sema::ActOnFinishDelayedCXXMethodDeclaration ( Scope * S,
Decl * Method )

ActOnFinishDelayedCXXMethodDeclaration - We have finished processing the delayed method declaration for Method.

The method declaration is now considered finished. There may be a separate ActOnStartOfFunctionDef action later (not necessarily immediately!) for this method, if it was also defined inside the class body.

Definition at line 10968 of file SemaDeclCXX.cpp.

References AdjustDeclIfTemplate(), clang::cast(), CheckConstructor(), CheckCXXDefaultArguments(), clang::Constructor, and clang::Method.

◆ ActOnFinishDelayedMemberDeclarations()

void Sema::ActOnFinishDelayedMemberDeclarations ( Scope * S,
Decl * Record )

Definition at line 10935 of file SemaDeclCXX.cpp.

References PopDeclContext().

◆ ActOnFinishDelayedMemberInitializers()

void Sema::ActOnFinishDelayedMemberInitializers ( Decl * Record)

Definition at line 14284 of file SemaDeclCXX.cpp.

References CheckDelayedMemberExceptionSpecs().

◆ ActOnFinishExportDecl()

Decl * Sema::ActOnFinishExportDecl ( Scope * S,
Decl * ExportDecl,
SourceLocation RBraceLoc )

Complete the definition of an export declaration.

Definition at line 1000 of file SemaModule.cpp.

References clang::cast(), checkExportedDecl(), getASTContext(), clang::Decl::isInvalidDecl(), clang::SourceLocation::isValid(), and PopDeclContext().

◆ ActOnFinishFullExpr() [1/2]

◆ ActOnFinishFullExpr() [2/2]

◆ ActOnFinishFullStmt()

StmtResult Sema::ActOnFinishFullStmt ( Stmt * Stmt)

Definition at line 7749 of file SemaExprCXX.cpp.

References MaybeCreateStmtWithCleanups(), and clang::StmtError().

◆ ActOnFinishFunctionBody()

Decl * Sema::ActOnFinishFunctionBody ( Decl * Decl,
Stmt * Body,
bool IsInstantiation = false,
bool RetainFunctionScopeInfo = false )

Performs semantic analysis at the end of a function body.

Parameters
RetainFunctionScopeInfoIf true, the client is responsible for releasing the associated FunctionScopeInfo. This is useful when building e.g. LambdaExprs.

Definition at line 16502 of file SemaDecl.cpp.

References clang::Decl::addAttr(), AnalysisWarnings, clang::SemaSYCL::BuildSYCLKernelCallStmt(), clang::C99, clang::cast(), clang::Type::castAs(), CheckCompletedCoroutineBody(), CheckConstexprFunctionDefinition(), CheckCoroutineWrapper(), CheckDestructor(), CheckImmediateEscalatingFunctionDefinition(), checkTypeSupport(), clang::Stmt::children(), clang::NSAPI::ClassId_NSObject, Cleanup, computeNRVO(), clang::Constructor, Context, clang::CPlusPlus, clang::CPlusPlus14, clang::FixItHint::CreateInsertion(), DeclsToCheckForDeferredDiags, deduceClosureReturnType(), DeduceFunctionTypeFromReturnExpr(), Definition, clang::Destructor, clang::SemaBase::Diag(), Diagnose, diagnoseImplicitlyRetainedSelf(), DiagnoseInvalidJumps(), DiagnoseReturnInConstructorExceptionHandler(), DiagnoseSizeOfParametersAndReturnValue(), DiagnoseUnguardedAvailabilityViolations(), DiagnoseUnusedParameters(), clang::sema::AnalysisBasedWarnings::Policy::disableCheckFallThrough(), DiscardCleanupsInEvaluationContext(), Emitted, ExprCleanupObjects, ExprEvalContexts, FindPossiblePrototype(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::TypeLoc::getAs(), clang::Decl::getAsFunction(), clang::Decl::getAttr(), clang::DeclaratorDecl::getBeginLoc(), clang::CXXMethodDecl::getCanonicalDecl(), getCurFunction(), getCurFunctionDecl(), getCurLambda(), getCurMethodDecl(), getDiagnostics(), getEmissionStatus(), clang::Decl::getEndLoc(), clang::Stmt::getEndLoc(), clang::NamedDecl::getIdentifier(), getLangOpts(), clang::Decl::getLocation(), clang::FunctionDecl::getNumParams(), clang::CXXMethodDecl::getParent(), clang::Type::getPointeeType(), clang::FunctionDecl::getReturnType(), getSourceManager(), clang::FunctionDecl::getStorageClass(), clang::ValueDecl::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::DeclaratorDecl::getTypeSpecStartLoc(), hasAnyUnrecoverableErrorsInThisFunction(), clang::Decl::hasAttr(), clang::FunctionDecl::hasImplicitReturnZero(), clang::sema::FunctionScopeInfo::HasPotentialAvailabilityViolations, clang::FunctionDecl::hasSkippedBody(), hasUncompilableErrorOccurred(), clang::FunctionDecl::hasWrittenPrototype(), clang::Invalid, clang::isa(), clang::Type::isAnyPointerType(), clang::FunctionDecl::isConstexpr(), clang::QualType::isConstQualified(), clang::sema::FunctionScopeInfo::isCoroutine(), clang::FunctionDecl::isDefaulted(), clang::FunctionDecl::isDefined(), clang::FunctionDecl::isDeleted(), clang::FunctionDecl::isDeletedAsWritten(), clang::DeclContext::isDependentContext(), clang::Decl::isImplicit(), clang::FunctionDecl::isInlined(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::isLambdaCallOperator(), clang::FunctionDecl::isMain(), clang::FunctionDecl::isMultiVersion(), clang::FunctionDecl::isOutOfLine(), clang::FunctionDecl::isPureVirtual(), clang::Type::isRecordType(), clang::Decl::isTemplated(), clang::Decl::isUnavailable(), clang::Type::isUndeducedType(), clang::CXXMethodDecl::isVirtual(), clang::isWhitespace(), LangOpts, MarkBaseAndMemberDestructorsReferenced(), MarkVTableUsed(), MaybeODRUseExprs, clang::sema::FunctionScopeInfo::NeedsScopeChecking(), clang::SemaObjC::NSAPIObj, ObjC(), clang::sema::FunctionScopeInfo::ObjCShouldCallSuper, clang::sema::FunctionScopeInfo::ObjCWarnForNoDesignatedInitChain, clang::sema::FunctionScopeInfo::ObjCWarnForNoInitDelegation, clang::FunctionDecl::parameters(), PopDeclContext(), PopFunctionScopeInfo(), PP, clang::SC_None, clang::FunctionDecl::setBody(), clang::Decl::setInvalidDecl(), clang::ValueDecl::setType(), clang::FunctionDecl::setWillHaveBody(), ShouldWarnAboutMissingPrototype(), SM, SYCL(), Unknown, and clang::sema::FunctionScopeInfo::UsesFPIntrin.

Referenced by ActOnLambdaExpr(), and InstantiateFunctionDefinition().

◆ ActOnFinishFunctionDeclarationDeclarator()

◆ ActOnFinishInlineFunctionDef()

void Sema::ActOnFinishInlineFunctionDef ( FunctionDecl * D)

Definition at line 15932 of file SemaDecl.cpp.

References Consumer.

Referenced by ActOnFinishCXXNonNestedClass().

◆ ActOnFinishKNRParamDeclarations()

◆ ActOnFinishLinkageSpecification()

Decl * Sema::ActOnFinishLinkageSpecification ( Scope * S,
Decl * LinkageSpec,
SourceLocation RBraceLoc )

ActOnFinishLinkageSpecification - Complete the definition of the C++ linkage specification LinkageSpec.

If RBraceLoc is valid, it's the position of the closing '}' brace in a linkage specification that uses braces.

Definition at line 17246 of file SemaDeclCXX.cpp.

References clang::cast(), getCurrentModule(), getLangOpts(), clang::SourceLocation::isValid(), PopDeclContext(), and clang::LinkageSpecDecl::setRBraceLoc().

◆ ActOnFinishNamespaceDef()

void Sema::ActOnFinishNamespaceDef ( Decl * Dcl,
SourceLocation RBrace )

ActOnFinishNamespaceDef - This callback is called after a namespace is exited.

Decl is the DeclTy returned by ActOnStartNamespaceDef.

Definition at line 12028 of file SemaDeclCXX.cpp.

References clang::Decl::hasAttr(), PopDeclContext(), PopPragmaVisibility(), clang::Decl::setModuleOwnershipKind(), clang::NamespaceDecl::setRBraceLoc(), and clang::Decl::VisibleWhenImported.

◆ ActOnFinishOfCompoundStmt()

void Sema::ActOnFinishOfCompoundStmt ( )

Definition at line 428 of file SemaStmt.cpp.

References PopCompoundScope().

◆ ActOnFinishRequiresExpr()

void Sema::ActOnFinishRequiresExpr ( )

Definition at line 8045 of file SemaExprCXX.cpp.

References CurContext.

◆ ActOnFinishSEHFinallyBlock()

StmtResult Sema::ActOnFinishSEHFinallyBlock ( SourceLocation Loc,
Stmt * Block )

◆ ActOnFinishSwitchStmt()

◆ ActOnFinishTopLevelStmtDecl()

void Sema::ActOnFinishTopLevelStmtDecl ( TopLevelStmtDecl * D,
Stmt * Statement )

◆ ActOnFinishTrailingRequiresClause()

ExprResult Sema::ActOnFinishTrailingRequiresClause ( ExprResult ConstraintExpr)

Definition at line 4157 of file SemaDeclCXX.cpp.

References ActOnRequiresClause().

◆ ActOnForEachDeclStmt()

◆ ActOnForEachLValueExpr()

StmtResult Sema::ActOnForEachLValueExpr ( Expr * E)

In an Objective C collection iteration statement: for (x in y) x can be an arbitrary l-value expression.

Bind it up as a full-expression.

Definition at line 2318 of file SemaStmt.cpp.

References ActOnFinishFullExpr(), CheckPlaceholderExpr(), clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and clang::StmtError().

◆ ActOnForStmt()

◆ ActOnFriendFunctionDecl()

NamedDecl * Sema::ActOnFriendFunctionDecl ( Scope * S,
Declarator & D,
MultiTemplateParamsArg TemplateParams )

Definition at line 18187 of file SemaDeclCXX.cpp.

References ActOnFunctionDeclarator(), adjustContextForLocalExternDecl(), clang::AS_public, clang::cast(), CheckFriendAccess(), computeDeclContext(), Context, clang::CPlusPlus11, clang::FriendDecl::Create(), clang::FixItHint::CreateRemoval(), CurContext, clang::Scope::DeclScope, Diag(), DiagnoseUnexpandedParameterPack(), Diags, clang::DeclContext::Equals(), ForExternalRedeclaration, functionDeclHasDefaultArgument(), clang::SourceRange::getBegin(), clang::DeclarationNameInfo::getBeginLoc(), clang::Declarator::getCXXScopeSpec(), clang::Decl::getDeclContext(), clang::Declarator::getDeclSpec(), clang::Scope::getFnParent(), clang::DeclSpec::getFriendSpecLoc(), clang::Declarator::getIdentifierLoc(), clang::UnqualifiedId::getKind(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::DeclarationNameInfo::getName(), clang::Declarator::getName(), GetNameForDeclarator(), clang::DeclContext::getNonTransparentContext(), clang::DeclaratorDecl::getNumTemplateParameterLists(), clang::DeclContext::getParent(), clang::CXXScopeSpec::getRange(), clang::DeclContext::getRedeclContext(), getScopeForDeclContext(), clang::CXXScopeSpec::getScopeRep(), clang::DeclSpec::getStorageClassSpec(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), clang::IK_ConstructorName, clang::IK_ConstructorTemplateId, clang::IK_ConversionFunctionId, clang::IK_DeductionGuideName, clang::IK_DestructorName, clang::IK_Identifier, clang::IK_ImplicitSelfParam, clang::IK_LiteralOperatorId, clang::IK_OperatorFunctionId, clang::IK_TemplateId, clang::isa(), clang::NestedNameSpecifier::isDependent(), clang::DeclContext::isFileContext(), clang::DeclSpec::isFriendSpecified(), clang::Declarator::isFunctionDefinition(), clang::Type::isFunctionType(), clang::CXXScopeSpec::isInvalid(), clang::Decl::isInvalidDecl(), clang::CXXScopeSpec::isNotEmpty(), clang::DeclContext::isRecord(), clang::Declarator::isRedeclaration(), clang::CXXScopeSpec::isSet(), clang::CXXScopeSpec::isValid(), LookupLocalFriendName, LookupName(), LookupOrdinaryName, LookupQualifiedName(), clang::DeclContext::makeDeclVisibleInContext(), Previous, PushOnScopeChains(), RequireCompleteDeclContext(), clang::DeclSpec::SCS_unspecified, clang::Decl::setAccess(), clang::Scope::setEntity(), clang::Decl::setInvalidDecl(), clang::FriendDecl::setUnsupportedFriend(), UPPC_FriendDeclaration, and warnOnReservedIdentifier().

◆ ActOnFriendTypeDecl()

Decl * Sema::ActOnFriendTypeDecl ( Scope * S,
const DeclSpec & DS,
MultiTemplateParamsArg TemplateParams,
SourceLocation EllipsisLoc )

Handle a friend type declaration.

This works in tandem with ActOnTag.

Notes on friend class templates:

We generally treat friend class declarations as if they were declaring a class. So, for example, the elaborated type specifier in a friend declaration is required to obey the restrictions of a class-head (i.e. no typedefs in the scope chain), template parameters are required to match up with simple template-ids, &c. However, unlike when declaring a template specialization, it's okay to refer to a template specialization without an empty template parameter declaration, e.g. friend class A<T>::B<unsigned>; We permit this as a special case; if there are any template parameters present at all, require proper matching, i.e. template <> template <class T> friend class A<int>::B;

Definition at line 18070 of file SemaDeclCXX.cpp.

References clang::AS_public, clang::Type::containsUnexpandedParameterPack(), Context, clang::CPlusPlus11, clang::FriendDecl::Create(), clang::FriendTemplateDecl::Create(), clang::FixItHint::CreateInsertion(), CurContext, Diag(), clang::SemaBase::DiagCompat(), DiagnoseUnexpandedParameterPack(), clang::DeclSpec::getAtomicSpecLoc(), clang::DeclSpec::getBeginLoc(), clang::TypeLoc::getBeginLoc(), clang::DeclSpec::getConstSpecLoc(), clang::DeclSpec::getFriendSpecLoc(), clang::TagDecl::getKindName(), getLangOpts(), getLocForEndOfToken(), clang::DeclSpec::getRestrictSpecLoc(), clang::DeclSpec::getSourceRange(), clang::TypeLoc::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::TagDecl::getTagKind(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclSpec::getTypeQualifiers(), clang::DeclSpec::getUnalignedSpecLoc(), clang::DeclSpec::getVolatileSpecLoc(), clang::Invalid, clang::DeclSpec::isFriendSpecified(), clang::DeclSpec::isFriendSpecifiedFirst(), clang::SourceLocation::isInvalid(), clang::Declarator::isInvalidType(), clang::SourceLocation::isValid(), clang::Member, clang::ParsedAttributesView::none(), clang::DeclSpec::SCS_unspecified, clang::Decl::setAccess(), clang::Decl::setInvalidDecl(), clang::T, clang::DeclSpec::TQ_atomic, clang::DeclSpec::TQ_const, clang::DeclSpec::TQ_restrict, clang::DeclSpec::TQ_unaligned, clang::DeclSpec::TQ_volatile, and UPPC_FriendDeclaration.

Referenced by ParsedFreeStandingDeclSpec().

◆ ActOnFunctionDeclarator()

NamedDecl * Sema::ActOnFunctionDeclarator ( Scope * S,
Declarator & D,
DeclContext * DC,
TypeSourceInfo * TInfo,
LookupResult & Previous,
MultiTemplateParamsArg TemplateParamLists,
bool & AddToScope )

Definition at line 10057 of file SemaDecl.cpp.

References clang::SemaOpenACC::ActOnFunctionDeclarator(), clang::SemaHLSL::ActOnTopLevelFunction(), clang::Decl::addAttr(), clang::SemaObjC::AddCFAuditedAttribute(), clang::DeclContext::addDecl(), AddImplicitMSFunctionNoBuiltinAttr(), AddKnownFunctionAttributes(), AddPushedVisibilityAttribute(), AddRangeBasedOptnone(), AddSectionMSAllocText(), adjustContextForLocalExternDecl(), adjustMemberFunctionCC(), clang::TemplateArgumentListInfo::arguments(), clang::AS_public, BuildParmVarDeclForTypedef(), clang::cast(), clang::Type::castAs(), clang::CC_X86StdCall, checkAttributesAfterMerging(), CheckDependentFunctionTemplateSpecialization(), checkDLLAttributeRedeclaration(), clang::SemaHLSL::CheckEntryPoint(), CheckFunctionDeclaration(), CheckFunctionTemplateSpecialization(), checkIsValidOpenCLKernelParameter(), CheckMain(), CheckMemberSpecialization(), CheckMSVCRTEntryPoint(), checkNonTrivialCUnion(), CheckTemplateDeclScope(), CheckTemplateParameterList(), clang::CLanguageLinkage, CodeSegStack, CompleteMemberSpecialization(), clang::Consteval, clang::Constexpr, clang::AssociatedConstraint::ConstraintExpr, clang::DeclContext::containsDecl(), Context, clang::CPlusPlus, clang::CPlusPlus11, clang::CPlusPlus14, clang::CPlusPlus20, clang::FunctionTemplateDecl::Create(), clang::FixItHint::CreateInsertion(), CreateNewFunctionDecl(), clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), CUDA(), CurContext, clang::DeclarationName::CXXDestructorName, clang::Declaration, clang::Default, clang::Defaulted, clang::Definition, clang::Deleted, clang::SemaBase::Diag(), DiagnoseInvalidRedeclaration(), DiagnoseUnexpandedParameterPack(), clang::Decl::dropAttr(), clang::Error, clang::EST_BasicNoexcept, ExternalDeclarations, ExtnameUndeclaredIdentifiers, FilterLookupForScope(), clang::FoundOverloaded, FriendConstraintsDependOnEnclosingTemplate(), clang::FTIHasNonVoidParameters(), clang::DeclaratorChunk::Fun, clang::FunctionReturn, FunctionTemplate, clang::Decl::getAccess(), clang::QualType::getAddressSpace(), clang::Type::getAs(), clang::Declarator::getAsmLabel(), clang::Decl::getAttr(), clang::SourceRange::getBegin(), clang::DeclaratorDecl::getBeginLoc(), clang::DeclSpec::getBeginLoc(), clang::QualType::getCanonicalType(), clang::FunctionType::ExtInfo::getCC(), clang::FunctionType::getCmseNSCallAttr(), clang::SemaCUDA::getConfigureFuncName(), clang::DeclSpec::getConstexprSpecifier(), clang::DeclSpec::getConstexprSpecLoc(), clang::Declarator::getCXXScopeSpec(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::DeclaratorChunk::FunctionTypeInfo::getDeclsInPrototype(), clang::Declarator::getDeclSpec(), clang::Scope::getDepth(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::SourceRange::getEnd(), clang::DeclSpec::getExplicitSpecLoc(), clang::DeclSpec::getExplicitSpecRange(), clang::FunctionType::getExtInfo(), clang::FunctionProtoType::getExtProtoInfo(), clang::Declarator::getFunctionDefinitionKind(), getFunctionStorageClass(), clang::NamedDecl::getIdentifier(), clang::Declarator::getIdentifierLoc(), getImplicitCodeSegOrSectionAttrForFunction(), clang::DeclSpec::getInlineSpecLoc(), clang::Declarator::getInventedTemplateParameterList(), clang::Decl::getKind(), clang::UnqualifiedId::getKind(), getLangOpts(), clang::FunctionDecl::getLanguageLinkage(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), getLocForEndOfToken(), clang::DeclSpec::getModulePrivateSpecLoc(), clang::DeclarationNameInfo::getName(), clang::Declarator::getName(), clang::NamedDecl::getName(), clang::FunctionType::getNameForCallConv(), GetNameForDeclarator(), clang::DeclarationName::getNameKind(), clang::DeclSpec::getNoreturnSpecLoc(), clang::FunctionDecl::getNumParams(), clang::Decl::getOwningModule(), clang::FunctionProtoType::getParamTypes(), clang::FunctionDecl::getPreviousDecl(), clang::CXXScopeSpec::getRange(), clang::DeclContext::getRedeclContext(), clang::FunctionDecl::getReturnType(), clang::FunctionType::getReturnType(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::CXXScopeSpec::getScopeRep(), clang::Declarator::getSourceRange(), clang::TemplateParameterList::getSourceRange(), clang::UnqualifiedId::getSourceRange(), clang::DeclSpec::getSpecifierName(), clang::DeclSpec::getStorageClassSpecLoc(), clang::StringLiteral::getString(), clang::StringLiteral::getStrTokenLoc(), getTagInjectionContext(), clang::TemplateIdAnnotation::getTemplateArgs(), clang::TemplateDecl::getTemplateParameters(), clang::DeclSpec::getThreadStorageClassSpec(), clang::DeclSpec::getThreadStorageClassSpecLoc(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::TypeSourceInfo::getType(), clang::ValueDecl::getType(), clang::Declarator::getTypeObject(), clang::Type::getUnqualifiedDesugaredType(), clang::DeclSpec::getVirtualSpecLoc(), clang::Decl::hasAttr(), clang::FunctionProtoType::hasExceptionSpec(), clang::DeclSpec::hasExplicitSpecifier(), clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::QualType::hasNonTrivialToPrimitiveDestructCUnion(), HLSL(), clang::Decl::IDNS_Ordinary, clang::IK_TemplateId, clang::Invalid, clang::isa(), clang::DeclarationName::isAnyOperatorDelete(), clang::DeclarationName::isAnyOperatorNewOrDelete(), clang::FunctionDecl::isCPUDispatchMultiVersion(), clang::FunctionDecl::isCPUSpecificMultiVersion(), clang::Declarator::isCtorOrDtor(), isDeclExternC(), clang::NestedNameSpecifier::isDependent(), clang::DeclContext::isDependentContext(), clang::Type::isDependentType(), clang::Declarator::isExplicitObjectMemberFunction(), clang::NamedDecl::isExternallyVisible(), clang::DeclContext::isFileContext(), clang::FunctionDecl::isFirstDecl(), clang::Declarator::isFirstDeclarationOfMember(), clang::DeclSpec::isFriendSpecified(), clang::Decl::isFromGlobalModule(), clang::Declarator::isFunctionDeclarator(), clang::Declarator::isFunctionDefinition(), clang::Type::isFunctionNoProtoType(), clang::Type::isFunctionType(), clang::Module::isHeaderLikeModule(), clang::DeclarationName::isIdentifier(), isIncompleteDeclExternC(), clang::Decl::isInIdentifierNamespace(), clang::DeclSpec::isInlineSpecified(), clang::Decl::isInNamedModule(), clang::Decl::isInStdNamespace(), clang::Decl::isInvalidDecl(), clang::Declarator::isInvalidType(), clang::FunctionDecl::isMain(), clang::DeclSpec::isModulePrivateSpecified(), clang::FunctionDecl::isMSVCRTEntryPoint(), clang::FunctionDecl::isMultiVersion(), clang::DeclSpec::isNoreturnSpecified(), clang::CXXScopeSpec::isNotEmpty(), clang::FunctionDecl::isOutOfLine(), clang::FunctionDecl::isOverloadedOperator(), clang::Type::isPointerOrReferenceType(), clang::Type::isPointerType(), clang::DeclContext::isRecord(), clang::Declarator::isRedeclaration(), clang::FunctionDecl::isReplaceableGlobalAllocationFunction(), clang::Type::isScalarType(), clang::CXXScopeSpec::isSet(), clang::Declarator::isStaticMember(), isStdBuiltin(), clang::Decl::isTemplated(), clang::DeclContext::isTranslationUnit(), clang::Type::isUndeducedType(), clang::SourceRange::isValid(), clang::Type::isVariablyModifiedType(), clang::DeclSpec::isVirtualSpecified(), clang::Type::isVoidType(), clang::Type::isWebAssemblyTableType(), clang::TemplateIdAnnotation::LAngleLoc, LookupNecessaryTypesForBuiltin(), MarkUnusedFileScopedDecl(), MatchTemplateParametersToScopeSpecifier(), clang::SemaCUDA::maybeAddHostDeviceAttrs(), ModifyFnAttributesMSPragmaOptimize(), clang::LangOptionsBase::MSVC2015, NTCUK_Copy, NTCUK_Destruct, clang::TemplateIdAnnotation::NumArgs, clang::DeclaratorChunk::FunctionTypeInfo::NumParams, ObjC(), OpenACC(), OpenCL(), OriginalLexicalContext, clang::DeclaratorChunk::ParamInfo::Param, clang::FunctionDecl::parameters(), clang::DeclaratorChunk::FunctionTypeInfo::Params, PragmaClangTextSection, Previous, ProcessDeclAttributes(), ProcessPragmaExport(), ProcessPragmaWeak(), clang::ASTContext::PSF_Execute, clang::ASTContext::PSF_Implicit, clang::ASTContext::PSF_Read, clang::TemplateIdAnnotation::RAngleLoc, RebuildTemplateParamsInCurrentInstantiation(), RegisterLocallyScopedExternCDecl(), clang::DeclContext::removeDecl(), clang::Result, clang::SC_None, clang::SC_Static, clang::Decl::setAccess(), clang::FunctionDecl::setConstexprKind(), clang::FunctionDecl::setDefaulted(), clang::FunctionDecl::setDeletedAsWritten(), clang::FunctionDecl::setDescribedFunctionTemplate(), clang::FunctionDecl::setFriendConstraintRefersToEnclosingTemplate(), clang::FunctionDecl::setImplicitlyInline(), clang::Decl::setInvalidDecl(), clang::Declarator::setInvalidType(), clang::FunctionDecl::setIsPureVirtual(), clang::TemplateArgumentListInfo::setLAngleLoc(), clang::Decl::setLexicalDeclContext(), clang::Decl::setLocalExternDecl(), clang::NamedDecl::setModulePrivate(), SetNestedNameSpecifier(), clang::Decl::setNonMemberOperator(), clang::Decl::setObjectOfFriendDecl(), clang::FunctionDecl::setRangeEnd(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::Declarator::setRedeclaration(), clang::DeclaratorDecl::setTemplateParameterListsInfo(), clang::Decl::setTopLevelDeclInObjCContainer(), clang::ValueDecl::setType(), clang::FunctionDecl::setVirtualAsWritten(), shouldConsiderLinkage(), clang::TemplateParameterList::size(), StrictGuardStackCheckStack, clang::supportsVariadicCall(), clang::UnqualifiedId::TemplateId, TPC_ClassTemplateMember, TPC_FriendFunctionTemplate, TPC_FriendFunctionTemplateDefinition, TPC_FunctionTemplate, translateTemplateArguments(), UnifySection(), clang::Unspecified, UPPC_ExplicitSpecialization, UPPC_FriendDeclaration, warnOnReservedIdentifier(), and clang::FunctionProtoType::ExtProtoInfo::withExceptionSpec().

Referenced by ActOnFriendFunctionDecl(), DiagnoseInvalidRedeclaration(), and HandleDeclarator().

◆ ActOnGCCAsmStmt()

StmtResult Sema::ActOnGCCAsmStmt ( SourceLocation AsmLoc,
bool IsSimple,
bool IsVolatile,
unsigned NumOutputs,
unsigned NumInputs,
IdentifierInfo ** Names,
MultiExprArg Constraints,
MultiExprArg Exprs,
Expr * AsmString,
MultiExprArg Clobbers,
unsigned NumLabels,
SourceLocation RParenLoc )

Definition at line 269 of file SemaStmtAsm.cpp.

References clang::TargetInfo::ConstraintInfo::allowsMemory(), clang::TargetInfo::ConstraintInfo::allowsRegister(), CheckAsmLValue(), checkExprMemoryConstraintCompat(), CheckNakedParmReference(), CheckPlaceholderExpr(), CleanupVarDeclMarking(), Context, clang::FixItHint::CreateReplacement(), DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), DiscardCleanupsInEvaluationContext(), emitAndFixInvalidAsmCastLValue(), clang::Expr::EvaluateAsRValue(), clang::GCCAsmStmt::ExtractStringFromGCCAsmStmtComponent(), clang::Found, clang::ActionResult< PtrTy, Compress >::get(), clang::CharSourceRange::getBegin(), clang::Stmt::getBeginLoc(), getClobberConflictLocation(), clang::TargetInfo::ConstraintInfo::getConstraintStr(), getCurLexicalContext(), clang::Expr::getDependence(), clang::Expr::getExprLoc(), getLocationOfStringLiteralByte(), clang::GCCAsmStmt::AsmStringPiece::getModifier(), clang::IdentifierInfo::getName(), clang::GCCAsmStmt::AsmStringPiece::getOperandNo(), clang::GCCAsmStmt::AsmStringPiece::getRange(), clang::Stmt::getSourceRange(), clang::GCCAsmStmt::AsmStringPiece::getString(), clang::TargetInfo::ConstraintInfo::getTiedOperand(), clang::Expr::getType(), clang::TargetInfo::ConstraintInfo::hasTiedOperand(), clang::Expr::IgnoreParenNoopCasts(), ImpCastExprToType(), clang::isa(), clang::Type::isBitIntType(), clang::Type::isBooleanType(), clang::Type::isDependentType(), clang::Expr::isEvaluatable(), clang::Type::isIncompleteType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isMemberPointerType(), clang::Expr::isModifiableLvalue(), clang::GCCAsmStmt::AsmStringPiece::isOperand(), isOperandMentioned(), clang::Type::isPointerType(), clang::Type::isRealFloatingType(), clang::Type::isStructureType(), clang::Expr::isTypeDependent(), clang::SourceLocation::isValid(), clang::TargetInfo::ConstraintInfo::isValidAsmImmediate(), clang::Expr::isValueDependent(), clang::Type::isVoidType(), LangOpts, clang::Expr::MLV_ArrayType, clang::Expr::MLV_IncompleteType, clang::Expr::MLV_IncompleteVoidType, clang::Expr::MLV_LValueCast, clang::Expr::MLV_Valid, NS, RequireCompleteType(), clang::TargetInfo::ConstraintInfo::requiresImmediateConstant(), clang::Result, setFunctionHasBranchIntoScope(), clang::StmtError(), targetDiag(), clang::APValue::toIntegralConstant(), toString(), and clang::Expr::EvalResult::Val.

Referenced by clang::TreeTransform< AdjustConstraints >::RebuildGCCAsmStmt().

◆ ActOnGCCAsmStmtString()

◆ ActOnGenericSelectionExpr()

ExprResult Sema::ActOnGenericSelectionExpr ( SourceLocation KeyLoc,
SourceLocation DefaultLoc,
SourceLocation RParenLoc,
bool PredicateIsExpr,
void * ControllingExprOrType,
ArrayRef< ParsedType > ArgTypes,
ArrayRef< Expr * > ArgExprs )

ControllingExprOrType is either an opaque pointer coming out of a ParsedType or an Expr *.

FIXME: it'd be better to split this interface into two so we don't take a void *, but that's awkward because one of the operands is either a ParsedType or an Expr *, which doesn't lend itself to generic code very well.

Definition at line 1730 of file SemaExpr.cpp.

References CreateGenericSelectionExpr(), clang::OpaquePtr< QualType >::getFromOpaquePtr(), and GetTypeFromParser().

◆ ActOnGlobalModuleFragmentDecl()

Sema::DeclGroupPtrTy Sema::ActOnGlobalModuleFragmentDecl ( SourceLocation ModuleLoc)

The parser has processed a global-module-fragment declaration that begins the definition of the global module fragment of the current module unit.

Parameters
ModuleLocThe location of the 'module' keyword.

Definition at line 153 of file SemaModule.cpp.

References Context, and clang::Decl::ReachableWhenImported.

◆ ActOnGNUNullExpr()

ExprResult Sema::ActOnGNUNullExpr ( SourceLocation TokenLoc)

Definition at line 17112 of file SemaExpr.cpp.

References Context, and clang::Default.

◆ ActOnGotoStmt()

◆ ActOnIdExpression()

ExprResult Sema::ActOnIdExpression ( Scope * S,
CXXScopeSpec & SS,
SourceLocation TemplateKWLoc,
UnqualifiedId & Id,
bool HasTrailingLParen,
bool IsAddressOfOperand,
CorrectionCandidateCallback * CCC = nullptr,
bool IsInlineAsmIdentifier = false,
Token * KeywordReplacement = nullptr )

Definition at line 2723 of file SemaExpr.cpp.

References ActOnDependentIdExpression(), clang::LookupResult::addDecl(), BuildDeclarationNameExpr(), BuildDeclRefExpr(), BuildPossibleImplicitMemberExpr(), BuildTemplateIdExpr(), clang::LookupResult::clear(), Context, clang::CPlusPlus, DecomposeUnqualifiedId(), DiagnoseEmptyLookup(), clang::LookupResult::empty(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::DeclarationName::getAsIdentifierInfo(), clang::LookupResult::getAsSingle(), getCurMethodDecl(), clang::LookupResult::getFoundDecl(), clang::UnqualifiedId::getKind(), getLangOpts(), clang::DeclarationNameInfo::getLoc(), clang::DeclarationNameInfo::getName(), clang::CXXScopeSpec::getScopeRep(), clang::IK_ImplicitSelfParam, clang::IK_TemplateId, ImplicitlyDefineFunction(), clang::CorrectionCandidateCallback::IsAddressOfOperand, clang::LookupResult::isAmbiguous(), isAttrContext(), clang::Scope::isClassScope(), clang::IdentifierInfo::isEditorPlaceholder(), clang::CXXScopeSpec::isEmpty(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::CXXScopeSpec::isInvalid(), isPotentialImplicitMemberAccess(), clang::CXXScopeSpec::isSet(), clang::CXXScopeSpec::isValid(), clang::SourceLocation::isValid(), clang::TemplateIdAnnotation::Kind, LookupMemberName, LookupName(), LookupObjCImplicitSelfParam, LookupOrdinaryName, LookupParsedName(), LookupTemplateName(), ObjC(), recoverFromMSUnqualifiedLookup(), clang::CorrectionCandidateCallback::setTypoName(), clang::CorrectionCandidateCallback::setTypoNNS(), clang::UnqualifiedId::TemplateId, clang::TNK_Concept_template, clang::TNK_Var_template, clang::ast_matchers::type, UseArgumentDependentLookup(), clang::VK_LValue, and clang::LookupResult::wasNotFoundInCurrentInstantiation().

Referenced by DefaultVariadicArgumentPromotion(), and LookupInlineAsmIdentifier().

◆ ActOnIfStmt()

◆ ActOnIndirectGotoStmt()

◆ ActOnInitializerError()

void Sema::ActOnInitializerError ( Decl * Dcl)

ActOnInitializerError - Given that there was an error parsing an initializer for the given declaration, try to at least re-establish invariants such as whether a variable's type is either dependent or complete.

Definition at line 14326 of file SemaDecl.cpp.

References AbstractVariableType, Context, clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::Type::isDependentType(), clang::Decl::isInvalidDecl(), clang::Type::isUndeducedType(), RequireCompleteType(), RequireNonAbstractType(), and clang::Decl::setInvalidDecl().

Referenced by ActOnCXXForRangeStmt().

◆ ActOnInitList()

◆ ActOnIntegerConstant()

◆ ActOnLabelStmt()

◆ ActOnLambdaClosureParameters()

◆ ActOnLambdaClosureQualifiers()

◆ ActOnLambdaError()

void Sema::ActOnLambdaError ( SourceLocation StartLoc,
Scope * CurScope,
bool IsInstantiation = false )

ActOnLambdaError - If there is an error parsing a lambda, this callback is invoked to pop the information about the lambda.

Definition at line 1584 of file SemaLambda.cpp.

References ActOnFields(), clang::cast(), CheckCompletedCXXClass(), clang::Class, DiscardCleanupsInEvaluationContext(), FunctionScopes, clang::sema::LambdaScopeInfo::Lambda, PopDeclContext(), PopExpressionEvaluationContext(), and PopFunctionScopeInfo().

◆ ActOnLambdaExplicitTemplateParameterList()

void Sema::ActOnLambdaExplicitTemplateParameterList ( LambdaIntroducer & Intro,
SourceLocation LAngleLoc,
ArrayRef< NamedDecl * > TParams,
SourceLocation RAngleLoc,
ExprResult RequiresClause )

◆ ActOnLambdaExpr()

ExprResult Sema::ActOnLambdaExpr ( SourceLocation StartLoc,
Stmt * Body )

ActOnLambdaExpr - This is called when the body of a lambda expression was successfully completed.

Definition at line 1975 of file SemaLambda.cpp.

References ActOnFinishFunctionBody(), BuildLambdaExpr(), clang::sema::LambdaScopeInfo::CallOperator, clang::cast(), clang::SemaSYCL::CheckSYCLEntryPointFunctionDecl(), FunctionScopes, clang::Stmt::getEndLoc(), clang::Decl::hasAttr(), and SYCL().

◆ ActOnLambdaExpressionAfterIntroducer()

void Sema::ActOnLambdaExpressionAfterIntroducer ( LambdaIntroducer & Intro,
Scope * CurContext )

Once the Lambdas capture are known, we can start to create the closure, call operator method, and keep track of the captures.

We do the capture lookup here, but they are not actually captured until after we know what the qualifiers of the call operator are.

Definition at line 1084 of file SemaLambda.cpp.

References addInitCapture(), clang::sema::LambdaScopeInfo::AfterParameterList, clang::C, clang::VarDecl::CallInit, clang::sema::LambdaScopeInfo::CallOperator, clang::sema::LambdaScopeInfo::CaptureDefaultLoc, clang::LambdaIntroducer::Captures, clang::sema::CapturingScopeInfo::Captures, clang::cast(), CheckCXXThisCapture(), CheckShadow(), clang::VarDecl::CInit, clang::Class, clang::sema::CapturingScopeInfo::ContainsUnexpandedParameterPack, clang::CopyInit, clang::CPlusPlus14, clang::CPlusPlus17, clang::CPlusPlus20, CreateLambdaCallOperator(), createLambdaClosureType(), createLambdaInitCaptureVarDecl(), clang::FixItHint::CreateRemoval(), CurContext, clang::Scope::decls(), clang::LambdaIntroducer::Default, clang::LambdaIntroducer::DefaultLoc, clang::SemaBase::Diag(), DiagnoseEmptyLookup(), DiagnoseUnexpandedParameterPack(), DiagnoseUseOfDecl(), DiagPlaceholderVariableDefinition(), clang::DirectInit, clang::LookupResult::empty(), clang::ExplicitByRef, clang::ExplicitByVal, clang::sema::LambdaScopeInfo::ExplicitCaptureRanges, finishLambdaExplicitCaptures(), clang::LookupResult::getAsSingle(), clang::SourceRange::getBegin(), getCurLambda(), getCurrentThisType(), clang::sema::CapturingScopeInfo::getCXXThisCapture(), clang::Scope::getEntity(), getLangOpts(), clang::Decl::getLocation(), clang::sema::Capture::getLocation(), getLocForEndOfToken(), clang::Scope::getParent(), clang::ValueDecl::getPotentiallyDecomposedVarDecl(), clang::VarDecl::hasLocalStorage(), clang::sema::CapturingScopeInfo::ImpCaptureStyle, clang::sema::LambdaScopeInfo::IntroducerRange, clang::LookupResult::isAmbiguous(), clang::sema::CapturingScopeInfo::isCXXThisCaptured(), clang::Scope::isFunctionDeclarationScope(), clang::ValueDecl::isInitCapture(), clang::Decl::isInvalidDecl(), clang::QualType::isNull(), clang::ValueDecl::isParameterPack(), clang::NamedDecl::isPlaceholderVar(), clang::DeclContext::isRequiresExprBody(), clang::sema::LambdaScopeInfo::Lambda, clang::LCD_ByCopy, clang::LCD_ByRef, clang::LCD_None, clang::LCK_ByCopy, clang::LCK_ByRef, clang::LCK_StarThis, clang::LCK_This, clang::CXXRecordDecl::LDK_AlwaysDependent, clang::CXXRecordDecl::LDK_Unknown, clang::ListInit, clang::VarDecl::ListInit, LookupName(), LookupOrdinaryName, clang::Method, clang::NoInit, clang::InventedTemplateParameterInfo::NumExplicitTemplateParams, PopDeclContext(), PushDeclContext(), PushOnScopeChains(), clang::LambdaIntroducer::Range, clang::Decl::setInvalidDecl(), tryCaptureVariable(), UPPC_Initializer, and V.

◆ actOnLambdaInitCaptureInitialization()

ParsedType clang::Sema::actOnLambdaInitCaptureInitialization ( SourceLocation Loc,
bool ByRef,
SourceLocation EllipsisLoc,
IdentifierInfo * Id,
LambdaCaptureInitKind InitKind,
Expr *& Init )
inline

Perform initialization analysis of the init-capture and perform any implicit conversions such as an lvalue-to-rvalue conversion if not being used to initialize a reference.

Definition at line 9134 of file Sema.h.

References buildLambdaInitCaptureInitialization(), clang::CopyInit, clang::Init, and clang::OpaquePtr< QualType >::make().

◆ ActOnLastBitfield()

void Sema::ActOnLastBitfield ( SourceLocation DeclStart,
SmallVectorImpl< Decl * > & AllIvarDecls )

ActOnLastBitfield - This routine handles synthesized bitfields rules for class and class extensions.

For every class @interface and class extension @interface, if the last ivar is a bitfield of any type, then add an implicit char :0 ivar to the end of that interface.

Definition at line 19438 of file SemaDecl.cpp.

References clang::APValue, clang::cast(), Context, clang::ConstantExpr::Create(), clang::IntegerLiteral::Create(), clang::ObjCIvarDecl::Create(), CurContext, clang::FieldDecl::isBitField(), clang::FieldDecl::isZeroLengthBitField(), LangOpts, clang::ObjCIvarDecl::Private, and clang::Zero.

◆ ActOnMemberAccessExpr()

ExprResult Sema::ActOnMemberAccessExpr ( Scope * S,
Expr * Base,
SourceLocation OpLoc,
tok::TokenKind OpKind,
CXXScopeSpec & SS,
SourceLocation TemplateKWLoc,
UnqualifiedId & Member,
Decl * ObjCImpDecl )

The main callback when the parser finds something like expression .

[nested-name-specifier] identifier expression -> [nested-name-specifier] identifier where 'identifier' encompasses a fairly broad spectrum of possibilities, including destructor and operator references.

Parameters
OpKindeither tok::arrow or tok::period
ObjCImpDeclthe current Objective-C @implementation decl; this is an ugly hack around the fact that Objective-C @implementations aren't properly put in the context chain

Definition at line 1686 of file SemaExprMember.cpp.

References BuildMemberReferenceExpr(), clang::cast(), DecomposeUnqualifiedId(), clang::SemaBase::Diag(), clang::ExprError(), FindFirstQualifierInScope(), clang::ActionResult< PtrTy, Compress >::get(), clang::SourceRange::getBegin(), clang::UnqualifiedId::getKind(), getLangOpts(), clang::CXXScopeSpec::getScopeRep(), clang::UnqualifiedId::getSourceRange(), HLSL(), clang::IK_ConstructorName, clang::isa(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::CXXScopeSpec::isSet(), MaybeConvertParenListExprToParenExpr(), and clang::Result.

Referenced by BuildMemberReferenceExpr(), and BuiltinInvoke().

◆ ActOnMemInitializer() [1/2]

MemInitResult Sema::ActOnMemInitializer ( Decl * ConstructorD,
Scope * S,
CXXScopeSpec & SS,
IdentifierInfo * MemberOrBase,
ParsedType TemplateTypeTy,
const DeclSpec & DS,
SourceLocation IdLoc,
Expr * InitList,
SourceLocation EllipsisLoc )

Handle a C++ member initializer using braced-init-list syntax.

Definition at line 4274 of file SemaDeclCXX.cpp.

References BuildMemInitializer().

◆ ActOnMemInitializer() [2/2]

MemInitResult Sema::ActOnMemInitializer ( Decl * ConstructorD,
Scope * S,
CXXScopeSpec & SS,
IdentifierInfo * MemberOrBase,
ParsedType TemplateTypeTy,
const DeclSpec & DS,
SourceLocation IdLoc,
SourceLocation LParenLoc,
ArrayRef< Expr * > Args,
SourceLocation RParenLoc,
SourceLocation EllipsisLoc )

Handle a C++ member initializer using parentheses syntax.

Definition at line 4289 of file SemaDeclCXX.cpp.

References BuildMemInitializer(), Context, and clang::ParenListExpr::Create().

◆ ActOnMemInitializers()

void Sema::ActOnMemInitializers ( Decl * ConstructorDecl,
SourceLocation ColonLoc,
ArrayRef< CXXCtorInitializer * > MemInits,
bool AnyErrors )

ActOnMemInitializers - Handle the member initializers for a constructor.

Definition at line 5858 of file SemaDeclCXX.cpp.

References AdjustDeclIfTemplate(), clang::Constructor, Context, Diag(), DiagnoseBaseOrMemInitializerOrder(), GetKeyForMember(), clang::Init, SetCtorInitializers(), and SetDelegatingInitializer().

Referenced by InstantiateMemInitializers().

◆ ActOnModuleDecl()

◆ ActOnModuleImport() [1/2]

◆ ActOnModuleImport() [2/2]

DeclResult Sema::ActOnModuleImport ( SourceLocation StartLoc,
SourceLocation ExportLoc,
SourceLocation ImportLoc,
ModuleIdPath Path,
bool IsPartition = false )

The parser has processed a module import declaration.

Parameters
StartLocThe location of the first token in the declaration. This could be the location of an '@', 'export', or 'import'.
ExportLocThe location of the 'export' keyword, if any.
ImportLocThe location of the 'import' keyword.
PathThe module toplevel name as an access path.
IsPartitionIf the name is for a partition.

Definition at line 563 of file SemaModule.cpp.

References ActOnModuleImport(), clang::Module::AllVisible, currentModuleIsImplementation(), clang::SemaBase::Diag(), getCurrentModule(), clang::ModuleLoader::getFlatNameFromPath(), getLangOpts(), getModuleLoader(), clang::Module::getPrimaryModuleInterfaceName(), clang::Module::isInterfaceOrPartition(), clang::ModuleLoader::loadModule(), clang::Module::Module(), ObjC(), and PP.

Referenced by ActOnModuleImport().

◆ ActOnMSAsmStmt()

◆ ActOnMSDependentExistsStmt()

StmtResult Sema::ActOnMSDependentExistsStmt ( SourceLocation KeywordLoc,
bool IsIfExists,
CXXScopeSpec & SS,
UnqualifiedId & Name,
Stmt * Nested )

◆ ActOnMSVCUnknownTypeName()

ParsedType Sema::ActOnMSVCUnknownTypeName ( const IdentifierInfo & II,
SourceLocation NameLoc,
bool IsTemplateTypeArg )

Attempt to behave like MSVC in situations where lookup of an unqualified type name has failed in a dependent context.

In these situations, we automatically form a DependentTypeName that will retry lookup in a related scope during instantiation.

Definition at line 627 of file SemaDecl.cpp.

References Context, CreateParsedType(), CurContext, clang::SemaBase::Diag(), findRecordWithDependentBasesOfEnclosingMethod(), getCurScope(), getLangOpts(), clang::NestedNameSpecifierLocBuilder::getWithLocInContext(), clang::NestedNameSpecifierLocBuilder::MakeTrivial(), clang::None, clang::DependentNameTypeLoc::setElaboratedKeywordLoc(), clang::DependentNameTypeLoc::setNameLoc(), clang::DependentNameTypeLoc::setQualifierLoc(), synthesizeCurrentNestedNameSpecifier(), and clang::T.

◆ ActOnNameClassifiedAsDependentNonType()

ExprResult Sema::ActOnNameClassifiedAsDependentNonType ( const CXXScopeSpec & SS,
IdentifierInfo * Name,
SourceLocation NameLoc,
bool IsAddressOfOperand )

Act on the result of classifying a name as an undeclared member of a dependent base class.

Definition at line 1299 of file SemaDecl.cpp.

References ActOnDependentIdExpression().

◆ ActOnNameClassifiedAsNonType()

ExprResult Sema::ActOnNameClassifiedAsNonType ( Scope * S,
const CXXScopeSpec & SS,
NamedDecl * Found,
SourceLocation NameLoc,
const Token & NextToken )

◆ ActOnNameClassifiedAsOverloadSet()

ExprResult Sema::ActOnNameClassifiedAsOverloadSet ( Scope * S,
Expr * OverloadSet )

Act on the result of classifying a name as an overload set.

Definition at line 1326 of file SemaDecl.cpp.

References clang::CXXScopeSpec::Adopt(), BuildPossibleImplicitMemberExpr(), clang::cast(), LookupOrdinaryName, and clang::Result.

◆ ActOnNameClassifiedAsUndeclaredNonType()

ExprResult Sema::ActOnNameClassifiedAsUndeclaredNonType ( IdentifierInfo * Name,
SourceLocation NameLoc )

Act on the result of classifying a name as an undeclared (ADL-only) non-type declaration.

Definition at line 1290 of file SemaDecl.cpp.

References BuildDeclarationNameExpr(), clang::CPlusPlus, getLangOpts(), LookupOrdinaryName, and clang::Result.

◆ ActOnNamespaceAliasDef()

◆ ActOnNestedRequirement()

concepts::Requirement * Sema::ActOnNestedRequirement ( Expr * Constraint)

Definition at line 7964 of file SemaExprCXX.cpp.

References BuildNestedRequirement().

◆ ActOnNoexceptExpr()

ExprResult Sema::ActOnNoexceptExpr ( SourceLocation KeyLoc,
SourceLocation LParen,
Expr * Operand,
SourceLocation RParen )

Definition at line 7393 of file SemaExprCXX.cpp.

References BuildCXXNoexceptExpr().

◆ ActOnNoexceptSpec()

◆ ActOnNonTypeTemplateParameter()

NamedDecl * Sema::ActOnNonTypeTemplateParameter ( Scope * S,
Declarator & D,
unsigned Depth,
unsigned Position,
SourceLocation EqualLoc,
Expr * DefaultArg )

Definition at line 1516 of file SemaTemplate.cpp.

References clang::Scope::AddDecl(), clang::AS_public, AttachTypeConstraint(), CheckFunctionOrTemplateParamDeclarator(), CheckNonTypeTemplateParameterType(), Context, clang::NonTypeTemplateParmDecl::Create(), clang::FixItHint::CreateRemoval(), Default, clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), clang::Declarator::getBeginLoc(), clang::DeclSpec::getConstexprSpecLoc(), clang::Type::getContainedAutoType(), clang::TypeLoc::getContainedAutoTypeLoc(), clang::Type::getContainedDeducedType(), clang::Declarator::getDeclSpec(), clang::Declarator::getEllipsisLoc(), getEnclosingLambdaOrBlock(), clang::DeclSpec::getExplicitSpecLoc(), clang::Declarator::getIdentifier(), clang::Declarator::getIdentifierLoc(), clang::DeclSpec::getInlineSpecLoc(), clang::DeclSpec::getNoreturnSpecLoc(), clang::DeclSpec::getStorageClassSpec(), clang::DeclSpec::getStorageClassSpecLoc(), clang::DeclSpec::getThreadStorageClassSpec(), clang::DeclSpec::getThreadStorageClassSpecLoc(), getTrivialTemplateArgumentLoc(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclSpec::getVirtualSpecLoc(), clang::DeclSpec::hasConstexprSpecifier(), clang::Declarator::hasEllipsis(), clang::DeclSpec::hasExplicitSpecifier(), IdResolver, clang::Invalid, clang::isa(), clang::DeclSpec::isInlineSpecified(), clang::SourceLocation::isInvalid(), clang::DeclSpec::isNoreturnSpecified(), clang::Scope::isTemplateParamScope(), clang::DeclSpec::isVirtualSpecified(), maybeDiagnoseTemplateParameterShadow(), clang::DeclSpec::SCS_unspecified, clang::T, clang::TSCS_unspecified, UPPC_DefaultArgument, and UPPC_TypeConstraint.

◆ ActOnNullStmt()

StmtResult Sema::ActOnNullStmt ( SourceLocation SemiLoc,
bool HasLeadingEmptyMacro = false )

Definition at line 70 of file SemaStmt.cpp.

References Context.

◆ ActOnNumericConstant()

◆ ActOnPackExpansion() [1/3]

◆ ActOnPackExpansion() [2/3]

ExprResult Sema::ActOnPackExpansion ( Expr * Pattern,
SourceLocation EllipsisLoc )

Invoked when parsing an expression followed by an ellipsis, which creates a pack expansion.

Parameters
PatternThe expression preceding the ellipsis, which will become the pattern of the pack expansion.
EllipsisLocThe location of the ellipsis.

Definition at line 819 of file SemaTemplateVariadic.cpp.

References CheckPackExpansion().

◆ ActOnPackExpansion() [3/3]

TypeResult Sema::ActOnPackExpansion ( ParsedType Type,
SourceLocation EllipsisLoc )

Invoked when parsing a type followed by an ellipsis, which creates a pack expansion.

Parameters
TypeThe type preceding the ellipsis, which will become the pattern of the pack expansion.
EllipsisLocThe location of the ellipsis.

Definition at line 765 of file SemaTemplateVariadic.cpp.

References CheckPackExpansion(), CreateParsedType(), clang::TypeSourceInfo::getType(), and GetTypeFromParser().

◆ ActOnPackIndexingExpr()

◆ ActOnPackIndexingType()

QualType Sema::ActOnPackIndexingType ( QualType Pattern,
Expr * IndexExpr,
SourceLocation Loc,
SourceLocation EllipsisLoc )

◆ ActOnParamDeclarator()

Decl * Sema::ActOnParamDeclarator ( Scope * S,
Declarator & D,
SourceLocation ExplicitThisLoc = {} )

ActOnParamDeclarator - Called from Parser::ParseFunctionDeclarator() to introduce parameters into function prototype scope.

Definition at line 15576 of file SemaDecl.cpp.

References clang::Scope::AddDecl(), clang::LookupResult::begin(), CheckExplicitObjectParameter(), CheckFunctionOrTemplateParamDeclarator(), CheckParameter(), clang::DeclSpec::ClearStorageClassSpecs(), Context, clang::CPlusPlus, clang::CPlusPlus11, clang::CPlusPlus17, clang::FixItHint::CreateRemoval(), deduceOpenCLAddressSpace(), clang::SemaBase::Diag(), DiagnoseFunctionSpecifiers(), DiagnoseTemplateParameterShadow(), clang::LookupResult::empty(), ForVisibleRedeclaration, clang::Declarator::getBeginLoc(), clang::DeclSpec::getConstexprSpecLoc(), clang::Declarator::getDeclSpec(), clang::Scope::getFunctionPrototypeDepth(), clang::Declarator::getIdentifier(), clang::Declarator::getIdentifierLoc(), clang::DeclSpec::getInlineSpecLoc(), getLangOpts(), clang::Decl::getLocation(), clang::DeclSpec::getModulePrivateSpecLoc(), clang::Declarator::getMutableDeclSpec(), clang::Scope::getNextFunctionPrototypeIndex(), clang::Declarator::getNumTypeObjects(), clang::DeclSpec::getSpecifierName(), clang::DeclSpec::getStorageClassSpec(), clang::DeclSpec::getStorageClassSpecLoc(), clang::DeclSpec::getThreadStorageClassSpec(), clang::DeclSpec::getThreadStorageClassSpecLoc(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), clang::DeclSpec::getTypeSpecType(), clang::DeclSpec::hasConstexprSpecifier(), HLSL(), IdResolver, clang::Scope::isDeclScope(), clang::Scope::isFunctionPrototypeScope(), clang::Type::isHLSLResourceRecordArray(), clang::Type::isIncompleteArrayType(), clang::DeclSpec::isInlineSpecified(), clang::Declarator::isInvalidType(), clang::DeclSpec::isModulePrivateSpecified(), clang::LookupResult::isSingleResult(), clang::Decl::isTemplateParameter(), LookupName(), LookupOrdinaryName, New, OpenCL(), ProcessDeclAttributes(), clang::SC_Auto, clang::SC_None, clang::SC_Register, clang::DeclSpec::SCS_auto, clang::DeclSpec::SCS_register, clang::DeclSpec::SCS_unspecified, clang::Declarator::SetIdentifier(), clang::Declarator::setInvalidType(), clang::DeclSpec::TST_void, and warnOnCTypeHiddenInCPlusPlus().

Referenced by ActOnFinishKNRParamDeclarations().

◆ ActOnParamDefaultArgument()

void Sema::ActOnParamDefaultArgument ( Decl * param,
SourceLocation EqualLoc,
Expr * defarg )

ActOnParamDefaultArgument - Check whether the default argument provided for a function parameter is well-formed.

If so, attach it to the parameter declaration.

Definition at line 328 of file SemaDeclCXX.cpp.

References ActOnParamDefaultArgumentError(), clang::cast(), ConvertParamDefaultArgument(), clang::CPlusPlus, Diag(), DiagnoseUnexpandedParameterPack(), getLangOpts(), clang::Stmt::getSourceRange(), clang::Result, SetParamDefaultArgument(), UnparsedDefaultArgLocs, and UPPC_DefaultArgument.

◆ ActOnParamDefaultArgumentError()

void Sema::ActOnParamDefaultArgumentError ( Decl * param,
SourceLocation EqualLoc,
Expr * DefaultArg )

ActOnParamDefaultArgumentError - Parsing or semantic analysis of the default argument for the parameter param failed.

Definition at line 383 of file SemaDeclCXX.cpp.

References clang::cast(), CreateRecoveryExpr(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getEndLoc(), and UnparsedDefaultArgLocs.

Referenced by ActOnParamDefaultArgument().

◆ ActOnParamUnparsedDefaultArgument()

void Sema::ActOnParamUnparsedDefaultArgument ( Decl * param,
SourceLocation EqualLoc,
SourceLocation ArgLoc )

ActOnParamUnparsedDefaultArgument - We've seen a default argument for a function parameter, but we can't parse it yet because we're inside a class definition.

Note that this default argument will be parsed later.

Definition at line 372 of file SemaDeclCXX.cpp.

References clang::cast(), and UnparsedDefaultArgLocs.

◆ ActOnParenExpr()

◆ ActOnParenListExpr()

◆ ActOnPopScope()

void Sema::ActOnPopScope ( SourceLocation Loc,
Scope * S )

◆ ActOnPostfixUnaryOp()

ExprResult Sema::ActOnPostfixUnaryOp ( Scope * S,
SourceLocation OpLoc,
tok::TokenKind Kind,
Expr * Input )

◆ ActOnPragmaAttributeAttribute()

void Sema::ActOnPragmaAttributeAttribute ( ParsedAttr & Attribute,
SourceLocation PragmaLoc,
attr::ParsedSubjectMatchRuleSet Rules )

◆ ActOnPragmaAttributeEmptyPush()

void Sema::ActOnPragmaAttributeEmptyPush ( SourceLocation PragmaLoc,
const IdentifierInfo * Namespace )

Definition at line 1151 of file SemaAttr.cpp.

References PragmaAttributeStack.

◆ ActOnPragmaAttributePop()

void Sema::ActOnPragmaAttributePop ( SourceLocation PragmaLoc,
const IdentifierInfo * Namespace )

Called on well-formed '#pragma clang attribute pop'.

Definition at line 1158 of file SemaAttr.cpp.

References clang::SemaBase::Diag(), and PragmaAttributeStack.

◆ ActOnPragmaClangSection()

◆ ActOnPragmaCXLimitedRange()

void Sema::ActOnPragmaCXLimitedRange ( SourceLocation Loc,
LangOptions::ComplexRangeKind Range )

ActOnPragmaCXLimitedRange - Called on well formed #pragma STDC CX_LIMITED_RANGE.

Definition at line 1527 of file SemaAttr.cpp.

References clang::FPOptionsOverride::applyOverrides(), CurFPFeatureOverrides(), CurFPFeatures, FpPragmaStack, getLangOpts(), and PSK_Set.

◆ ActOnPragmaDetectMismatch()

void Sema::ActOnPragmaDetectMismatch ( SourceLocation Loc,
StringRef Name,
StringRef Value )

ActOnPragmaDetectMismatch - Call on well-formed #pragma detect_mismatch.

Definition at line 628 of file SemaAttr.cpp.

References Consumer, Context, and clang::PragmaDetectMismatchDecl::Create().

◆ ActOnPragmaDump() [1/2]

void Sema::ActOnPragmaDump ( Expr * E)

Called on #pragma clang __debug dump E.

Definition at line 5842 of file SemaLookup.cpp.

References clang::Stmt::dump().

◆ ActOnPragmaDump() [2/2]

void Sema::ActOnPragmaDump ( Scope * S,
SourceLocation Loc,
IdentifierInfo * II )

◆ ActOnPragmaExport()

void Sema::ActOnPragmaExport ( IdentifierInfo * IdentId,
SourceLocation ExportNameLoc,
Scope * curScope )

◆ ActOnPragmaFEnvAccess()

void Sema::ActOnPragmaFEnvAccess ( SourceLocation Loc,
bool IsEnabled )

ActOnPragmaFenvAccess - Called on well formed #pragma STDC FENV_ACCESS.

Definition at line 1511 of file SemaAttr.cpp.

References clang::FPOptionsOverride::applyOverrides(), CurFPFeatureOverrides(), CurFPFeatures, clang::SemaBase::Diag(), FpPragmaStack, getLangOpts(), isPreciseFPEnabled(), and PSK_Set.

◆ ActOnPragmaFEnvRound()

void Sema::ActOnPragmaFEnvRound ( SourceLocation Loc,
llvm::RoundingMode FPR )

Called to set constant rounding mode for floating point operations.

Definition at line 1496 of file SemaAttr.cpp.

References clang::FPOptionsOverride::applyOverrides(), CurFPFeatureOverrides(), CurFPFeatures, FpPragmaStack, getLangOpts(), and PSK_Set.

◆ ActOnPragmaFloatControl()

◆ ActOnPragmaFPContract()

◆ ActOnPragmaFPEvalMethod()

◆ ActOnPragmaFPExceptions()

void Sema::ActOnPragmaFPExceptions ( SourceLocation Loc,
LangOptions::FPExceptionModeKind FPE )

Called on well formed '#pragma clang fp' that has option 'exceptions'.

Definition at line 1535 of file SemaAttr.cpp.

References setExceptionMode().

◆ ActOnPragmaFPValueChangingOption()

void Sema::ActOnPragmaFPValueChangingOption ( SourceLocation Loc,
PragmaFPKind Kind,
bool IsEnabled )

◆ ActOnPragmaMSAllocText()

void Sema::ActOnPragmaMSAllocText ( SourceLocation PragmaLocation,
StringRef Section,
const SmallVector< std::tuple< IdentifierInfo *, SourceLocation > > & Functions )

◆ ActOnPragmaMSComment()

void Sema::ActOnPragmaMSComment ( SourceLocation CommentLoc,
PragmaMSCommentKind Kind,
StringRef Arg )

ActOnPragmaMSComment - Called on well formed #pragma comment(kind, "arg").

Definition at line 620 of file SemaAttr.cpp.

References Consumer, Context, and clang::PragmaCommentDecl::Create().

◆ ActOnPragmaMSFunction()

void Sema::ActOnPragmaMSFunction ( SourceLocation Loc,
const llvm::SmallVectorImpl< StringRef > & NoBuiltins )

Call on well formed #pragma function.

Definition at line 1267 of file SemaAttr.cpp.

References CurContext, clang::SemaBase::Diag(), and MSFunctionNoBuiltins.

◆ ActOnPragmaMSInitSeg()

void Sema::ActOnPragmaMSInitSeg ( SourceLocation PragmaLocation,
StringLiteral * SegmentName )

Called on well-formed #pragma init_seg().

Definition at line 890 of file SemaAttr.cpp.

References CurInitSeg, CurInitSegLoc, clang::StringLiteral::getString(), and clang::nullptr.

◆ ActOnPragmaMSOptimize()

void Sema::ActOnPragmaMSOptimize ( SourceLocation Loc,
bool IsOn )

#pragma optimize("[optimization-list]", on | off).

Definition at line 1258 of file SemaAttr.cpp.

References CurContext, clang::SemaBase::Diag(), and MSPragmaOptimizeIsOn.

◆ ActOnPragmaMSPointersToMembers()

void Sema::ActOnPragmaMSPointersToMembers ( LangOptions::PragmaMSPointersToMembersKind Kind,
SourceLocation PragmaLoc )

ActOnPragmaMSPointersToMembers - called on well formed #pragma pointers_to_members(representation method[, general purpose representation]).

Definition at line 717 of file SemaAttr.cpp.

References ImplicitMSInheritanceAttrLoc, and MSPointerToMemberRepresentationMethod.

◆ ActOnPragmaMSSection()

void Sema::ActOnPragmaMSSection ( SourceLocation PragmaLocation,
int SectionFlags,
StringLiteral * SegmentName )

Called on well formed #pragma section().

Called on well formed #pragma bss_seg().

Definition at line 885 of file SemaAttr.cpp.

References clang::StringLiteral::getString(), and UnifySection().

◆ ActOnPragmaMSSeg()

void Sema::ActOnPragmaMSSeg ( SourceLocation PragmaLocation,
PragmaMsStackAction Action,
llvm::StringRef StackSlotLabel,
StringLiteral * SegmentName,
llvm::StringRef PragmaName )

◆ ActOnPragmaMSStrictGuardStackCheck()

void Sema::ActOnPragmaMSStrictGuardStackCheck ( SourceLocation PragmaLocation,
PragmaMsStackAction Action,
bool Value )

ActOnPragmaMSStrictGuardStackCheck - Called on well formed #pragma strict_gs_check.

Called on well formed #pragma strict_gs_check().

Definition at line 874 of file SemaAttr.cpp.

References clang::SemaBase::Diag(), PSK_Pop, and StrictGuardStackCheckStack.

◆ ActOnPragmaMSStruct()

void Sema::ActOnPragmaMSStruct ( PragmaMSStructKind Kind)

ActOnPragmaMSStruct - Called on well formed #pragma ms_struct [on|off].

Definition at line 616 of file SemaAttr.cpp.

References MSStructPragmaOn, and clang::PMSST_ON.

◆ ActOnPragmaMSVtorDisp()

void Sema::ActOnPragmaMSVtorDisp ( PragmaMsStackAction Action,
SourceLocation PragmaLoc,
MSVtorDispMode Value )

Called on well formed #pragma vtordisp().

Definition at line 724 of file SemaAttr.cpp.

References clang::SemaBase::Diag(), PSK_Pop, and VtorDispStack.

◆ ActOnPragmaOptimize()

void Sema::ActOnPragmaOptimize ( bool On,
SourceLocation PragmaLoc )

Called on well formed #pragma clang optimize.

Definition at line 1251 of file SemaAttr.cpp.

References OptimizeOffPragmaLocation.

◆ ActOnPragmaOptionsAlign()

◆ ActOnPragmaPack()

◆ ActOnPragmaRedefineExtname()

void Sema::ActOnPragmaRedefineExtname ( IdentifierInfo * WeakName,
IdentifierInfo * AliasName,
SourceLocation PragmaLoc,
SourceLocation WeakNameLoc,
SourceLocation AliasNameLoc )

◆ ActOnPragmaUnused()

void Sema::ActOnPragmaUnused ( const Token & Identifier,
Scope * curScope,
SourceLocation PragmaLoc )

◆ ActOnPragmaVisibility()

void Sema::ActOnPragmaVisibility ( const IdentifierInfo * VisType,
SourceLocation PragmaLoc )

ActOnPragmaVisibility - Called on well formed #pragma GCC visibility... .

Definition at line 1426 of file SemaAttr.cpp.

References clang::SemaBase::Diag(), clang::IdentifierInfo::getName(), PopPragmaVisibility(), PushPragmaVisibility(), and clang::T.

◆ ActOnPragmaWeakAlias()

void Sema::ActOnPragmaWeakAlias ( IdentifierInfo * WeakName,
IdentifierInfo * AliasName,
SourceLocation PragmaLoc,
SourceLocation WeakNameLoc,
SourceLocation AliasNameLoc )

ActOnPragmaWeakAlias - Called on well formed #pragma weak ident = ident.

Definition at line 21002 of file SemaDecl.cpp.

References DeclApplyPragmaWeak(), clang::Decl::hasAttr(), clang::isa(), LookupOrdinaryName, LookupSingleName(), TUScope, and WeakUndeclaredIdentifiers.

◆ ActOnPragmaWeakID()

void Sema::ActOnPragmaWeakID ( IdentifierInfo * WeakName,
SourceLocation PragmaLoc,
SourceLocation WeakNameLoc )

ActOnPragmaWeakID - Called on well formed #pragma weak ident.

Definition at line 20990 of file SemaDecl.cpp.

References clang::Decl::addAttr(), Context, LookupOrdinaryName, LookupSingleName(), TUScope, and WeakUndeclaredIdentifiers.

◆ ActOnPredefinedExpr()

ExprResult Sema::ActOnPredefinedExpr ( SourceLocation Loc,
tok::TokenKind Kind )

Definition at line 3574 of file SemaExpr.cpp.

References BuildPredefinedExpr(), and getPredefinedExprKind().

◆ ActOnPrivateModuleFragmentDecl()

Sema::DeclGroupPtrTy Sema::ActOnPrivateModuleFragmentDecl ( SourceLocation ModuleLoc,
SourceLocation PrivateLoc )

The parser has processed a private-module-fragment declaration that begins the definition of the private module fragment of the current module unit.

Parameters
ModuleLocThe location of the 'module' keyword.
PrivateLocThe location of the 'private' keyword.

Definition at line 501 of file SemaModule.cpp.

References ActOnEndOfTranslationUnitFragment(), Context, clang::FixItHint::CreateInsertion(), clang::SemaBase::Diag(), clang::Module::ExplicitGlobalModuleFragment, clang::Module::ImplicitGlobalModuleFragment, clang::Module::ModuleHeaderUnit, clang::Module::ModuleImplementationUnit, clang::Module::ModuleInterfaceUnit, clang::Module::ModuleMapModule, clang::Module::ModulePartitionImplementation, clang::Module::ModulePartitionInterface, clang::Decl::ModulePrivate, clang::Normal, PP, and clang::Module::PrivateModuleFragment.

◆ ActOnPseudoDestructorExpr() [1/2]

◆ ActOnPseudoDestructorExpr() [2/2]

◆ ActOnPureSpecifier()

void Sema::ActOnPureSpecifier ( Decl * D,
SourceLocation PureSpecLoc )

◆ ActOnReenterCXXMethodParameter()

void Sema::ActOnReenterCXXMethodParameter ( Scope * S,
ParmVarDecl * Param )

This is used to implement the constant expression evaluation part of the attribute enable_if extension.

There is nothing in standard C++ which would require reentering parameters.

Definition at line 10940 of file SemaDeclCXX.cpp.

References clang::Scope::AddDecl(), and IdResolver.

◆ ActOnReenterFunctionContext()

void Sema::ActOnReenterFunctionContext ( Scope * S,
Decl * D )

◆ ActOnReenterTemplateScope()

◆ ActOnRequiresClause()

◆ ActOnRequiresExpr()

ExprResult Sema::ActOnRequiresExpr ( SourceLocation RequiresKWLoc,
RequiresExprBodyDecl * Body,
SourceLocation LParenLoc,
ArrayRef< ParmVarDecl * > LocalParameters,
SourceLocation RParenLoc,
ArrayRef< concepts::Requirement * > Requirements,
SourceLocation ClosingBraceLoc )

◆ ActOnReturnStmt()

◆ ActOnSEHExceptBlock()

◆ ActOnSEHLeaveStmt()

◆ ActOnSEHTryBlock()

◆ ActOnSimpleRequirement()

concepts::Requirement * Sema::ActOnSimpleRequirement ( Expr * E)

Definition at line 7805 of file SemaExprCXX.cpp.

References BuildExprRequirement().

◆ ActOnSizeofParameterPackExpr()

ExprResult Sema::ActOnSizeofParameterPackExpr ( Scope * S,
SourceLocation OpLoc,
IdentifierInfo & Name,
SourceLocation NameLoc,
SourceLocation RParenLoc )

Called when an expression computing the size of a parameter pack is parsed.

template<typename ...Types> struct count {
static const unsigned value = sizeof...(Types);
};
Parameters
OpLocThe location of the "sizeof" keyword.
NameThe name of the parameter pack whose size will be determined.
NameLocThe source location of the name of the parameter pack.
RParenLocThe location of the closing parentheses.

Definition at line 1273 of file SemaTemplateVariadic.cpp.

References clang::Ambiguous, Context, CorrectTypo(), clang::SizeOfPackExpr::Create(), clang::SemaBase::Diag(), DiagnoseAmbiguousLookup(), diagnoseTypo(), clang::ErrorRecovery, clang::ExprError(), clang::Found, clang::FoundOverloaded, clang::FoundUnresolvedValue, clang::LookupResult::getFoundDecl(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupNameInfo(), clang::LookupResult::getResultKind(), clang::Decl::isParameterPack(), LookupName(), LookupOrdinaryName, MarkAnyDeclReferenced(), clang::NotFound, clang::NotFoundInCurrentInstantiation, and clang::SemaBase::PDiag().

◆ ActOnSkippedFunctionBody()

Decl * Sema::ActOnSkippedFunctionBody ( Decl * Decl)

◆ ActOnSourceLocExpr()

◆ ActOnStartConceptDefinition()

◆ ActOnStartCXXInClassMemberInitializer()

void Sema::ActOnStartCXXInClassMemberInitializer ( )

Enter a new C++ default initializer scope.

After calling this, the caller must call ActOnFinishCXXInClassMemberInitializer, even if parsing or instantiating the initializer failed.

Definition at line 4137 of file SemaDeclCXX.cpp.

References PushFunctionScope().

Referenced by InstantiateInClassInitializer().

◆ ActOnStartCXXMemberDeclarations()

void Sema::ActOnStartCXXMemberDeclarations ( Scope * S,
Decl * TagDecl,
SourceLocation FinalLoc,
bool IsFinalSpelledSealed,
bool IsAbstract,
SourceLocation LBraceLoc )

ActOnStartCXXMemberDeclarations - Invoked when we have parsed a C++ record definition's base-specifiers clause and are starting its member declarations.

Definition at line 18861 of file SemaDecl.cpp.

References AdjustDeclIfTemplate(), clang::AS_public, clang::cast(), Context, clang::CXXRecordDecl::Create(), CurContext, FieldCollector, clang::CXXRecordDecl::isInjectedClassName(), clang::SourceLocation::isValid(), PushOnScopeChains(), clang::Decl::setAccess(), clang::CXXRecordDecl::setDescribedClassTemplate(), clang::Decl::setImplicit(), and clang::Template.

◆ ActOnStartCXXMemberReference()

◆ ActOnStartDelayedCXXMethodDeclaration()

void Sema::ActOnStartDelayedCXXMethodDeclaration ( Scope * S,
Decl * Method )

ActOnStartDelayedCXXMethodDeclaration - We have completed parsing a top-level (non-nested) C++ class, and we are now parsing those parts of the given Method declaration that could not be parsed earlier (C++ [class.mem]p2), such as default arguments.

This action should enter the scope of the given Method declaration as if we had just parsed the qualified method name. However, it should not bring the parameters into scope; that will be performed by ActOnDelayedCXXMethodParameter.

Definition at line 10949 of file SemaDeclCXX.cpp.

◆ ActOnStartDelayedMemberDeclarations()

void Sema::ActOnStartDelayedMemberDeclarations ( Scope * S,
Decl * Record )

Definition at line 10928 of file SemaDeclCXX.cpp.

References AdjustDeclIfTemplate(), clang::cast(), and PushDeclContext().

◆ ActOnStartExportDecl()

◆ ActOnStartFunctionDeclarationDeclarator()

◆ ActOnStartLinkageSpecification()

Decl * Sema::ActOnStartLinkageSpecification ( Scope * S,
SourceLocation ExternLoc,
Expr * LangStr,
SourceLocation LBraceLoc )

ActOnStartLinkageSpecification - Parsed the beginning of a C++ linkage specification, including the language and (if present) the '{'.

ExternLoc is the location of the 'extern', Lang is the language string literal. LBraceLoc, if valid, provides the location of the '{' brace. Otherwise, this linkage specification does not have any braces.

C++ [module.unit]p7.2.3

  • Otherwise, if the declaration
    • ...
    • ...
    • appears within a linkage-specification, it is attached to the global module.

If the declaration is already in global module fragment, we don't need to attach it again.

Definition at line 17203 of file SemaDeclCXX.cpp.

References clang::C, clang::cast(), Context, clang::LinkageSpecDecl::Create(), CurContext, clang::CXX, Diag(), clang::Expr::getExprLoc(), getLangOpts(), clang::Stmt::getSourceRange(), clang::StringLiteral::getString(), clang::StringLiteral::isUnevaluated(), clang::SourceLocation::isValid(), PushDeclContext(), and clang::Decl::setLocalOwningModule().

◆ ActOnStartNamespaceDef()

◆ ActOnStartOfCompoundStmt()

void Sema::ActOnStartOfCompoundStmt ( bool IsStmtExpr)

Definition at line 416 of file SemaStmt.cpp.

References PushCompoundScope().

◆ ActOnStartOfDeferStmt()

void Sema::ActOnStartOfDeferStmt ( SourceLocation DeferLoc,
Scope * CurScope )

Definition at line 3953 of file SemaStmt.cpp.

References CurrentDefer.

◆ ActOnStartOfFunctionDef() [1/2]

Decl * Sema::ActOnStartOfFunctionDef ( Scope * S,
Decl * D,
SkipBodyInfo * SkipBody = nullptr,
FnBodyKind BodyKind = FnBodyKind::Other )

Definition at line 16131 of file SemaDecl.cpp.

References AbstractReturnType, ActOnDocumentableDecl(), applyFunctionAttributesBeforeParsingBody(), clang::cast(), CheckForFunctionRedefinition(), CheckParmsForFunctionDef(), CheckShadow(), Context, currentModuleIsHeaderUnit(), clang::DeclContext::decls(), Default, Delete, clang::SemaBase::Diag(), clang::Decl::dropAttr(), ExprEvalContexts, clang::External, clang::Type::getAs(), clang::Decl::getAttr(), clang::FunctionDecl::getBuiltinID(), getCurLexicalContext(), clang::NamedDecl::getFormalLinkage(), getLangOpts(), clang::Attr::getLocation(), clang::Decl::getLocation(), clang::FunctionDecl::getReturnType(), clang::FunctionDecl::getTemplateSpecializationInfo(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), InstantiateDefaultCtorDefaultArgs(), inTemplateInstantiation(), clang::isa(), clang::Type::isDependentType(), clang::FunctionTemplateSpecializationInfo::isExplicitInstantiationOrSpecialization(), clang::isGenericLambdaCallOperatorSpecialization(), clang::FunctionDecl::isInlined(), clang::Decl::isInvalidDecl(), clang::isLambdaCallOperator(), clang::FunctionDecl::isLateTemplateParsed(), clang::Decl::isTemplated(), clang::FunctionDecl::isTemplateInstantiation(), clang::FunctionDecl::isThisDeclarationADefinition(), clang::FunctionDecl::isThisDeclarationInstantiatedFromAFriendDefinition(), clang::Type::isVoidType(), maybeAddDeclWithEffects(), clang::FunctionDecl::parameters(), PushDeclContext(), PushExpressionEvaluationContext(), PushExpressionEvaluationContextForFunction(), PushFunctionScope(), PushOnScopeChains(), RebuildLambdaScopeInfo(), RequireCompleteType(), RequireNonAbstractType(), ResolveExceptionSpec(), clang::Decl::setInvalidDecl(), clang::FunctionDecl::setWillHaveBody(), clang::SkipBodyInfo::ShouldSkip, clang::TSK_ExplicitSpecialization, and clang::FunctionDecl::willHaveBody().

◆ ActOnStartOfFunctionDef() [2/2]

◆ ActOnStartOfLambdaDefinition()

void Sema::ActOnStartOfLambdaDefinition ( LambdaIntroducer & Intro,
Declarator & ParamInfo,
const DeclSpec & DS )

ActOnStartOfLambdaDefinition - This is called just before we start parsing the body of a lambda; it analyzes the explicit captures and arguments, and sets up various data-structures for the body of the lambda.

Definition at line 1420 of file SemaLambda.cpp.

References clang::SemaOpenMP::ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(), AddRangeBasedOptnone(), ARM(), clang::TemplateParameterList::asArray(), clang::C, clang::sema::LambdaScopeInfo::CallOperator, clang::LambdaIntroducer::Captures, clang::sema::CapturingScopeInfo::Captures, clang::cast(), CheckCXXDefaultArguments(), CheckShadow(), clang::SemaARM::CheckSMEFunctionDefAttributes(), clang::Class, CompleteLambdaCallOperator(), Context, CUDA(), clang::SemaBase::Diag(), clang::sema::LambdaScopeInfo::ExplicitParams, clang::FTIHasSingleVoidParameter(), clang::SourceRange::getBegin(), clang::DeclSpec::getConstexprSpecifier(), getCurrentLambdaScopeUnsafe(), getCurScope(), clang::Declarator::getDeclSpec(), clang::SourceRange::getEnd(), clang::Declarator::getFunctionTypeInfo(), getGenericLambdaTemplateParameterList(), getImplicitCodeSegOrSectionAttrForFunction(), getLambdaType(), getLangOpts(), clang::Declarator::getNumTypeObjects(), clang::Declarator::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::Declarator::getTrailingRequiresClause(), clang::Declarator::getTypeObject(), handleLambdaNumbering(), clang::Declarator::isFunctionDeclarator(), clang::ValueDecl::isInitCapture(), clang::sema::LambdaScopeInfo::Lambda, LangOpts, clang::Method, NoteTemplateParameterLocation(), OpenMP(), PotentiallyEvaluated, ProcessDeclAttributes(), PushExpressionEvaluationContextForFunction(), PushOnScopeChains(), clang::LambdaIntroducer::Range, clang::SC_None, clang::SC_Static, clang::DeclSpec::SCS_static, clang::FunctionDecl::setConstexprKind(), and clang::SemaCUDA::SetLambdaAttrs().

◆ ActOnStartOfSwitchStmt()

◆ ActOnStartOfTranslationUnit()

void Sema::ActOnStartOfTranslationUnit ( )

This is called before the very first declaration in the translation unit is parsed.

Note that the ASTContext may have already injected some declarations.

Definition at line 1165 of file Sema.cpp.

References clang::LangOptionsBase::CMK_HeaderUnit, and getLangOpts().

Referenced by clang::hlsl::HandleRootSignatureTarget().

◆ ActOnStartRequiresExpr()

RequiresExprBodyDecl * Sema::ActOnStartRequiresExpr ( SourceLocation RequiresKWLoc,
ArrayRef< ParmVarDecl * > LocalParameters,
Scope * BodyScope )

◆ ActOnStartSEHFinallyBlock()

void Sema::ActOnStartSEHFinallyBlock ( )

Definition at line 4567 of file SemaStmt.cpp.

References CurrentSEHFinally.

◆ ActOnStartStmtExpr()

void Sema::ActOnStartStmtExpr ( )

◆ ActOnStartTopLevelStmtDecl()

TopLevelStmtDecl * Sema::ActOnStartTopLevelStmtDecl ( Scope * S)

◆ ActOnStartTrailingRequiresClause()

void Sema::ActOnStartTrailingRequiresClause ( Scope * S,
Declarator & D )

◆ ActOnStaticAssertDeclaration()

Decl * Sema::ActOnStaticAssertDeclaration ( SourceLocation StaticAssertLoc,
Expr * AssertExpr,
Expr * AssertMessageExpr,
SourceLocation RParenLoc )

◆ ActOnStmtExpr()

ExprResult Sema::ActOnStmtExpr ( Scope * S,
SourceLocation LPLoc,
Stmt * SubStmt,
SourceLocation RPLoc )

Definition at line 16304 of file SemaExpr.cpp.

References BuildStmtExpr(), and getTemplateDepth().

◆ ActOnStmtExprError()

void Sema::ActOnStmtExprError ( )

◆ ActOnStmtExprResult()

◆ ActOnStringLiteral()

◆ ActOnSuperScopeSpecifier()

bool Sema::ActOnSuperScopeSpecifier ( SourceLocation SuperLoc,
SourceLocation ColonColonLoc,
CXXScopeSpec & SS )

The parser has parsed a '__super' nested-name-specifier.

Parameters
SuperLocThe location of the '__super' keyword.
ColonColonLocThe location of the '::'.
SSThe nested-name-specifier, which will be updated in-place to reflect the parsed nested-name-specifier.
Returns
true if an error occurred, false otherwise.

Definition at line 272 of file SemaCXXScopeSpec.cpp.

References clang::cast(), Context, clang::SemaBase::Diag(), getCurLambda(), getCurScope(), clang::NamedDecl::getName(), clang::CXXRecordDecl::getNumBases(), clang::DeclContext::getParent(), clang::Scope::getParent(), and clang::CXXScopeSpec::MakeMicrosoftSuper().

◆ ActOnTag()

DeclResult Sema::ActOnTag ( Scope * S,
unsigned TagSpec,
TagUseKind TUK,
SourceLocation KWLoc,
CXXScopeSpec & SS,
IdentifierInfo * Name,
SourceLocation NameLoc,
const ParsedAttributesView & Attr,
AccessSpecifier AS,
SourceLocation ModulePrivateLoc,
MultiTemplateParamsArg TemplateParameterLists,
bool & OwnedDecl,
bool & IsDependent,
SourceLocation ScopedEnumKWLoc,
bool ScopedEnumUsesClassTag,
TypeResult UnderlyingType,
bool IsTypeSpecifier,
bool IsTemplateParamOrArg,
OffsetOfKind OOK,
SkipBodyInfo * SkipBody = nullptr )

This is invoked when we see 'struct foo' or 'struct {'.

In the former case, Name will be non-null. In the later case, Name will be null. TagSpec indicates what kind of tag this is. TUK indicates whether this is a reference/declaration/definition of a tag.

Parameters
IsTypeSpecifiertrue if this is a type-specifier (or trailing-type-specifier) other than one in an alias-declaration.
SkipBodyIf non-null, will be set to indicate if the caller should skip the definition of this tag and treat it as if it were a declaration.

Create a new tag decl in C/ObjC. Since the ODR-like semantics for ObjC/C implemented asks for structural equivalence checking, the returned decl here is passed back to the parser, allowing the tag body to be parsed.

Definition at line 17769 of file SemaDecl.cpp.

References AddAlignmentAttributesForRecord(), AddMsStructLayoutForRecord(), AddPragmaAttributes(), AddPushedVisibilityAttribute(), clang::AS_none, clang::C23, clang::cast(), CheckClassTemplate(), CheckEnumRedeclaration(), CheckEnumUnderlyingType(), CheckMemberSpecialization(), CheckRedeclarationInModule(), clang::SkipBodyInfo::CheckSameAsPrevious, CheckTemplateDeclScope(), CompleteMemberSpecialization(), computeDeclContext(), clang::Scope::containedInPrototypeScope(), Context, clang::CPlusPlus, clang::CXXRecordDecl::Create(), clang::EnumDecl::Create(), clang::RecordDecl::Create(), createFriendTagNNSFixIt(), clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), CurContext, clang::Declaration, clang::Definition, clang::SemaBase::Diag(), DiagnoseClassNameShadow(), diagnoseQualifiedDeclaration(), DiagnoseTemplateParameterShadow(), DiagnoseUnexpandedParameterPack(), clang::LookupResult::Filter::done(), clang::ParsedAttributesView::empty(), clang::DeclContext::Encloses(), clang::Enum, clang::DeclContext::Equals(), clang::LookupResult::Filter::erase(), clang::Decl::FOK_Undeclared, forRedeclarationInCurContext(), clang::Friend, clang::ActionResult< PtrTy, Compress >::get(), clang::Decl::getAccess(), clang::QualType::getAtomicUnqualifiedType(), clang::SourceRange::getBegin(), clang::CXXScopeSpec::getBeginLoc(), clang::TypeLoc::getBeginLoc(), getCurrentModule(), clang::Decl::getDeclContext(), clang::DeclContext::getDeclKind(), clang::TagDecl::getDefinition(), getDefinition(), clang::DeclContext::getEnclosingNamespaceContext(), clang::EnumDecl::getIntegerType(), getLangOpts(), clang::Decl::getLocation(), getNonFieldDeclScope(), getNonTagTypeDeclKind(), clang::Decl::getOwningModule(), clang::DeclContext::getParent(), clang::CXXScopeSpec::getRange(), clang::DeclContext::getRedeclContext(), getScopeForDeclContext(), getStdAlignValT(), getStdBadAlloc(), getStdNamespace(), getTagInjectionContext(), getTagInjectionScope(), clang::KeywordHelpers::getTagTypeKindForTypeSpec(), clang::KeywordHelpers::getTagTypeKindName(), clang::TemplateParameterList::getTemplateLoc(), clang::TypeSourceInfo::getType(), GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), clang::QualType::getTypePtr(), clang::CXXScopeSpec::getWithLocInContext(), clang::LookupResult::Filter::hasNext(), inferGslOwnerPointerAttribute(), inferNullableClassAttribute(), clang::Invalid, clang::isa(), isAcceptableTagRedeclaration(), isAcceptableTagRedeclContext(), clang::EnumDecl::isComplete(), clang::NamedDecl::isCXXClassMember(), isDeclInScope(), clang::Scope::isDeclScope(), clang::CXXScopeSpec::isEmpty(), clang::DeclContext::isFileContext(), clang::EnumDecl::isFixed(), clang::DeclContext::isFunctionOrMethod(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::CXXScopeSpec::isInvalid(), clang::CXXRecordDecl::isLocalClass(), clang::CXXScopeSpec::isNotEmpty(), clang::DeclContext::isRecord(), isRedefinitionAllowedFor(), clang::CXXScopeSpec::isSet(), clang::IdentifierInfo::isStr(), clang::ActionResult< PtrTy, Compress >::isUnset(), clang::SourceLocation::isValid(), LangOpts, LookupName(), LookupQualifiedName(), LookupTagName, clang::Macro, clang::DeclContext::makeDeclVisibleInContext(), makeMergedDefinitionVisible(), MatchTemplateParametersToScopeSpecifier(), mergeDeclAttributes(), New, clang::SkipBodyInfo::New, clang::LookupResult::Filter::next(), notePreviousDefinition(), NotForRedeclaration, clang::Outside, clang::SkipBodyInfo::Previous, Previous, ProcessAPINotes(), ProcessDeclAttributeList(), PushOnScopeChains(), clang::Reference, RequireCompleteDeclContext(), clang::Result, clang::EnumDecl::setEnumKeyRange(), clang::EnumDecl::setIntegerType(), clang::EnumDecl::setIntegerTypeSourceInfo(), SetMemberAccessSpecifier(), clang::EnumDecl::setPromotionType(), clang::SkipBodyInfo::ShouldSkip, clang::TemplateParameterList::size(), StdAlignValT, StdBadAlloc, StdNamespace, clang::T, clang::TSK_ExplicitSpecialization, and UPPC_FixedUnderlyingType.

Referenced by ActOnExplicitInstantiation(), and ActOnTemplatedFriendTag().

◆ ActOnTagDefinitionError()

void Sema::ActOnTagDefinitionError ( Scope * S,
Decl * TagDecl )

ActOnTagDefinitionError - Invoked when there was an unrecoverable error parsing the definition of a tag.

Definition at line 18970 of file SemaDecl.cpp.

References AdjustDeclIfTemplate(), clang::cast(), and PopDeclContext().

◆ ActOnTagFinishDefinition()

◆ ActOnTagFinishSkippedDefinition()

void Sema::ActOnTagFinishSkippedDefinition ( SkippedDefinitionContext Context)

Definition at line 1398 of file SemaDecl.cpp.

References Context, and CurContext.

◆ ActOnTagStartDefinition()

void Sema::ActOnTagStartDefinition ( Scope * S,
Decl * TagDecl )

ActOnTagStartDefinition - Invoked when we have entered the scope of a tag's definition (e.g., for an enumeration, class, struct, or union).

Definition at line 18836 of file SemaDecl.cpp.

References ActOnDocumentableDecl(), AddPushedVisibilityAttribute(), AdjustDeclIfTemplate(), clang::cast(), and PushDeclContext().

◆ ActOnTagStartSkippedDefinition()

Sema::SkippedDefinitionContext Sema::ActOnTagStartSkippedDefinition ( Scope * S,
Decl * TD )

Invoked when we enter a tag definition that we're skipping.

Definition at line 1384 of file SemaDecl.cpp.

References clang::cast(), CurContext, clang::Result, and clang::Scope::setEntity().

◆ ActOnTagTemplateIdType()

◆ ActOnTemplateDeclarator()

Decl * Sema::ActOnTemplateDeclarator ( Scope * S,
MultiTemplateParamsArg TemplateParameterLists,
Declarator & D )

Definition at line 9116 of file SemaTemplate.cpp.

References ActOnDocumentableDecl(), and HandleDeclarator().

◆ ActOnTemplatedFriendTag()

◆ ActOnTemplateIdType()

◆ ActOnTemplateName()

TemplateNameKind Sema::ActOnTemplateName ( Scope * S,
CXXScopeSpec & SS,
SourceLocation TemplateKWLoc,
const UnqualifiedId & Name,
ParsedType ObjectType,
bool EnteringContext,
TemplateTy & Template,
bool AllowInjectedClassName = false )

Form a template name from a name that is syntactically required to name a template, either due to use of the 'template' keyword or because a name in this syntactic context is assumed to name a template (C++ [temp.names]p2-4).

This action forms a template name given the name of the template and its optional scope specifier. This is used when the 'template' keyword is used or when the parsing context unambiguously treats a following '<' as introducing a template argument list. Note that this may produce a non-dependent template name if we can perform the lookup now and identify the named template.

For example, given "x.MetaFun::template apply", the scope specifier SS will be "MetaFun::", TemplateKWLoc contains the location of the "template" keyword, and "apply" is the Name.

Definition at line 5027 of file SemaTemplate.cpp.

References computeDeclContext(), Context, clang::CPlusPlus11, clang::FixItHint::CreateRemoval(), clang::SemaBase::Diag(), clang::OpaquePtr< PtrTy >::get(), clang::UnqualifiedId::getBeginLoc(), clang::UnqualifiedId::getKind(), getLangOpts(), clang::DeclarationNameInfo::getName(), GetNameFromUnqualifiedId(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::UnqualifiedId::getSourceRange(), clang::Scope::getTemplateParamParent(), GetTypeFromParser(), clang::UnqualifiedId::Identifier, clang::IK_Identifier, clang::IK_LiteralOperatorId, clang::IK_OperatorFunctionId, clang::LookupResult::isAmbiguous(), clang::CXXScopeSpec::isInvalid(), clang::CXXScopeSpec::isNotEmpty(), isTemplateName(), clang::SourceLocation::isValid(), LookupOrdinaryName, LookupTemplateName(), clang::OpaquePtr< TemplateName >::make(), clang::Result, TemplateNameIsRequired, clang::TNK_Dependent_template_name, clang::TNK_Function_template, and clang::TNK_Non_template.

◆ ActOnTemplateParameterList()

TemplateParameterList * Sema::ActOnTemplateParameterList ( unsigned Depth,
SourceLocation ExportLoc,
SourceLocation TemplateLoc,
SourceLocation LAngleLoc,
ArrayRef< NamedDecl * > Params,
SourceLocation RAngleLoc,
Expr * RequiresClause )

ActOnTemplateParameterList - Builds a TemplateParameterList, optionally constrained by RequiresClause, that contains the template parameters in Params.

Definition at line 1859 of file SemaTemplate.cpp.

References Context, clang::TemplateParameterList::Create(), clang::SemaBase::Diag(), clang::SourceLocation::isValid(), and warnOnReservedIdentifier().

◆ ActOnTemplateTemplateArgument()

ParsedTemplateArgument Sema::ActOnTemplateTemplateArgument ( const ParsedTemplateArgument & Arg)

Invoked when parsing a template argument.

Parameters
Argthe template argument, which may already be invalid.

If it is followed by ellipsis, this function is called before ActOnPackExpansion.

Definition at line 709 of file SemaTemplateVariadic.cpp.

References diagnoseMissingTemplateArguments(), clang::OpaquePtr< PtrTy >::get(), clang::ParsedTemplateArgument::getAsTemplate(), clang::TemplateName::getAsTemplateDecl(), clang::ParsedTemplateArgument::getNameLoc(), clang::ParsedTemplateArgument::isInvalid(), and clang::T.

◆ ActOnTemplateTemplateParameter()

NamedDecl * Sema::ActOnTemplateTemplateParameter ( Scope * S,
SourceLocation TmpLoc,
TemplateNameKind Kind,
bool Typename,
TemplateParameterList * Params,
SourceLocation EllipsisLoc,
IdentifierInfo * Name,
SourceLocation NameLoc,
unsigned Depth,
unsigned Position,
SourceLocation EqualLoc,
ParsedTemplateArgument Default )

◆ ActOnTemplateTypeArgument()

ParsedTemplateArgument Sema::ActOnTemplateTypeArgument ( TypeResult ParsedType)

Convert a parsed type into a parsed template argument.

This is mostly trivial, except that we may have parsed a C++17 deduced class template specialization type, in which case we should form a template template argument instead of a type template argument.

Definition at line 998 of file SemaTemplate.cpp.

References clang::CXXScopeSpec::Adopt(), clang::CPlusPlus17, clang::TypeLoc::getAs(), clang::TypeLoc::getBeginLoc(), getLangOpts(), GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), clang::SourceLocation::isValid(), clang::OpaquePtr< TemplateName >::make(), clang::Result, clang::T, and clang::ParsedTemplateArgument::Type.

◆ ActOnTranslationUnitScope()

void Sema::ActOnTranslationUnitScope ( Scope * S)

Scope actions.

Definition at line 172 of file Sema.cpp.

References Context, PushDeclContext(), and TUScope.

◆ ActOnTypeConstraint()

bool Sema::ActOnTypeConstraint ( const CXXScopeSpec & SS,
TemplateIdAnnotation * TypeConstraint,
TemplateTypeParmDecl * ConstrainedParameter,
SourceLocation EllipsisLoc )

Definition at line 1155 of file SemaTemplate.cpp.

References BuildTypeConstraint().

◆ ActOnTypedefDeclarator()

◆ ActOnTypedefNameDecl()

NamedDecl * Sema::ActOnTypedefNameDecl ( Scope * S,
DeclContext * DC,
TypedefNameDecl * D,
LookupResult & Previous,
bool & Redeclaration )

ActOnTypedefNameDecl - Perform semantic checking for a declaration which declares a typedef-name, either using the 'typedef' type specifier or via a C++0x [dcl.typedef]p2 alias-declaration: 'using T = A;'.

Definition at line 6939 of file SemaDecl.cpp.

References clang::Decl::addAttr(), CheckShadow(), Context, FilterLookupForScope(), filterNonConflictingPreviousTypedefDecls(), clang::Decl::getDeclContext(), clang::NamedDecl::getIdentifier(), clang::DeclContext::getRedeclContext(), getShadowedDeclaration(), inferGslPointerAttribute(), clang::Decl::isInvalidDecl(), clang::DeclContext::isTranslationUnit(), MergeTypedefNameDecl(), Previous, and clang::Redeclaration.

Referenced by ActOnAliasDeclaration(), and ActOnTypedefDeclarator().

◆ ActOnTypeName()

◆ ActOnTypenameType() [1/2]

TypeResult Sema::ActOnTypenameType ( Scope * S,
SourceLocation TypenameLoc,
const CXXScopeSpec & SS,
const IdentifierInfo & II,
SourceLocation IdLoc,
ImplicitTypenameContext IsImplicitTypename = ImplicitTypenameContext::No )

Called when the parser has parsed a C++ typename specifier, e.g., "typename T::type".

Parameters
SThe scope in which this typename type occurs.
TypenameLocthe location of the 'typename' keyword
SSthe nested-name-specifier following the typename (e.g., 'T::').
IIthe identifier we're retrieving (e.g., 'type' in the example).
IdLocthe location of the identifier.
IsImplicitTypenamecontext where T::type refers to a type.

Definition at line 11086 of file SemaTemplate.cpp.

References CheckTypenameType(), Context, CreateParsedType(), clang::FixItHint::CreateRemoval(), clang::SemaBase::DiagCompat(), clang::Scope::getTemplateParamParent(), clang::CXXScopeSpec::getWithLocInContext(), clang::CXXScopeSpec::isInvalid(), clang::SourceLocation::isValid(), clang::None, clang::T, and clang::Typename.

Referenced by ActOnTemplateIdType(), ActOnTypeRequirement(), DiagnoseUnknownTypeName(), and getTypeName().

◆ ActOnTypenameType() [2/2]

TypeResult Sema::ActOnTypenameType ( Scope * S,
SourceLocation TypenameLoc,
const CXXScopeSpec & SS,
SourceLocation TemplateLoc,
TemplateTy TemplateName,
const IdentifierInfo * TemplateII,
SourceLocation TemplateIILoc,
SourceLocation LAngleLoc,
ASTTemplateArgsPtr TemplateArgs,
SourceLocation RAngleLoc )

Called when the parser has parsed a C++ typename specifier that ends in a template-id, e.g., "typename MetaFun::template apply<T1, T2>".

Parameters
SThe scope in which this typename type occurs.
TypenameLocthe location of the 'typename' keyword
SSthe nested-name-specifier following the typename (e.g., 'T::').
TemplateLocthe location of the 'template' keyword, if any.
TemplateNameThe template name.
TemplateIIThe identifier used to name the template.
TemplateIILocThe location of the template name.
LAngleLocThe location of the opening angle bracket ('<').
TemplateArgsThe template arguments.
RAngleLocThe location of the closing angle bracket ('>').

Definition at line 11111 of file SemaTemplate.cpp.

References CheckTemplateIdType(), computeDeclContext(), Context, clang::CPlusPlus11, CreateParsedType(), clang::FixItHint::CreateRemoval(), clang::SemaBase::Diag(), clang::OpaquePtr< PtrTy >::get(), getLangOpts(), clang::Scope::getTemplateParamParent(), clang::CXXScopeSpec::getWithLocInContext(), clang::SourceLocation::isValid(), clang::None, clang::TemplateSpecializationTypeLoc::set(), clang::T, translateTemplateArguments(), and clang::Typename.

◆ ActOnTypeParameter()

NamedDecl * Sema::ActOnTypeParameter ( Scope * S,
bool Typename,
SourceLocation EllipsisLoc,
SourceLocation KeyLoc,
IdentifierInfo * ParamName,
SourceLocation ParamNameLoc,
unsigned Depth,
unsigned Position,
SourceLocation EqualLoc,
ParsedType DefaultArg,
bool HasTypeConstraint )

ActOnTypeParameter - Called when a C++ template type parameter (e.g., "typename T") has been parsed.

Typename specifies whether the keyword "typename" was used to declare the type parameter (otherwise, "class" was used), and KeyLoc is the location of the "class" or "typename" keyword. ParamName is the name of the parameter (NULL indicates an unnamed template parameter) and ParamNameLoc is the location of the parameter name (if any). If the type parameter has a default argument, it will be added later via ActOnTypeParameterDefault.

Definition at line 1037 of file SemaTemplate.cpp.

References clang::Scope::AddDecl(), clang::AS_public, CheckTemplateArgument(), Context, clang::TemplateTypeParmDecl::Create(), clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), getEnclosingLambdaOrBlock(), clang::TypeSourceInfo::getType(), GetTypeFromParser(), IdResolver, clang::Scope::isTemplateParamScope(), clang::SourceLocation::isValid(), maybeDiagnoseTemplateParameterShadow(), Typename, and UPPC_DefaultArgument.

◆ ActOnTypeRequirement()

◆ ActOnTypeTrait()

ExprResult Sema::ActOnTypeTrait ( TypeTrait Kind,
SourceLocation KWLoc,
ArrayRef< ParsedType > Args,
SourceLocation RParenLoc )

Parsed one of the type trait support pseudo-functions.

Definition at line 1487 of file SemaTypeTraits.cpp.

References BuildTypeTrait(), Context, GetTypeFromParser(), and clang::T.

◆ ActOnUnaryExprOrTypeTraitExpr()

ExprResult Sema::ActOnUnaryExprOrTypeTraitExpr ( SourceLocation OpLoc,
UnaryExprOrTypeTrait ExprKind,
bool IsType,
void * TyOrEx,
SourceRange ArgRange )

ActOnUnaryExprOrTypeTraitExpr - Handle sizeof(type) and sizeof expr and the same for alignof and __alignof Note that the ArgRange is invalid if isType is false.

Definition at line 4773 of file SemaExpr.cpp.

References CreateUnaryExprOrTypeTraitExpr(), clang::ExprError(), clang::OpaquePtr< QualType >::getFromOpaquePtr(), GetTypeFromParser(), and clang::Result.

Referenced by BuildCXXForRangeStmt().

◆ ActOnUnaryOp()

ExprResult Sema::ActOnUnaryOp ( Scope * S,
SourceLocation OpLoc,
tok::TokenKind Op,
Expr * Input,
bool IsAfterAmp = false )

Unary Operators. 'Tok' is the token for the operator.

Definition at line 16271 of file SemaExpr.cpp.

References BuildUnaryOp(), and ConvertTokenKindToUnaryOpcode().

Referenced by BuildCXXForRangeStmt(), and BuiltinInvoke().

◆ ActOnUndeclaredTypeTemplateName()

void Sema::ActOnUndeclaredTypeTemplateName ( Scope * S,
TemplateTy & Name,
TemplateNameKind & TNK,
SourceLocation NameLoc,
IdentifierInfo *& II )

Try to resolve an undeclared template name as a type template.

Sets II to the identifier corresponding to the template name, and updates Name to a corresponding (typo-corrected) type template name and TNK to the corresponding kind, if possible.

Definition at line 3987 of file SemaTemplate.cpp.

References clang::OpaquePtr< PtrTy >::get(), clang::TemplateName::getAsAssumedTemplateName(), clang::OpaquePtr< TemplateName >::make(), resolveAssumedTemplateNameAsType(), clang::TNK_Type_template, and clang::TNK_Undeclared_template.

◆ ActOnUnevaluatedStringLiteral()

◆ ActOnUninitializedDecl()

◆ ActOnUsingDeclaration()

Decl * Sema::ActOnUsingDeclaration ( Scope * CurScope,
AccessSpecifier AS,
SourceLocation UsingLoc,
SourceLocation TypenameLoc,
CXXScopeSpec & SS,
UnqualifiedId & Name,
SourceLocation EllipsisLoc,
const ParsedAttributesView & AttrList )

◆ ActOnUsingDirective()

◆ ActOnUsingEnumDeclaration()

◆ ActOnVAArg()

ExprResult Sema::ActOnVAArg ( SourceLocation BuiltinLoc,
Expr * E,
ParsedType Ty,
SourceLocation RPLoc )

Definition at line 16943 of file SemaExpr.cpp.

References BuildVAArgExpr(), and GetTypeFromParser().

◆ ActOnVariableDeclarator()

NamedDecl * Sema::ActOnVariableDeclarator ( Scope * S,
Declarator & D,
DeclContext * DC,
TypeSourceInfo * TInfo,
LookupResult & Previous,
MultiTemplateParamsArg TemplateParamLists,
bool & AddToScope,
ArrayRef< BindingDecl * > Bindings = {} )

Definition at line 7740 of file SemaDecl.cpp.

References ActOnDocumentableDecl(), clang::SemaHLSL::ActOnVariableDeclarator(), clang::SemaOpenACC::ActOnVariableDeclarator(), ActOnVarTemplateSpecialization(), clang::Decl::addAttr(), adjustContextForLocalExternDecl(), clang::AutoVar, clang::cast(), CheckConstrainedAuto(), checkDLLAttributeRedeclaration(), CheckMemberSpecialization(), checkNonTrivialCUnion(), CheckShadow(), CheckTemplateDeclScope(), CheckTemplateParameterList(), CheckVariableDeclaration(), CompleteMemberSpecialization(), computeDeclContext(), clang::Consteval, clang::Constexpr, clang::Constinit, Context, copyAttrFromTypedefToDecl(), clang::CPlusPlus, clang::CPlusPlus11, clang::CPlusPlus17, clang::DecompositionDecl::Create(), clang::VarDecl::Create(), clang::VarTemplateDecl::Create(), clang::FixItHint::CreateRemoval(), CUDA(), CurContext, clang::DeclAttrsMatchCUDAMode(), deduceOpenCLAddressSpace(), clang::SemaBase::Diag(), clang::SemaBase::DiagCompat(), DiagnoseFunctionSpecifiers(), DiagPlaceholderVariableDefinition(), emitReadOnlyPlacementAttrWarning(), clang::DeclContext::Equals(), ExtnameUndeclaredIdentifiers, FilterLookupForScope(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::DeclarationName::getAsIdentifierInfo(), clang::Declarator::getAsmLabel(), clang::Decl::getAttr(), clang::Declarator::getBeginLoc(), clang::DeclSpec::getBeginLoc(), clang::DeclSpec::getConstexprSpecifier(), clang::DeclSpec::getConstexprSpecLoc(), clang::TypeLoc::getContainedAutoTypeLoc(), clang::Type::getContainedDeducedType(), getCurFunctionDecl(), getCurrentMangleNumberContext(), clang::Declarator::getCXXScopeSpec(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::Declarator::getDeclSpec(), clang::Declarator::getDecompositionDeclarator(), clang::VarDecl::getDescribedVarTemplate(), clang::Scope::getFnParent(), clang::NamedDecl::getIdentifier(), clang::Declarator::getIdentifierLoc(), clang::DeclSpec::getInlineSpecLoc(), clang::VarTemplateDecl::getInstantiatedFromMemberTemplate(), clang::UnqualifiedId::getKind(), getLangOpts(), clang::Decl::getLocation(), clang::MangleNumberingContext::getManglingNumber(), clang::DeclSpec::getModulePrivateSpecLoc(), getMSManglingNumber(), clang::DeclarationNameInfo::getName(), clang::Declarator::getName(), GetNameForDeclarator(), clang::LangOptions::getOpenCLVersionString(), clang::DeclContext::getParent(), clang::VarDecl::getPreviousDecl(), clang::CXXScopeSpec::getRange(), clang::TemplateParameterList::getRAngleLoc(), clang::DeclContext::getRedeclContext(), getShadowedDeclaration(), getSourceManager(), clang::TemplateParameterList::getSourceRange(), clang::DeclSpec::getSpecifierName(), clang::MangleNumberingContext::getStaticLocalNumber(), clang::VarDecl::getStorageClass(), clang::DeclSpec::getStorageClassSpec(), clang::DeclSpec::getStorageClassSpecLoc(), clang::StringLiteral::getString(), clang::StringLiteral::getStrTokenLoc(), clang::TagDecl::getTagKind(), clang::TemplateParameterList::getTemplateLoc(), clang::TemplateDecl::getTemplateParameters(), clang::DeclSpec::getThreadStorageClassSpec(), clang::DeclSpec::getThreadStorageClassSpecLoc(), clang::TypeSourceInfo::getType(), clang::ValueDecl::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::Decl::hasAttr(), clang::NamedDecl::hasExternalFormalLinkage(), clang::VarDecl::hasExternalStorage(), clang::VarDecl::hasGlobalStorage(), clang::Declarator::hasInitializer(), clang::VarDecl::hasLocalStorage(), clang::QualType::hasNonTrivialToPrimitiveDestructCUnion(), hasParsedAttr(), HLSL(), clang::IK_TemplateId, clang::Invalid, clang::isa(), clang::DeclContext::isClosure(), clang::QualType::isConstQualified(), isDeclExternC(), isDeclInScope(), clang::Declarator::isDecompositionDeclarator(), clang::DeclContext::isDependentContext(), clang::CXXScopeSpec::isEmpty(), clang::VarDecl::isExternC(), clang::VarDecl::isFirstDecl(), clang::Declarator::isFunctionDefinition(), isFunctionDefinitionDiscarded(), clang::DeclContext::isFunctionOrMethod(), clang::Type::isFunctionPointerType(), isIncompleteDeclExternC(), clang::DeclSpec::isInlineSpecified(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::Declarator::isInvalidType(), clang::VarDecl::isLocalVarDecl(), isMainVar(), clang::DeclSpec::isModulePrivateSpecified(), clang::CXXScopeSpec::isNotEmpty(), clang::IdentifierInfo::isPlaceholder(), clang::DeclContext::isRecord(), clang::Declarator::isRedeclaration(), clang::CXXScopeSpec::isSet(), clang::VarDecl::isStaticDataMember(), clang::VarDecl::isStaticLocal(), clang::Type::isVariableArrayType(), clang::Type::isWebAssemblyTableType(), LangOpts, MatchTemplateParametersToScopeSpecifier(), MaybeSuggestAddingStaticToDecl(), NTCUK_Destruct, ObjC(), OpenACC(), OpenCL(), ParsingInitForAutoVars, Previous, ProcessDeclAttributes(), ProcessPragmaExport(), ProcessPragmaWeak(), RebuildTemplateParamsInCurrentInstantiation(), RegisterLocallyScopedExternCDecl(), clang::SC_Auto, clang::SC_Extern, clang::SC_None, clang::SC_PrivateExtern, clang::SC_Register, clang::SC_Static, clang::DeclSpec::SCS_mutable, clang::DeclSpec::SCS_register, clang::DeclSpec::SCS_unspecified, clang::VarDecl::setConstexpr(), clang::VarDecl::setDescribedVarTemplate(), clang::VarDecl::setImplicitlyInline(), clang::VarDecl::setInlineSpecified(), clang::Decl::setInvalidDecl(), clang::Declarator::setInvalidType(), clang::Decl::setLexicalDeclContext(), clang::Decl::setLocalExternDecl(), clang::RedeclarableTemplateDecl::setMemberSpecialization(), clang::NamedDecl::setModulePrivate(), SetNestedNameSpecifier(), clang::VarDecl::setPreviousDeclInSameBlockScope(), clang::Declarator::setRedeclaration(), clang::VarDecl::setStorageClass(), clang::DeclaratorDecl::setTemplateParameterListsInfo(), clang::VarDecl::setTSCSpec(), clang::ValueDecl::setType(), shouldConsiderLinkage(), clang::TemplateParameterList::size(), StorageClassSpecToVarDeclStorageClass(), targetDiag(), clang::UnqualifiedId::TemplateId, TPC_ClassTemplateMember, TPC_Other, tryToFixVariablyModifiedVarType(), clang::DeclSpec::TSCS_thread_local, clang::TSCS_unspecified, and clang::Unspecified.

Referenced by ActOnDecompositionDeclarator(), and HandleDeclarator().

◆ ActOnVarTemplateSpecialization()

DeclResult Sema::ActOnVarTemplateSpecialization ( Scope * S,
Declarator & D,
TypeSourceInfo * TSI,
LookupResult & Previous,
SourceLocation TemplateKWLoc,
TemplateParameterList * TemplateParams,
StorageClass SC,
bool IsPartialSpecialization )

Definition at line 4332 of file SemaTemplate.cpp.

References clang::Sema::CheckTemplateArgumentInfo::CanonicalConverted, CheckTemplateArgumentList(), CheckTemplatePartialSpecialization(), CheckTemplatePartialSpecializationArgs(), CheckTemplateSpecializationScope(), Context, clang::VarTemplatePartialSpecializationDecl::Create(), clang::VarTemplateSpecializationDecl::Create(), clang::FixItHint::CreateRemoval(), CurContext, clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), clang::OpaquePtr< PtrTy >::get(), clang::TemplateName::getAsOverloadedTemplate(), clang::TemplateName::getAsTemplateDecl(), clang::NamedDecl::getDeclName(), clang::Declarator::getIdentifierLoc(), clang::VarTemplatePartialSpecializationDecl::getInstantiatedFromMember(), clang::UnqualifiedId::getKind(), clang::Declarator::getName(), clang::VarTemplateSpecializationDecl::getPointOfInstantiation(), clang::VarDecl::getPreviousDecl(), clang::VarTemplateSpecializationDecl::getSpecializationKind(), clang::VarDecl::getTemplateSpecializationKind(), getTemplateSpecializationKind(), clang::TypeSourceInfo::getType(), clang::TemplateParameterList::hasAssociatedConstraints(), clang::IK_TemplateId, clang::TemplateName::isDependent(), isSameAsPrimaryTemplate(), clang::SourceLocation::isValid(), clang::TemplateIdAnnotation::LAngleLoc, makeTemplateArgumentListInfo(), Previous, clang::TemplateIdAnnotation::RAngleLoc, clang::SC_Extern, clang::VarTemplatePartialSpecializationDecl::setMemberSpecialization(), clang::VarTemplateSpecializationDecl::setTemplateArgsAsWritten(), clang::TemplateArgumentListInfo::size(), clang::Specialization, clang::TemplateIdAnnotation::Template, clang::UnqualifiedId::TemplateId, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, clang::TSK_Undeclared, UPPC_ExplicitSpecialization, UPPC_PartialSpecialization, and VarTemplate.

Referenced by ActOnVariableDeclarator().

◆ ActOnWhileStmt()

◆ AddAlignedAttr() [1/2]

◆ AddAlignedAttr() [2/2]

◆ AddAlignmentAttributesForRecord()

void Sema::AddAlignmentAttributesForRecord ( RecordDecl * RD)

◆ AddAlignValueAttr()

◆ AddAllocAlignAttr()

◆ AddArgumentDependentLookupCandidates()

void Sema::AddArgumentDependentLookupCandidates ( DeclarationName Name,
SourceLocation Loc,
ArrayRef< Expr * > Args,
TemplateArgumentListInfo * ExplicitTemplateArgs,
OverloadCandidateSet & CandidateSet,
bool PartialOverloading = false )

Add function candidates found via argument-dependent lookup to the set of overloading candidates.

This routine performs argument-dependent name lookup based on the given function name (which may also be an operator name) and adds all of the overload candidates found by ADL to the overload candidate set (C++ [basic.lookup.argdep]).

Definition at line 10502 of file SemaOverload.cpp.

References AddOverloadCandidate(), AddTemplateOverloadCandidate(), ArgumentDependentLookup(), clang::AS_none, clang::ADLResult::begin(), clang::OverloadCandidateSet::begin(), clang::cast(), clang::ADLResult::end(), clang::OverloadCandidateSet::end(), clang::ADLResult::erase(), clang::OverloadCandidateSet::getPersistentArgsArray(), clang::OverloadCandidateSet::getRewriteInfo(), clang::DeclAccessPair::make(), clang::Reversed, and clang::OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed().

Referenced by AddOverloadedCallCandidates(), CreateOverloadedUnaryOp(), and LookupOverloadedBinOp().

◆ AddAssumeAlignedAttr()

◆ AddBuiltinCandidate()

void Sema::AddBuiltinCandidate ( QualType * ParamTys,
ArrayRef< Expr * > Args,
OverloadCandidateSet & CandidateSet,
bool IsAssignmentOperator = false,
unsigned NumContextualBoolArguments = 0 )

AddBuiltinCandidate - Add a candidate for a built-in operator.

ResultTy and ParamTys are the result and parameter types of the built-in candidate, respectively. Args and NumArgs are the arguments being passed to the candidate. IsAssignmentOperator should be true when this built-in candidate is an assignment operator. NumContextualBoolArguments is the number of arguments (at the beginning of the argument list) that will be contextually converted to bool.

Definition at line 8851 of file SemaOverload.cpp.

References clang::OverloadCandidateSet::addCandidate(), clang::AS_none, clang::OverloadCandidate::BuiltinParamTypes, Context, clang::OverloadCandidate::Conversions, clang::OverloadCandidate::ExplicitCallArguments, clang::OverloadCandidate::FailureKind, clang::OverloadCandidate::FoundDecl, clang::OverloadCandidate::Function, getLangOpts(), clang::DeclAccessPair::make(), clang::ovl_fail_bad_conversion, TryContextuallyConvertToBool(), TryCopyInitialization(), Unevaluated, clang::Unevaluated, and clang::OverloadCandidate::Viable.

Referenced by AddBuiltinAssignmentOperatorCandidates().

◆ AddBuiltinOperatorCandidates()

void Sema::AddBuiltinOperatorCandidates ( OverloadedOperatorKind Op,
SourceLocation OpLoc,
ArrayRef< Expr * > Args,
OverloadCandidateSet & CandidateSet )

AddBuiltinOperatorCandidates - Add the appropriate built-in operator overloads to the candidate set (C++ [over.built]), based on the operator Op and the arguments given.

For example, if the operator is a binary '+', this routine might add "int operator+(int, int)" to cover integer addition.

Definition at line 10304 of file SemaOverload.cpp.

References clang::QualifiersAndAtomic::addAtomic(), clang::QualifiersAndAtomic::addConst(), CollectVRQualifiers(), Context, getType(), clang::NUM_OVERLOADED_OPERATORS, and clang::OO_None.

Referenced by CreateOverloadedArraySubscriptExpr(), CreateOverloadedUnaryOp(), and LookupOverloadedBinOp().

◆ addClusterDimsAttr()

void Sema::addClusterDimsAttr ( Decl * D,
const AttributeCommonInfo & CI,
Expr * X,
Expr * Y,
Expr * Z )

◆ AddConversionCandidate()

void Sema::AddConversionCandidate ( CXXConversionDecl * Conversion,
DeclAccessPair FoundDecl,
CXXRecordDecl * ActingContext,
Expr * From,
QualType ToType,
OverloadCandidateSet & CandidateSet,
bool AllowObjCConversionOnExplicit,
bool AllowExplicit,
bool AllowResultConversion = true,
bool StrictPackMatch = false )

AddConversionCandidate - Add a C++ conversion function as a candidate in the candidate set (C++ [over.match.conv], C++ [over.match.copy]).

From is the expression we're converting from, and ToType is the type that we're eventually trying to convert to (which may or may not be the same type as the type that the conversion function produces).

Definition at line 8355 of file SemaOverload.cpp.

References clang::OverloadCandidateSet::addCandidate(), clang::ImplicitConversionSequence::BadConversion, clang::Type::castAsCXXRecordDecl(), CheckEnableIf(), CheckFunctionConstraints(), clang::Expr::Classify(), Context, clang::OverloadCandidate::Conversions, clang::CPlusPlus14, clang::DeductionFailureInfo::Data, DeduceReturnType(), clang::OverloadCandidate::DeductionFailure, clang::OverloadCandidate::ExplicitCallArguments, clang::OverloadCandidate::FailureKind, clang::OverloadCandidate::FinalConversion, clang::StandardConversionSequence::First, clang::OverloadCandidate::FoundDecl, clang::OverloadCandidate::Function, clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::GetConversionRank(), clang::CXXConversionDecl::getConversionType(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::Expr::getExprLoc(), clang::ImplicitConversionSequence::getKind(), getLangOpts(), clang::OverloadCandidateSet::getLocation(), clang::QualType::getNonLValueExprType(), clang::QualType::getNonReferenceType(), clang::Type::getPointeeType(), clang::FunctionDecl::getPrimaryTemplate(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::QualType::getUnqualifiedType(), clang::Expr::getValueKindForType(), clang::OverloadCandidate::HasFinalConversion, clang::ICK_Lvalue_To_Rvalue, clang::ICR_Exact_Match, isAllowableExplicitConversion(), isCompleteType(), IsDerivedFrom(), clang::CXXConversionDecl::isExplicit(), clang::OverloadCandidateSet::isNewCandidate(), isNonViableMultiVersionOverload(), clang::Type::isRValueReferenceType(), clang::ConstraintSatisfaction::IsSatisfied, clang::Type::isUndeducedType(), clang::ImplicitCastExpr::OnStack, clang::ovl_fail_bad_conversion, clang::ovl_fail_bad_final_conversion, clang::ovl_fail_constraints_not_satisfied, clang::ovl_fail_enable_if, clang::ovl_fail_explicit, clang::ovl_fail_final_conversion_not_exact, clang::ovl_fail_trivial_conversion, clang::ovl_non_default_multiversion_function, clang::StandardConversionSequence::Second, clang::StandardConversionSequence::setAllToTypes(), clang::StandardConversionSequence::setAsIdentityConversion(), clang::StandardConversionSequence::setFromType(), clang::ImplicitConversionSequence::Standard, clang::ImplicitConversionSequence::StandardConversion, clang::OverloadCandidate::StrictPackMatch, TryCopyInitialization(), TryObjectArgumentInitialization(), Unevaluated, clang::Unevaluated, clang::OverloadCandidate::Viable, clang::VK_LValue, and clang::VK_PRValue.

Referenced by AddTemplateConversionCandidateImmediately(), collectViableConversionCandidates(), FindConversionForRefInit(), IsUserDefinedConversion(), ResolveConstructorOverload(), TryRefInitWithConversionFunction(), and TryUserDefinedConversion().

◆ addDeclWithEffects()

void clang::Sema::addDeclWithEffects ( const Decl * D,
const FunctionEffectsRef & FX )

Unconditionally add a Decl to DeclsWithEfffectsToVerify.

Definition at line 1497 of file SemaFunctionEffects.cpp.

References AllEffectsToVerify, DeclsWithEffectsToVerify, and clang::FunctionEffect::FE_InferrableOnCallees.

Referenced by maybeAddDeclWithEffects().

◆ addExternalSource()

void Sema::addExternalSource ( IntrusiveRefCntPtr< ExternalSemaSource > E)

Registers an external source.

If an external source already exists, creates a multiplex external source and appends to it.

Parameters
[in]E- A non-null external sema source.

Definition at line 655 of file Sema.cpp.

References ExternalSource.

Referenced by clang::ASTReader::InitializeSema().

◆ AddFunctionCandidates()

◆ AddImplicitlyDeclaredMembersToClass()

void Sema::AddImplicitlyDeclaredMembersToClass ( CXXRecordDecl * ClassDecl)

AddImplicitlyDeclaredMembersToClass - Adds any implicitly-declared special functions, such as the default constructor, copy constructor, or destructor, to the given C++ class (C++ [special]p1).

This routine can only be executed just before the definition of the class is complete.

Definition at line 10764 of file SemaDeclCXX.cpp.

References Context, clang::CPlusPlus11, clang::CPlusPlus20, DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitEqualityComparison(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), findImplicitlyDeclaredEqualityComparisons(), getASTContext(), getLangOpts(), clang::CXXRecordDecl::hasInheritedAssignment(), clang::CXXRecordDecl::hasInheritedConstructor(), clang::CXXRecordDecl::hasUserDeclaredMoveAssignment(), clang::CXXRecordDecl::hasUserDeclaredMoveConstructor(), inTemplateInstantiation(), clang::TagDecl::isDependentType(), clang::CXXRecordDecl::isDynamicClass(), clang::CXXRecordDecl::needsImplicitCopyAssignment(), clang::CXXRecordDecl::needsImplicitCopyConstructor(), clang::CXXRecordDecl::needsImplicitDefaultConstructor(), clang::CXXRecordDecl::needsImplicitDestructor(), clang::CXXRecordDecl::needsImplicitMoveAssignment(), clang::CXXRecordDecl::needsImplicitMoveConstructor(), clang::CXXRecordDecl::needsOverloadResolutionForCopyAssignment(), clang::CXXRecordDecl::needsOverloadResolutionForCopyConstructor(), clang::CXXRecordDecl::needsOverloadResolutionForDestructor(), clang::CXXRecordDecl::needsOverloadResolutionForMoveAssignment(), and clang::CXXRecordDecl::needsOverloadResolutionForMoveConstructor().

Referenced by ActOnFields().

◆ AddImplicitMSFunctionNoBuiltinAttr()

void Sema::AddImplicitMSFunctionNoBuiltinAttr ( FunctionDecl * FD)

Only called on function definitions; if there is a pragma in scope with the effect of a range-based no_builtin, consider marking the function with attribute no_builtin.

Definition at line 1321 of file SemaAttr.cpp.

References clang::Decl::addAttr(), Context, clang::FunctionDecl::isDefaulted(), clang::FunctionDecl::isDeleted(), MSFunctionNoBuiltins, and V.

Referenced by ActOnFunctionDeclarator().

◆ addImplicitTypedef()

void Sema::addImplicitTypedef ( StringRef Name,
QualType T )

Definition at line 365 of file Sema.cpp.

References Context, IdResolver, PushOnScopeChains(), clang::T, and TUScope.

Referenced by Initialize().

◆ addInitCapture()

void Sema::addInitCapture ( sema::LambdaScopeInfo * LSI,
VarDecl * Var,
bool ByRef )

◆ AddInitializerToDecl()

void Sema::AddInitializerToDecl ( Decl * dcl,
Expr * init,
bool DirectInit )

AddInitializerToDecl - Adds the initializer Init to the declaration dcl.

If DirectInit is true, this is C++ direct initialization rather than copy initialization.

Definition at line 13826 of file SemaDecl.cpp.

References AbstractVariableType, ActOnFinishFullExpr(), clang::SemaOpenACC::ActOnVariableInit(), clang::C99, clang::VarDecl::CallInit, CheckAttributesOnDeducedType(), CheckCompleteVariableDeclaration(), CheckForConstantInitializer(), checkNonTrivialCUnionInInitializer(), clang::SemaObjC::checkRetainCycles(), checkUnsafeAssigns(), checkVarDeclRedefinition(), Context, clang::CPlusPlus, clang::CPlusPlus11, clang::InitializationKind::CreateForInit(), clang::FixItHint::CreateInsertion(), CreateRecoveryExpr(), currentModuleIsHeaderUnit(), DeclsToCheckForDeferredDiags, DeduceVariableDeclarationType(), clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), Diags, clang::DirectInit, ExprEvalContexts, clang::External, forceUnknownAnyToType(), clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), clang::DeclaratorDecl::getBeginLoc(), clang::VarDecl::getCanonicalDecl(), getCurFunction(), clang::NamedDecl::getDeclName(), clang::VarDecl::getDefinition(), clang::Expr::getExprLoc(), clang::NamedDecl::getFormalLinkage(), clang::VarDecl::getInit(), clang::VarDecl::getInstantiatedFromStaticDataMember(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::QualType::getObjCLifetime(), clang::VarDecl::getStorageClass(), clang::VarDecl::getTemplateSpecializationKind(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::VarDecl::hasExternalStorage(), clang::VarDecl::hasInit(), clang::VarDecl::hasLocalStorage(), clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::QualType::hasNonTrivialToPrimitiveDefaultInitializeCUnion(), HLSL(), clang::Expr::IgnoreParens(), clang::Init, InitializationSequence, clang::InitializedEntity::InitializeVariable(), clang::isa(), clang::Type::isAggregateType(), clang::VarDecl::isConstexpr(), clang::QualType::isConstQualified(), clang::Type::isDependentType(), clang::VarDecl::isExternC(), clang::VarDecl::isFileVarDecl(), clang::Type::isFloatingType(), clang::VarDecl::isInline(), clang::Type::isIntegralOrEnumerationType(), clang::Decl::isInvalidDecl(), clang::Type::isLiteralType(), clang::VarDecl::isLocalVarDecl(), clang::QualType::isNonWeakInMRRWithObjCWeak(), clang::QualType::isNull(), clang::Type::isObjCObjectPointerType(), clang::VarDecl::isOutOfLine(), clang::DeclContext::isRecord(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::VarDecl::isStaticDataMember(), clang::Decl::isTemplated(), clang::isTemplateInstantiation(), clang::VarDecl::isThisDeclarationADefinition(), clang::VarDecl::isThisDeclarationADemotedDefinition(), clang::Type::isUndeducedType(), clang::QualType::isVolatileQualified(), LangOpts, clang::VarDecl::ListInit, clang::Method, ObjC(), clang::Qualifiers::OCL_Strong, OpenACC(), clang::opencl_constant, clang::opencl_local, clang::VarDecl::ParenListInit, clang::InitializationSequence::Perform(), RequireCompleteType(), RequireNonAbstractType(), clang::Result, clang::SC_Extern, clang::SC_Static, clang::VarDecl::setConstexpr(), setFunctionHasBranchProtectedScope(), clang::VarDecl::setInit(), clang::VarDecl::setInitStyle(), clang::Decl::setInvalidDecl(), clang::VarDecl::setStorageClass(), clang::ValueDecl::setType(), clang::InitializationSequence::SK_ParenthesizedListInit, clang::InitializationSequence::step_begin(), clang::InitializationSequence::steps(), and UPPC_Initializer.

Referenced by actOnOMPReductionKindClause(), buildCaptureDecl(), buildCoroutineParameterMoves(), BuildCXXForRangeStmt(), checkOpenMPLoop(), FinishForRangeVarDecl(), InstantiateVariableInitializer(), and precomputeExpr().

◆ AddKnownFunctionAttributes()

void Sema::AddKnownFunctionAttributes ( FunctionDecl * FD)

◆ AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction()

void Sema::AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction ( FunctionDecl * FD)

If this function is a C++ replaceable global allocation function (C++2a [basic.stc.dynamic.allocation], C++2a [new.delete]), adds any function attributes that we know a priori based on the standard.

We need to check for duplicate attributes both here and where user-written attributes are applied to declarations.

Definition at line 17138 of file SemaDecl.cpp.

References clang::Decl::addAttr(), Context, clang::DeclarationName::getCXXOverloadedOperator(), clang::NamedDecl::getDeclName(), getLangOpts(), clang::Decl::getLocation(), clang::Decl::hasAttr(), clang::Decl::isInvalidDecl(), and clang::FunctionDecl::isReplaceableGlobalAllocationFunction().

Referenced by AddKnownFunctionAttributes(), and DeclareGlobalAllocationFunction().

◆ AddLaunchBoundsAttr()

void Sema::AddLaunchBoundsAttr ( Decl * D,
const AttributeCommonInfo & CI,
Expr * MaxThreads,
Expr * MinBlocks,
Expr * MaxBlocks )

AddLaunchBoundsAttr - Adds a launch_bounds attribute to a particular declaration.

Definition at line 5853 of file SemaDeclAttr.cpp.

References clang::Decl::addAttr(), and CreateLaunchBoundsAttr().

Referenced by handleLaunchBoundsAttr(), and instantiateDependentCUDALaunchBoundsAttr().

◆ addLifetimeBoundToImplicitThis()

◆ AddMemberOperatorCandidates()

void Sema::AddMemberOperatorCandidates ( OverloadedOperatorKind Op,
SourceLocation OpLoc,
ArrayRef< Expr * > Args,
OverloadCandidateSet & CandidateSet,
OverloadCandidateParamOrder PO = {} )

Add overload candidates for overloaded operators that are member functions.

Add the overloaded operator candidates that are member functions for the operator Op that was used in an operator expression such as "x Op y". , Args/NumArgs provides the operator arguments, and CandidateSet will store the added overload candidates. (C++ [over.match.oper]).

Definition at line 8803 of file SemaOverload.cpp.

References AddMethodCandidate(), clang::LookupResult::begin(), Context, clang::LookupResult::end(), clang::Type::getAsCXXRecordDecl(), clang::OverloadCandidateSet::getRewriteInfo(), isCompleteType(), clang::Type::isRecordType(), LookupOrdinaryName, LookupQualifiedName(), clang::Reversed, clang::OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed(), and clang::LookupResult::suppressAccessDiagnostics().

Referenced by CreateOverloadedArraySubscriptExpr(), CreateOverloadedUnaryOp(), and LookupOverloadedBinOp().

◆ AddMethodCandidate() [1/2]

void Sema::AddMethodCandidate ( CXXMethodDecl * Method,
DeclAccessPair FoundDecl,
CXXRecordDecl * ActingContext,
QualType ObjectType,
Expr::Classification ObjectClassification,
ArrayRef< Expr * > Args,
OverloadCandidateSet & CandidateSet,
bool SuppressUserConversions = false,
bool PartialOverloading = false,
ConversionSequenceList EarlyConversions = {},
OverloadCandidateParamOrder PO = {},
bool StrictPackMatch = false )

AddMethodCandidate - Adds the given C++ member function to the set of candidate functions, using the given function call arguments and the object argument (Object).

For example, in a call o.f(a1,a2), Object will contain o and Args will contain both a1 and a2. If SuppressUserConversions, then don't allow user-defined conversions via constructors or conversion operators.

Definition at line 7769 of file SemaOverload.cpp.

References clang::OverloadCandidateSet::addCandidate(), CheckEnableIf(), CheckFunctionConstraints(), clang::OverloadCandidate::Conversions, clang::OverloadCandidateSet::CSK_AddressOfOverloadSet, clang::CUDA, CUDA(), clang::DeductionFailureInfo::Data, clang::OverloadCandidate::DeductionFailure, clang::OverloadCandidate::ExplicitCallArguments, clang::OverloadCandidate::FailureKind, clang::OverloadCandidate::FoundDecl, clang::OverloadCandidate::Function, getCurFunctionDecl(), clang::OverloadCandidateSet::getKind(), getLangOpts(), clang::OverloadCandidateSet::getLocation(), clang::FunctionProtoType::getParamType(), clang::OverloadCandidateSet::getRewriteInfo(), clang::OverloadCandidateSet::OperatorRewriteInfo::getRewriteKind(), clang::OverloadCandidate::IgnoreObjectArgument, int, clang::isa(), clang::OverloadCandidateSet::isNewCandidate(), isNonViableMultiVersionOverload(), clang::QualType::isNull(), clang::ConstraintSatisfaction::IsSatisfied, clang::FunctionProtoType::isVariadic(), clang::Method, clang::ovl_fail_bad_conversion, clang::ovl_fail_bad_target, clang::ovl_fail_constraints_not_satisfied, clang::ovl_fail_enable_if, clang::ovl_fail_too_few_arguments, clang::ovl_fail_too_many_arguments, clang::ovl_non_default_multiversion_function, clang::Reversed, clang::OverloadCandidate::RewriteKind, clang::shouldEnforceArgLimit(), clang::OverloadCandidate::StrictPackMatch, clang::OverloadCandidate::TookAddressOfOverload, clang::TooManyArguments, TryCopyInitialization(), TryObjectArgumentInitialization(), Unevaluated, clang::Unevaluated, and clang::OverloadCandidate::Viable.

◆ AddMethodCandidate() [2/2]

void Sema::AddMethodCandidate ( DeclAccessPair FoundDecl,
QualType ObjectType,
Expr::Classification ObjectClassification,
ArrayRef< Expr * > Args,
OverloadCandidateSet & CandidateSet,
bool SuppressUserConversion = false,
OverloadCandidateParamOrder PO = {} )

◆ AddMethodTemplateCandidate()

void Sema::AddMethodTemplateCandidate ( FunctionTemplateDecl * MethodTmpl,
DeclAccessPair FoundDecl,
CXXRecordDecl * ActingContext,
TemplateArgumentListInfo * ExplicitTemplateArgs,
QualType ObjectType,
Expr::Classification ObjectClassification,
ArrayRef< Expr * > Args,
OverloadCandidateSet & CandidateSet,
bool SuppressUserConversions = false,
bool PartialOverloading = false,
OverloadCandidateParamOrder PO = {} )

Add a C++ member function template as a candidate to the candidate set, using template argument deduction to produce an appropriate member function template specialization.

Definition at line 8035 of file SemaOverload.cpp.

References clang::OverloadCandidateSet::AddDeferredMethodTemplateCandidate(), AddMethodTemplateCandidateImmediately(), getLangOpts(), clang::OverloadCandidateSet::isNewCandidate(), and clang::OverloadCandidateSet::shouldDeferTemplateArgumentDeduction().

Referenced by AddFunctionCandidates(), AddMethodCandidate(), BuildCallToMemberFunction(), LookupSpecialMember(), and LookupSpecialMemberFromXValue().

◆ AddModeAttr()

◆ AddMsStructLayoutForRecord()

void Sema::AddMsStructLayoutForRecord ( RecordDecl * RD)

AddMsStructLayoutForRecord - Adds ms_struct layout attribute to record.

Definition at line 90 of file SemaAttr.cpp.

References clang::Decl::addAttr(), Context, getLangOpts(), MSStructPragmaOn, and VtorDispStack.

Referenced by ActOnClassTemplateSpecialization(), ActOnTag(), and CheckClassTemplate().

◆ addNoClusterAttr()

void Sema::addNoClusterAttr ( Decl * D,
const AttributeCommonInfo & CI )

Add a no_cluster attribute to a particular declaration.

Definition at line 5941 of file SemaDeclAttr.cpp.

References clang::Decl::addAttr(), and Context.

Referenced by handleNoClusterAttr().

◆ AddNonMemberOperatorCandidates()

◆ AddOptnoneAttributeIfNoConflicts()

void Sema::AddOptnoneAttributeIfNoConflicts ( FunctionDecl * FD,
SourceLocation Loc )

Adds the 'optnone' attribute to the function declaration if there are no conflicts; Loc represents the location causing the 'optnone' attribute to be added (usually because of a pragma).

Definition at line 1307 of file SemaAttr.cpp.

References clang::Decl::addAttr(), Context, and clang::Decl::hasAttr().

Referenced by AddRangeBasedOptnone(), and ModifyFnAttributesMSPragmaOptimize().

◆ AddOverloadCandidate()

void Sema::AddOverloadCandidate ( FunctionDecl * Function,
DeclAccessPair FoundDecl,
ArrayRef< Expr * > Args,
OverloadCandidateSet & CandidateSet,
bool SuppressUserConversions = false,
bool PartialOverloading = false,
bool AllowExplicit = true,
bool AllowExplicitConversion = false,
ADLCallKind IsADLCandidate = ADLCallKind::NotADL,
ConversionSequenceList EarlyConversions = {},
OverloadCandidateParamOrder PO = {},
bool AggregateCandidateDeduction = false,
bool StrictPackMatch = false )

AddOverloadCandidate - Adds the given function to the set of candidate functions, using the given function call arguments.

If SuppressUserConversions, then don't allow user-defined conversions via constructors or conversion operators.

Parameters
PartialOverloadingtrue if we are performing "partial" overloading based on an incomplete set of function arguments. This feature is used by code completion.

FIXME: Currently, the semantics of linkage in clang is slightly different from the semantics in C++ spec. In C++ spec, only names have linkage. So that all entities of the same should share one linkage. But in clang, different entities of the same could have different linkage.

Don't remove inline functions with internal linkage from the overload set if they are declared in a GMF, in violation of C++ [basic.link]p17. However:

  • Inline functions with internal linkage are a common pattern in headers to avoid ODR issues.
  • The global module is meant to be a transition mechanism for C and C++ headers, and the current rules as written work against that goal.

Definition at line 7126 of file SemaOverload.cpp.

References clang::OverloadCandidateSet::addCandidate(), AddMethodCandidate(), clang::C, CheckEnableIf(), CheckFunctionConstraints(), clang::Constructor, Context, clang::OverloadCandidate::Conversions, clang::OverloadCandidateSet::CSK_Operator, CUDA(), clang::DeductionFailureInfo::Data, clang::OverloadCandidate::DeductionFailure, clang::OverloadCandidate::ExplicitCallArguments, clang::OverloadCandidate::FailureKind, clang::OverloadCandidate::FoundDecl, clang::OverloadCandidate::Function, clang::Function, clang::FunctionType::ExtParameterInfo::getABI(), getASTContext(), getCurFunctionDecl(), clang::DeclAccessPair::getDecl(), clang::OverloadCandidateSet::getDestAS(), clang::FunctionProtoType::getExtParameterInfo(), clang::NamedDecl::getFormalLinkage(), clang::ExplicitSpecifier::getFromDecl(), clang::OverloadCandidateSet::getKind(), getLangOpts(), clang::OverloadCandidateSet::getLocation(), clang::QualType::getNonReferenceType(), clang::FunctionProtoType::getNumParams(), clang::FunctionProtoType::getParamType(), clang::OverloadCandidateSet::getRewriteInfo(), clang::OverloadCandidateSet::OperatorRewriteInfo::getRewriteKind(), getType(), clang::HLSLInOut, clang::HLSLOut, clang::Internal, clang::isa(), IsAcceptableNonMemberOperatorCandidate(), clang::Qualifiers::isAddressSpaceSupersetOf(), clang::OverloadCandidate::IsADLCandidate, IsDerivedFrom(), clang::Decl::isImplicit(), clang::OverloadCandidateSet::isNewCandidate(), isNonViableMultiVersionOverload(), clang::ConstraintSatisfaction::IsSatisfied, clang::FunctionProtoType::isVariadic(), clang::Expr::Classification::makeSimpleLValue(), clang::Method, clang::ovl_fail_bad_conversion, clang::ovl_fail_bad_target, clang::ovl_fail_constraints_not_satisfied, clang::ovl_fail_enable_if, clang::ovl_fail_explicit, clang::ovl_fail_illegal_constructor, clang::ovl_fail_inhctor_slice, clang::ovl_fail_module_mismatched, clang::ovl_fail_object_addrspace_mismatch, clang::ovl_fail_too_few_arguments, clang::ovl_fail_too_many_arguments, clang::ovl_non_default_multiversion_function, clang::Reversed, clang::OverloadCandidate::RewriteKind, clang::shouldEnforceArgLimit(), clang::OverloadCandidate::StrictPackMatch, clang::TooManyArguments, TryCopyInitialization(), clang::TSK_ImplicitInstantiation, Unevaluated, clang::Unevaluated, and clang::OverloadCandidate::Viable.

Referenced by AddArgumentDependentLookupCandidates(), AddFunctionCandidates(), AddNonMemberOperatorCandidates(), AddOverloadedCallCandidate(), BuildCallToMemberFunction(), ComputeSelectedDestructor(), DeduceTemplateSpecializationFromInitializer(), DiagnoseEmptyLookup(), IsInitializerListConstructorConversion(), IsUserDefinedConversion(), LookupSpecialMember(), LookupSpecialMemberFromXValue(), resolveAllocationOverloadInterior(), resolveBuiltinNewDeleteOverload(), ResolveConstructorOverload(), TryRefInitWithConversionFunction(), TryTypoCorrectionForCall(), and TryUserDefinedConversion().

◆ AddOverloadedCallCandidates() [1/2]

void Sema::AddOverloadedCallCandidates ( LookupResult & R,
TemplateArgumentListInfo * ExplicitTemplateArgs,
ArrayRef< Expr * > Args,
OverloadCandidateSet & CandidateSet )

Add the call candidates from the given set of lookup results to the given overload set.

Non-function lookup results are ignored.

Definition at line 14363 of file SemaOverload.cpp.

References AddOverloadedCallCandidate(), clang::LookupResult::begin(), and clang::LookupResult::end().

◆ AddOverloadedCallCandidates() [2/2]

◆ AddOverriddenMethods()

◆ AddPragmaAttributes()

void Sema::AddPragmaAttributes ( Scope * S,
Decl * D )

Adds the attributes that have been specified using the '#pragma clang attribute push' directives to the given declaration.

Definition at line 1193 of file SemaAttr.cpp.

References clang::ParsedAttributesView::addAtEnd(), PragmaAttributeCurrentTargetDecl, PragmaAttributeStack, and ProcessDeclAttributeList().

Referenced by ActOnAliasDeclaration(), ActOnEnumConstant(), ActOnStartNamespaceDef(), ActOnTag(), and ProcessDeclAttributes().

◆ AddPushedVisibilityAttribute()

void Sema::AddPushedVisibilityAttribute ( Decl * RD)

AddPushedVisibilityAttribute - If '#pragma GCC visibility' was used, add an appropriate visibility attribute.

Definition at line 1393 of file SemaAttr.cpp.

References clang::Decl::addAttr(), Context, clang::NamedDecl::getExplicitVisibility(), NoVisibility, clang::ast_matchers::type, VisContext, and clang::NamedDecl::VisibilityForValue.

Referenced by ActOnFunctionDeclarator(), ActOnTag(), ActOnTagStartDefinition(), CheckClassTemplate(), and FinalizeDeclaration().

◆ AddRangeBasedOptnone()

void Sema::AddRangeBasedOptnone ( FunctionDecl * FD)

Only called on function definitions; if there is a pragma in scope with the effect of a range-based optnone, consider marking the function with attribute optnone.

Definition at line 1277 of file SemaAttr.cpp.

References AddOptnoneAttributeIfNoConflicts(), and OptimizeOffPragmaLocation.

Referenced by ActOnFunctionDeclarator(), and ActOnStartOfLambdaDefinition().

◆ AddSectionMSAllocText()

void Sema::AddSectionMSAllocText ( FunctionDecl * FD)

Only called on function definitions; if there is a #pragma alloc_text that decides which code section the function should be in, add attribute section to the function.

Definition at line 1284 of file SemaAttr.cpp.

References clang::Decl::addAttr(), Context, FunctionToSectionMap, clang::NamedDecl::getIdentifier(), clang::NamedDecl::getName(), and clang::Decl::hasAttr().

Referenced by ActOnFunctionDeclarator().

◆ AddSurrogateCandidate()

void Sema::AddSurrogateCandidate ( CXXConversionDecl * Conversion,
DeclAccessPair FoundDecl,
CXXRecordDecl * ActingContext,
const FunctionProtoType * Proto,
Expr * Object,
ArrayRef< Expr * > Args,
OverloadCandidateSet & CandidateSet )

AddSurrogateCandidate - Adds a "surrogate" candidate function that converts the given Object to a function pointer via the conversion function Conversion, and then attempts to call it with the given arguments (C++ [over.call.object]p2-4).

Proto is the type of function that we'll eventually be calling.

Definition at line 8632 of file SemaOverload.cpp.

References clang::OverloadCandidateSet::addCandidate(), CheckEnableIf(), CheckFunctionConstraints(), Context, clang::OverloadCandidate::Conversions, clang::DeductionFailureInfo::Data, clang::OverloadCandidate::DeductionFailure, clang::OverloadCandidate::ExplicitCallArguments, clang::OverloadCandidate::FailureKind, clang::OverloadCandidate::FoundDecl, clang::OverloadCandidate::Function, getLangOpts(), clang::OverloadCandidateSet::getLocation(), clang::FunctionProtoType::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::FunctionProtoType::getParamType(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::ValueDecl::getType(), clang::FunctionDecl::hasCXXExplicitFunctionObjectParameter(), clang::ImplicitConversionSequence::isBad(), clang::OverloadCandidateSet::isNewCandidate(), clang::ConstraintSatisfaction::IsSatisfied, clang::OverloadCandidate::IsSurrogate, clang::FunctionProtoType::isVariadic(), clang::ovl_fail_bad_conversion, clang::ovl_fail_constraints_not_satisfied, clang::ovl_fail_enable_if, clang::ovl_fail_too_few_arguments, clang::ovl_fail_too_many_arguments, clang::ImplicitConversionSequence::Standard, clang::OverloadCandidate::Surrogate, TryCopyInitialization(), TryObjectArgumentInitialization(), Unevaluated, clang::Unevaluated, and clang::OverloadCandidate::Viable.

Referenced by BuildCallToObjectOfClassType().

◆ AddTemplateConversionCandidate()

void Sema::AddTemplateConversionCandidate ( FunctionTemplateDecl * FunctionTemplate,
DeclAccessPair FoundDecl,
CXXRecordDecl * ActingContext,
Expr * From,
QualType ToType,
OverloadCandidateSet & CandidateSet,
bool AllowObjCConversionOnExplicit,
bool AllowExplicit,
bool AllowResultConversion = true )

◆ AddTemplateOverloadCandidate()

◆ AddTemplateParametersToLambdaCallOperator()

◆ adjustCCAndNoReturn()

QualType Sema::adjustCCAndNoReturn ( QualType ArgFunctionType,
QualType FunctionType,
bool AdjustExceptionSpec = false )

Adjust the type ArgFunctionType to match the calling convention, noreturn, and optionally the exception specification of FunctionType.

Deduction often wants to ignore these properties when matching function types.

Definition at line 4737 of file SemaTemplateDeduction.cpp.

References clang::Type::castAs(), Context, clang::FunctionProtoType::getExtProtoInfo(), clang::FunctionProtoType::getParamTypes(), clang::FunctionType::getReturnType(), clang::FunctionProtoType::hasExceptionSpec(), and clang::QualType::isNull().

Referenced by ActOnExplicitInstantiation(), CheckMemberSpecialization(), DeduceTemplateArguments(), and FindAllocationFunctions().

◆ adjustContextForLocalExternDecl()

bool Sema::adjustContextForLocalExternDecl ( DeclContext *& DC)
static

◆ AdjustDeclIfTemplate()

TemplateDecl * Sema::AdjustDeclIfTemplate ( Decl *& Decl)

AdjustDeclIfTemplate - If the given decl happens to be a template, reset the parameter D to reference the templated declaration and return a pointer to the template declaration.

Otherwise, do nothing to D and return null.

Definition at line 928 of file SemaTemplate.cpp.

Referenced by ActOnBaseSpecifier(), ActOnBaseSpecifiers(), ActOnFinishCXXMemberSpecification(), ActOnFinishDelayedCXXMethodDeclaration(), ActOnMemInitializers(), ActOnReenterTemplateScope(), ActOnStartCXXMemberDeclarations(), ActOnStartDelayedMemberDeclarations(), ActOnTagDefinitionError(), ActOnTagFinishDefinition(), ActOnTagStartDefinition(), BuildMemInitializer(), and SetDeclDeleted().

◆ AdjustDestructorExceptionSpec()

void Sema::AdjustDestructorExceptionSpec ( CXXDestructorDecl * Destructor)

Build an exception spec for destructors that don't have one.

C++11 says that user-defined destructors with no exception spec get one that looks as if the destructor was implicitly declared.

Definition at line 14634 of file SemaDeclCXX.cpp.

References Context, clang::CPlusPlus11, clang::Destructor, clang::EST_Unevaluated, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, getLangOpts(), clang::FunctionProtoType::ExceptionSpecInfo::SourceDecl, and clang::FunctionProtoType::ExceptionSpecInfo::Type.

Referenced by CreateNewFunctionDecl().

◆ adjustMemberFunctionCC()

void Sema::adjustMemberFunctionCC ( QualType & T,
bool HasThisPointer,
bool IsCtorOrDtor,
SourceLocation Loc )

Adjust the calling convention of a method to be the ABI default if it wasn't specified explicitly.

This handles method types formed from function type typedefs and typename template arguments.

Definition at line 8252 of file SemaType.cpp.

References clang::cast(), clang::CC_X86StdCall, ConstructorDestructor, Context, clang::SemaBase::Diag(), clang::FunctionType::getCallConv(), clang::FunctionType::getExtInfo(), clang::FunctionType::getNameForCallConv(), hasExplicitCallingConv(), clang::isa(), clang::T, and clang::FunctionType::ExtInfo::withCallingConv().

Referenced by ActOnFunctionDeclarator(), BuildMemberPointerType(), and DeduceTemplateArgumentsByTypeMatch().

◆ AMDGPU()

◆ anyAltivecTypes()

◆ ApplyAPINotesType()

void Sema::ApplyAPINotesType ( Decl * D,
StringRef TypeString )

◆ applyFunctionAttributesBeforeParsingBody()

void Sema::applyFunctionAttributesBeforeParsingBody ( Decl * FD)

◆ ApplyNullability()

◆ AreConstraintExpressionsEqual()

bool Sema::AreConstraintExpressionsEqual ( const NamedDecl * Old,
const Expr * OldConstr,
const TemplateCompareNewDeclInfo & New,
const Expr * NewConstr )

◆ areLaxCompatibleVectorTypes()

bool Sema::areLaxCompatibleVectorTypes ( QualType srcType,
QualType destType )

Are the two types lax-compatible vector types?

That is, given that one of them is a vector, do they have equal storage sizes, where the storage size is the number of elements times the element size?

This will also return false if either of the types is neither a vector nor a real type.

Definition at line 7778 of file SemaExpr.cpp.

References areVectorTypesSameSize(), clang::Type::isExtVectorType(), clang::Type::isScalarType(), and clang::Type::isVectorType().

Referenced by CheckExtVectorCast(), CheckVectorCast(), and isLaxVectorConversion().

◆ areMatrixTypesOfTheSameDimension()

bool Sema::areMatrixTypesOfTheSameDimension ( QualType srcTy,
QualType destTy )

Are the two types matrix types and do they have the same dimensions i.e.

do they have the same number of rows and the same number of columns?

Definition at line 7725 of file SemaExpr.cpp.

References clang::Type::getAs(), clang::ConstantMatrixType::getNumColumns(), clang::ConstantMatrixType::getNumRows(), and clang::Type::isMatrixType().

Referenced by CheckMatrixCast().

◆ areMultiversionVariantFunctionsCompatible()

◆ areVectorTypesSameSize()

bool Sema::areVectorTypesSameSize ( QualType srcType,
QualType destType )

Definition at line 7736 of file SemaExpr.cpp.

References breakDownVectorType(), Context, and clang::Type::isVectorType().

Referenced by areLaxCompatibleVectorTypes().

◆ ArgumentDependentLookup()

◆ ARM()

◆ AttachBaseSpecifiers()

◆ AttachTypeConstraint() [1/2]

◆ AttachTypeConstraint() [2/2]

bool Sema::AttachTypeConstraint ( NestedNameSpecifierLoc NS,
DeclarationNameInfo NameInfo,
TemplateDecl * NamedConcept,
NamedDecl * FoundDecl,
const TemplateArgumentListInfo * TemplateArgs,
TemplateTypeParmDecl * ConstrainedParameter,
SourceLocation EllipsisLoc )

◆ AVR()

SemaAVR & clang::Sema::AVR ( )
inline

Definition at line 1433 of file Sema.h.

Referenced by handleInterruptAttr(), and ProcessDeclAttribute().

◆ BoundsSafetyCheckAssignmentToCountAttrPtr()

bool clang::Sema::BoundsSafetyCheckAssignmentToCountAttrPtr ( QualType LHSTy,
Expr * RHSExpr,
AssignmentAction Action,
SourceLocation Loc,
const ValueDecl * Assignee,
bool ShowFullyQualifiedAssigneeName )

Perform Bounds Safety Semantic checks for assigning to a __counted_by or __counted_by_or_null pointer type.

Parameters
LHSTy.
LHSTyThe type being assigned to. Checks will only be performed if the type is a counted_by or counted_by_or_null pointer.
RHSExprThe expression being assigned from.
ActionThe type assignment being performed
LocThe SourceLocation to use for error diagnostics
AssigneeThe ValueDecl being assigned. This is used to compute the name of the assignee. If the assignee isn't known this can be set to nullptr.
ShowFullyQualifiedAssigneeNameIf set to true when using Assignee to compute the name of the assignee use the fully qualified name, otherwise use the unqualified name.
Returns
True iff no diagnostic where emitted, false otherwise.

Definition at line 342 of file SemaBoundsSafety.cpp.

References clang::CheckAssignmentToCountAttrPtrWithIncompletePointeeTy().

Referenced by CheckAssignmentOperands().

◆ BoundsSafetyCheckInitialization()

bool clang::Sema::BoundsSafetyCheckInitialization ( const InitializedEntity & Entity,
const InitializationKind & Kind,
AssignmentAction Action,
QualType LHSType,
Expr * RHSExpr )

Perform Bounds Safety Semantic checks for initializing a Bounds Safety pointer.

Parameters
EntityThe entity being initialized
KindThe kind of initialization being performed
ActionThe type assignment being performed
LHSTyThe type being assigned to. Checks will only be performed if the type is a counted_by or counted_by_or_null pointer.
RHSExprThe expression being used for initialization.
Returns
True iff no diagnostic where emitted, false otherwise.

Definition at line 350 of file SemaBoundsSafety.cpp.

References clang::CheckAssignmentToCountAttrPtrWithIncompletePointeeTy(), clang::InitializedEntity::EK_Variable, clang::InitializedEntity::getDecl(), clang::InitializedEntity::getKind(), and clang::Initializing.

Referenced by clang::InitializationSequence::Perform().

◆ BoundsSafetyCheckUseOfCountAttrPtr()

bool clang::Sema::BoundsSafetyCheckUseOfCountAttrPtr ( const Expr * E)

Perform Bounds Safety semantic checks for uses of invalid uses counted_by or counted_by_or_null pointers in.

Parameters
E.
Ethe expression to check
Returns
True iff no diagnostic where emitted, false otherwise.

Definition at line 378 of file SemaBoundsSafety.cpp.

References clang::SemaBase::Diag(), clang::EmitIncompleteCountedByPointeeNotes(), clang::Stmt::getBeginLoc(), clang::GetCountedByAttrOnIncompletePointee(), getPrintingPolicy(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::IgnoreParens(), clang::Stmt::printPretty(), and clang::T.

Referenced by DefaultLvalueConversion().

◆ BPF()

SemaBPF & clang::Sema::BPF ( )
inline

Definition at line 1438 of file Sema.h.

Referenced by ProcessDeclAttribute(), and ProcessDeclAttributeDelayed().

◆ BuildAddressSpaceAttr() [1/2]

QualType Sema::BuildAddressSpaceAttr ( QualType & T,
Expr * AddrSpace,
SourceLocation AttrLoc )

Same as above, but constructs the AddressSpace index if not provided.

Definition at line 6524 of file SemaType.cpp.

References BuildAddressSpaceAttr(), BuildAddressSpaceIndex(), and clang::T.

◆ BuildAddressSpaceAttr() [2/2]

QualType Sema::BuildAddressSpaceAttr ( QualType & T,
LangAS ASIdx,
Expr * AddrSpace,
SourceLocation AttrLoc )

BuildAddressSpaceAttr - Builds a DependentAddressSpaceType if an expression is uninstantiated.

If instantiated it will apply the appropriate address space to the type. This function allows dependent template variables to be used in conjunction with the address_space attribute

Definition at line 6501 of file SemaType.cpp.

References Context, clang::SemaBase::Diag(), DiagnoseMultipleAddrSpaceAttributes(), clang::Expr::isValueDependent(), and clang::T.

Referenced by BuildAddressSpaceAttr(), and HandleAddressSpaceTypeAttribute().

◆ BuildAnonymousStructOrUnion()

Decl * Sema::BuildAnonymousStructOrUnion ( Scope * S,
DeclSpec & DS,
AccessSpecifier AS,
RecordDecl * Record,
const PrintingPolicy & Policy )

BuildAnonymousStructOrUnion - Handle the declaration of an anonymous structure or union.

Anonymous unions are a C++ feature (C++ [class.union]) and a C11 feature; anonymous structures are a C11 feature and GNU C++ extension.

Definition at line 5674 of file SemaDecl.cpp.

References ActOnUninitializedDecl(), clang::DeclContext::addDecl(), clang::AS_none, clang::AS_protected, clang::AS_public, clang::C11, clang::cast(), checkDuplicateDefaultInit(), CheckNontrivialField(), clang::DeclSpec::ClearTypeQualifiers(), Context, clang::CPlusPlus, clang::FieldDecl::Create(), clang::VarDecl::Create(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::SemaBase::Diag(), FieldCollector, clang::DeclSpec::getAtomicSpecLoc(), clang::DeclSpec::getBeginLoc(), clang::DeclSpec::getConstSpecLoc(), getCurrentMangleNumberContext(), getLangOpts(), clang::MangleNumberingContext::getManglingNumber(), getMSManglingNumber(), clang::DeclContext::getRedeclContext(), clang::DeclSpec::getRestrictSpecLoc(), clang::DeclSpec::getSourceRange(), clang::MangleNumberingContext::getStaticLocalNumber(), clang::DeclSpec::getStorageClassSpec(), clang::DeclSpec::getStorageClassSpecLoc(), GetTypeForDeclarator(), clang::DeclSpec::getTypeQualifiers(), clang::DeclSpec::getUnalignedSpecLoc(), clang::DeclSpec::getVolatileSpecLoc(), clang::ICIS_NoInit, InjectAnonymousStructOrUnionMembers(), clang::Invalid, clang::isa(), clang::DeclContext::isNamespace(), clang::DeclContext::isRecord(), clang::DeclContext::isTranslationUnit(), clang::Member, clang::ParsedAttributesView::none(), ProcessDeclAttributes(), clang::SC_None, clang::DeclSpec::SCS_mutable, clang::DeclSpec::SCS_static, clang::DeclSpec::SCS_unspecified, clang::Decl::setAccess(), clang::Decl::setImplicit(), clang::Decl::setInvalidDecl(), clang::DeclSpec::SetStorageClassSpec(), StorageClassSpecToVarDeclStorageClass(), clang::DeclSpec::TQ_atomic, clang::DeclSpec::TQ_const, clang::DeclSpec::TQ_restrict, clang::DeclSpec::TQ_unaligned, and clang::DeclSpec::TQ_volatile.

Referenced by ParsedFreeStandingDeclSpec().

◆ BuildAnonymousStructUnionMemberReference()

◆ BuildArrayType()

QualType Sema::BuildArrayType ( QualType T,
ArraySizeModifier ASM,
Expr * ArraySize,
unsigned Quals,
SourceRange Brackets,
DeclarationName Entity )

Build an array type.

Parameters
TThe type of each element in the array.
ASMC99 array size modifier (e.g., '*', 'static').
ArraySizeExpression describing the size of the array.
BracketsThe range from the opening '[' to the closing ']'.
EntityThe name of the entity that involves the array type, if known.
Returns
A suitable array type, if there are no errors. Otherwise, returns a NULL type.

Definition at line 2049 of file SemaType.cpp.

References clang::C99, checkArrayElementAlignment(), checkArraySize(), CheckPlaceholderExpr(), Context, clang::CPlusPlus, clang::CPlusPlus11, CUDA(), DefaultLvalueConversion(), clang::SemaBase::Diag(), clang::SourceRange::getBegin(), clang::Stmt::getBeginLoc(), getCurFunction(), getLangOpts(), clang::ConstantArrayType::getMaxSizeBits(), clang::ConstantArrayType::getNumAddressingBits(), getPrintableNameForEntity(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::hasPlaceholderType(), clang::Expr::IgnoreParenImpCasts(), clang::Type::isBlockPointerType(), isCompleteType(), clang::Type::isImageType(), clang::Type::isIntegralOrUnscopedEnumerationType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isPipeType(), clang::Expr::isPRValue(), clang::Type::isSamplerT(), isSFINAEContext(), clang::Expr::isTypeDependent(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Expr::isValueDependent(), clang::Normal, OpenCL(), OpenMP(), RequireCompleteSizedType(), RequireNonAbstractType(), clang::Result, clang::Star, clang::T, targetDiag(), and toString().

Referenced by GetFullTypeForDeclarator().

◆ BuildArrayTypeTrait()

◆ BuildAsTypeExpr()

ExprResult Sema::BuildAsTypeExpr ( Expr * E,
QualType DestTy,
SourceLocation BuiltinLoc,
SourceLocation RParenLoc )

◆ BuildAtomicExpr()

ExprResult Sema::BuildAtomicExpr ( SourceRange CallRange,
SourceRange ExprRange,
SourceLocation RParenLoc,
MultiExprArg Args,
AtomicExpr::AtomicOp Op,
AtomicArgumentOrder ArgOrder = AtomicArgumentOrder::API )

Definition at line 4445 of file SemaChecking.cpp.

References clang::Arithmetic, AST, clang::Type::castAs(), CheckNonNullArgument(), Context, clang::Copy, clang::Default, DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), clang::Type::getAs(), clang::SourceRange::getBegin(), clang::AtomicExpr::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::SourceRange::getEnd(), clang::Expr::getExprLoc(), clang::QualType::getObjCLifetime(), clang::Type::getPointeeType(), clang::QualType::getPointerAuth(), clang::AtomicExpr::getScopeModel(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), ImpCastExprToType(), clang::Init, clang::InitializedEntity::InitializeParameter(), clang::PointerAuthQualifier::isAddressDiscriminated(), clang::Type::isAtomicType(), clang::Type::isBitIntType(), clang::QualType::isConstQualified(), clang::Type::isFloatingType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isPointerType(), clang::Type::isScalarType(), clang::Type::isSpecificBuiltinType(), clang::QualType::isTriviallyCopyableType(), isValidOrderingForOp(), clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, clang::opencl_constant, PerformCopyInitialization(), clang::ast_matchers::pointerType, clang::QualType::removeLocalConst(), clang::QualType::removeLocalVolatile(), RequireCompleteType(), clang::Result, Success, and clang::QualType::withCVRQualifiers().

Referenced by clang::TreeTransform< AdjustConstraints >::RebuildAtomicExpr().

◆ BuildAtomicType()

◆ BuildAttributedStmt()

StmtResult Sema::BuildAttributedStmt ( SourceLocation AttrsLoc,
ArrayRef< const Attr * > Attrs,
Stmt * SubStmt )

◆ BuildBaseInitializer()

◆ BuildBasePathArray()

◆ BuildBinOp()

◆ BuildBitIntType()

QualType Sema::BuildBitIntType ( bool IsUnsigned,
Expr * BitWidth,
SourceLocation Loc )

Build a bit-precise integer type.

Parameters
IsUnsignedBoolean representing the signedness of the type.
BitWidthSize of this int type in bits, or an expression representing that.
LocLocation of the keyword.

Definition at line 1941 of file SemaType.cpp.

References clang::Allow, Context, clang::SemaBase::Diag(), getASTContext(), clang::TargetInfo::getMaxBitIntWidth(), clang::ASTContext::getTargetInfo(), clang::Expr::isInstantiationDependent(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and VerifyIntegerConstantExpression().

Referenced by ConvertDeclSpecToType().

◆ BuildBlockForLambdaConversion()

◆ BuildBlockPointerType()

QualType Sema::BuildBlockPointerType ( QualType T,
SourceLocation Loc,
DeclarationName Entity )

Build a block pointer type.

Parameters
TThe type to which we'll be building a block pointer.
LocThe source location, used for diagnostics.
EntityThe name of the entity that involves the block pointer type, if known.
Returns
A suitable block pointer type, if there are no errors. Otherwise, returns a NULL type.

Definition at line 2776 of file SemaType.cpp.

References checkQualifiedFunction(), Context, deduceOpenCLPointeeAddrSpace(), clang::SemaBase::Diag(), getLangOpts(), OpenCL(), and clang::T.

Referenced by GetFullTypeForDeclarator().

◆ BuildBuiltinBitCastExpr()

◆ BuildBuiltinCallExpr()

Expr * Sema::BuildBuiltinCallExpr ( SourceLocation Loc,
Builtin::ID Id,
MultiExprArg CallArgs )

◆ BuildBuiltinOffsetOf()

ExprResult Sema::BuildBuiltinOffsetOf ( SourceLocation BuiltinLoc,
TypeSourceInfo * TInfo,
ArrayRef< OffsetOfComponent > Components,
SourceLocation RParenLoc )

◆ BuildCallExpr()

ExprResult Sema::BuildCallExpr ( Scope * S,
Expr * Fn,
SourceLocation LParenLoc,
MultiExprArg ArgExprs,
SourceLocation RParenLoc,
Expr * ExecConfig = nullptr,
bool IsExecConfig = false,
bool AllowRecovery = false )

BuildCallExpr - Handle a call to Fn with the specified array of arguments.

This provides the location of the left/right parens and a list of comma locations.

Definition at line 6647 of file SemaExpr.cpp.

References BuildCallToMemberFunction(), BuildCallToObjectOfClassType(), BuildOverloadedCallExpr(), BuildResolvedCallExpr(), clang::cast(), checkAddressOfFunctionIsAvailable(), CheckArgsForPlaceholders(), checkDirectCallValidity(), CheckPlaceholderExpr(), Context, clang::CPlusPlus, clang::CallExpr::Create(), clang::CUDAKernelCallExpr::Create(), clang::DeclRefExpr::Create(), clang::ImplicitCastExpr::Create(), clang::FixItHint::CreateRemoval(), CurFPFeatureOverrides(), clang::Default, clang::SemaBase::Diag(), clang::ExprError(), clang::OverloadExpr::FindResult::Expression, clang::OverloadExpr::find(), clang::FunctionArg, clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), getASTContext(), clang::FunctionDecl::getBuiltinID(), getLangOpts(), clang::Type::getPointeeType(), clang::DeclaratorDecl::getQualifierLoc(), clang::ASTContext::getTargetAddressSpace(), clang::ValueDecl::getType(), getType(), clang::Expr::hasAnyTypeDependentArguments(), clang::OverloadExpr::FindResult::HasFormOfMemberPointer, clang::HIP, clang::Expr::IgnoreParens(), ImpCastExprToType(), clang::isa(), clang::OverloadExpr::FindResult::IsAddressOfOperand, clang::OverloadExpr::FindResult::IsAddressOfOperandWithParen, clang::ActionResult< PtrTy, Compress >::isInvalid(), MaybeConvertParenListExprToParenExpr(), MayBeFunctionType(), rebuildUnknownAnyFunction(), clang::Result, rewriteBuiltinFunctionDecl(), clang::Qualifiers::setAddressSpace(), tryImplicitlyCaptureThisIfImplicitMemberFunctionAccessWithDependentArgs(), and clang::VK_PRValue.

Referenced by ActOnCallExpr(), BuildBuiltinCallExpr(), BuildCallToObjectOfClassType(), buildCoroutineHandle(), BuildForRangeBeginEndCall(), buildMemberCall(), buildMemcpyForAssignmentOp(), BuildRecoveryCallExpr(), checkTupleLikeDecomposition(), DefaultVariadicArgumentPromotion(), EvaluateAsStringImpl(), and tryToRecoverWithCall().

◆ BuildCallToMemberFunction()

ExprResult Sema::BuildCallToMemberFunction ( Scope * S,
Expr * MemExpr,
SourceLocation LParenLoc,
MultiExprArg Args,
SourceLocation RParenLoc,
Expr * ExecConfig = nullptr,
bool IsExecConfig = false,
bool AllowRecovery = false )

BuildCallToMemberFunction - Build a call to a member function.

MemExpr is the expression that refers to the member function (and includes the object parameter), Args/NumArgs are the arguments to the function call (not including the object parameter). The caller needs to validate that the member expression refers to a non-static member function or an overloaded member function.

Definition at line 16084 of file SemaOverload.cpp.

References AddMethodCandidate(), AddMethodTemplateCandidate(), AddOverloadCandidate(), clang::AS_public, clang::OverloadCandidateSet::BestViableFunction(), BuildResolvedCallExpr(), clang::cast(), clang::Type::castAs(), checkArgPlaceholdersForOverload(), CheckCallReturnType(), CheckEnableIf(), CheckForImmediateInvocation(), CheckFunctionCall(), CheckUnresolvedMemberAccess(), CheckVirtualDtorCall(), chooseRecoveryType(), clang::Expr::Classify(), Context, ConvertArgumentsForCall(), clang::OverloadExpr::copyTemplateArgumentsInto(), clang::CallExpr::Create(), clang::CXXMemberCallExpr::Create(), CreateFunctionRefExpr(), CreateRecoveryExpr(), clang::OverloadCandidateSet::CSK_Normal, CurContext, CurFPFeatureOverrides(), clang::OverloadExpr::decls_begin(), clang::OverloadExpr::decls_end(), Diag(), DiagnoseSentinelCalls(), DiagnoseUseOfDeletedFunction(), DiagnoseUseOfOverloadedDecl(), clang::ExprError(), FixOverloadedFunctionReference(), clang::Func, clang::ActionResult< PtrTy, Compress >::get(), clang::Qualifiers::getAsString(), clang::MemberExpr::getBase(), clang::UnresolvedMemberExpr::getBase(), clang::UnresolvedMemberExpr::getBaseType(), clang::DeclaratorDecl::getBeginLoc(), clang::MemberExpr::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::UnresolvedMemberExpr::getBeginLoc(), clang::FunctionType::getCallResultType(), clang::DeclAccessPair::getDecl(), clang::NamedDecl::getDeclName(), GetExplicitObjectType(), clang::MemberExpr::getExprLoc(), clang::MemberExpr::getFoundDecl(), getLangOpts(), clang::MemberExpr::getMemberDecl(), clang::MemberExpr::getMemberLoc(), clang::UnresolvedMemberExpr::getMemberLoc(), clang::UnresolvedMemberExpr::getMemberName(), clang::FunctionProtoType::getMethodQuals(), clang::OverloadExpr::getNameLoc(), clang::QualType::getNonLValueExprType(), clang::FunctionProtoType::getNumParams(), clang::DeclContext::getParent(), getPointeeType(), clang::MemberExpr::getQualifier(), clang::OverloadExpr::getQualifier(), clang::QualType::getQualifiers(), clang::FunctionType::getReturnType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::Expr::getValueKindForType(), clang::OverloadExpr::hasExplicitTemplateArgs(), clang::MemberExpr::hasQualifier(), clang::Expr::IgnoreParenCasts(), clang::Expr::IgnoreParens(), clang::isa(), clang::UnresolvedMemberExpr::isArrow(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::DeclAccessPair::make(), clang::Expr::Classification::makeSimpleLValue(), MaybeBindToTemporary(), clang::Method, clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::SemaBase::PDiag(), PerformImplicitObjectArgumentInitialization(), clang::MemberExpr::performsVirtualDispatch(), PrepareExplicitObjectArgument(), clang::Qualifiers::removeAddressSpace(), clang::Qualifiers::removeObjCGCAttr(), clang::MemberExpr::setBase(), clang::OverloadCandidateSet::size(), and clang::VK_PRValue.

Referenced by BuildCallExpr(), buildSingleCopyAssignRecursively(), and tryExprAsCall().

◆ BuildCallToObjectOfClassType()

ExprResult Sema::BuildCallToObjectOfClassType ( Scope * S,
Expr * Object,
SourceLocation LParenLoc,
MultiExprArg Args,
SourceLocation RParenLoc )

BuildCallToObjectOfClassType - Build a call to an object of class type (C++ [over.call.object]), which can end up invoking an overloaded function call operator (operator()) or performing a user-defined conversion on the object argument.

Definition at line 16409 of file SemaOverload.cpp.

References AddMethodCandidate(), AddSurrogateCandidate(), clang::LookupResult::begin(), clang::OverloadCandidateSet::begin(), clang::OverloadCandidateSet::BestViableFunction(), BuildCallExpr(), BuildCXXMemberCallExpr(), clang::Call, clang::cast(), checkArgPlaceholdersForOverload(), CheckCallReturnType(), CheckForImmediateInvocation(), CheckFunctionCall(), CheckMemberOperatorAccess(), checkPlaceholderForOverload(), Context, Conversions, clang::CXXOperatorCallExpr::Create(), clang::ImplicitCastExpr::Create(), CreateFunctionRefExpr(), clang::OverloadCandidateSet::CSK_Operator, CurFPFeatureOverrides(), DefaultVariadicArgumentPromotion(), DiagnoseSentinelCalls(), DiagnoseUseOfDecl(), clang::OverloadCandidateSet::empty(), clang::LookupResult::end(), clang::OverloadCandidateSet::end(), clang::ExprError(), clang::OverloadCandidate::FailureKind, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::CXXConversionDecl::getConversionType(), clang::Decl::getDeclContext(), clang::DeclarationNameInfo::getInfo(), clang::DeclarationNameInfo::getLoc(), clang::QualType::getNonLValueExprType(), clang::QualType::getNonReferenceType(), clang::FunctionProtoType::getNumParams(), clang::Type::getPointeeType(), clang::StringLiteral::getString(), clang::Expr::getValueKindForType(), clang::isa(), clang::LookupResult::isAmbiguous(), clang::CXXConversionDecl::isExplicit(), clang::ActionResult< PtrTy, Compress >::isInvalid(), LookupOrdinaryName, LookupQualifiedName(), MaybeBindToTemporary(), clang::Method, clang::OverloadCandidateSet::nonDeferredCandidatesCount(), clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::ovl_fail_constraints_not_satisfied, clang::SemaBase::PDiag(), PerformImplicitObjectArgumentInitialization(), PrepareArgumentsForCallToObjectOfClassType(), PrepareExplicitObjectArgument(), RequireCompleteType(), clang::DeclarationNameInfo::setCXXOperatorNameRange(), clang::OverloadCandidateSet::size(), clang::LookupResult::suppressAccessDiagnostics(), clang::OverloadCandidate::Viable, and clang::VK_PRValue.

Referenced by BuildCallExpr().

◆ BuildCaptureField()

◆ BuildCaptureInit()

◆ BuildCodeAlignAttr()

◆ BuildCompoundLiteralExpr()

ExprResult Sema::BuildCompoundLiteralExpr ( SourceLocation LParenLoc,
TypeSourceInfo * TInfo,
SourceLocation RParenLoc,
Expr * LiteralExpr )

Definition at line 7228 of file SemaExpr.cpp.

References CheckForConstantInitializer(), checkNonTrivialCUnion(), checkNonTrivialCUnionInInitializer(), Cleanup, clang::CompoundLiteral, Context, clang::CPlusPlus, clang::ConstantExpr::Create(), clang::InitializationKind::CreateCStyleCast(), CurContext, clang::Default, clang::SemaBase::Diag(), ExprCleanupObjects, clang::ExprError(), clang::QualType::getAddressSpace(), getCurFunction(), getCurScope(), clang::SourceRange::getEnd(), clang::ArraySubscriptExpr::getExprLoc(), getLangOpts(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::TypeSourceInfo::getType(), clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::QualType::hasNonTrivialToPrimitiveDefaultInitializeCUnion(), clang::QualType::hasNonTrivialToPrimitiveDestructCUnion(), clang::Init, InitializationSequence, clang::InitializedEntity::InitializeCompoundLiteralInit(), clang::Type::isArrayType(), clang::Type::isDependentType(), clang::QualType::isDestructedType(), clang::Scope::isFunctionPrototypeScope(), clang::Scope::isInCFunctionScope(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::Type::isVariableArrayType(), LangOpts, MaybeBindToTemporary(), NTCUK_Destruct, clang::opencl_private, clang::InitializationSequence::Perform(), RequireCompleteSizedType(), RequireCompleteType(), clang::Result, clang::sema::FunctionScopeInfo::setHasBranchProtectedScope(), tryToFixVariablyModifiedVarType(), clang::VK_LValue, and clang::VK_PRValue.

Referenced by ActOnCompoundLiteral(), BuildVectorLiteral(), and clang::TreeTransform< AdjustConstraints >::RebuildCompoundLiteralExpr().

◆ BuildConvertedConstantExpression()

ExprResult Sema::BuildConvertedConstantExpression ( Expr * From,
QualType T,
CCEKind CCE,
NamedDecl * Dest = nullptr )

Definition at line 6515 of file SemaOverload.cpp.

References clang::T.

Referenced by CheckTemplateArgument(), and EvaluateAsStringImpl().

◆ BuildCoreturnStmt()

◆ BuildCoroutineBodyStmt()

◆ buildCoroutineParameterMoves()

◆ buildCoroutinePromise()

◆ BuildCountAttributedArrayOrPointerType()

QualType Sema::BuildCountAttributedArrayOrPointerType ( QualType WrappedTy,
Expr * CountExpr,
bool CountInBytes,
bool OrNull )

When the resulting expression is invalid, we still create the AST using the original count expression for the sake of AST dump.

Definition at line 9732 of file SemaType.cpp.

References BuildTypeCoupledDecls(), Context, clang::Type::isIncompleteArrayType(), and clang::Type::isPointerType().

Referenced by handleCountedByAttrField().

◆ BuildCoyieldExpr()

◆ BuildCStyleCastExpr()

◆ BuildCXXAssumeExpr()

◆ BuildCXXConstructExpr() [1/3]

ExprResult Sema::BuildCXXConstructExpr ( SourceLocation ConstructLoc,
QualType DeclInitType,
CXXConstructorDecl * Constructor,
bool Elidable,
MultiExprArg Exprs,
bool HadMultipleCandidates,
bool IsListInitialization,
bool IsStdInitListInitialization,
bool RequiresZeroInit,
CXXConstructionKind ConstructKind,
SourceRange ParenRange )

Build a CXXConstructExpr whose constructor has already been resolved if it denotes an inherited constructor.

BuildCXXConstructExpr - Creates a complete call to a constructor, including handling of its default argument expressions.

Definition at line 16327 of file SemaDeclCXX.cpp.

References CheckForImmediateInvocation(), clang::Constructor, Context, clang::CXXConstructExpr::Create(), clang::CUDA, CUDA(), clang::declaresSameEntity(), clang::ExprError(), clang::Type::getAsCXXRecordDecl(), clang::Type::getBaseElementTypeUnsafe(), getLangOpts(), and MarkFunctionReferenced().

◆ BuildCXXConstructExpr() [2/3]

ExprResult Sema::BuildCXXConstructExpr ( SourceLocation ConstructLoc,
QualType DeclInitType,
NamedDecl * FoundDecl,
CXXConstructorDecl * Constructor,
bool Elidable,
MultiExprArg Exprs,
bool HadMultipleCandidates,
bool IsListInitialization,
bool IsStdInitListInitialization,
bool RequiresZeroInit,
CXXConstructionKind ConstructKind,
SourceRange ParenRange )

◆ BuildCXXConstructExpr() [3/3]

ExprResult Sema::BuildCXXConstructExpr ( SourceLocation ConstructLoc,
QualType DeclInitType,
NamedDecl * FoundDecl,
CXXConstructorDecl * Constructor,
MultiExprArg Exprs,
bool HadMultipleCandidates,
bool IsListInitialization,
bool IsStdInitListInitialization,
bool RequiresZeroInit,
CXXConstructionKind ConstructKind,
SourceRange ParenRange )

◆ BuildCXXDefaultArgExpr()

◆ BuildCXXDefaultInitExpr()

◆ BuildCXXFoldExpr()

ExprResult Sema::BuildCXXFoldExpr ( UnresolvedLookupExpr * Callee,
SourceLocation LParenLoc,
Expr * LHS,
BinaryOperatorKind Operator,
SourceLocation EllipsisLoc,
Expr * RHS,
SourceLocation RParenLoc,
UnsignedOrNone NumExpansions )

◆ BuildCXXForRangeStmt()

StmtResult Sema::BuildCXXForRangeStmt ( SourceLocation ForLoc,
SourceLocation CoawaitLoc,
Stmt * InitStmt,
SourceLocation ColonLoc,
Stmt * RangeDecl,
Stmt * Begin,
Stmt * End,
Expr * Cond,
Expr * Inc,
Stmt * LoopVarDecl,
SourceLocation RParenLoc,
BuildForRangeKind Kind,
ArrayRef< MaterializeTemporaryExpr * > LifetimeExtendTemps = {} )

BuildCXXForRangeStmt - Build or instantiate a C++11 for-range statement.

Definition at line 2689 of file SemaStmt.cpp.

References ActOnBinOp(), ActOnCoawaitExpr(), ActOnDeclStmt(), ActOnFinishFullExpr(), clang::SemaOpenMP::ActOnOpenMPLoopInitialization(), ActOnUnaryExprOrTypeTraitExpr(), ActOnUnaryOp(), AddInitializerToDecl(), clang::InitializedEntity::allocateManglingNumber(), BFRK_Build, BFRK_Check, BuildDeclRefExpr(), BuildNonArrayForRange(), clang::cast(), CheckBooleanCondition(), clang::Cond, clang::Expr::containsErrors(), Context, ConvertDeclToDeclGroup(), clang::CPlusPlus17, clang::CPlusPlus23, clang::IntegerLiteral::Create(), CreateParsedType(), clang::OverloadCandidateSet::CSK_Normal, clang::SemaBase::Diag(), FinishForRangeVarDecl(), FRS_NoViableFunction, FRS_Success, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsArrayTypeUnsafe(), getCurScope(), clang::DeclRefExpr::getDecl(), clang::Scope::getDepth(), clang::VarDecl::getInit(), getLangOpts(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), clang::DeclStmt::getSingleDecl(), clang::VarDecl::getSourceRange(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::InitializedEntity::InitializeVariable(), clang::Type::isArrayType(), clang::Type::isDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::SourceLocation::isInvalid(), clang::Decl::isInvalidDecl(), clang::Type::isPointerType(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::SourceLocation::isValid(), clang::Decl::markUsed(), clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, OpenMP(), clang::SemaBase::PDiag(), RebuildForRangeWithDereference(), RequireCompleteType(), clang::ValueDecl::setType(), clang::StmtError(), SubstAutoTypeDependent(), and clang::VK_LValue.

Referenced by ActOnCXXForRangeStmt(), and clang::TreeTransform< AdjustConstraints >::RebuildCXXForRangeStmt().

◆ BuildCXXFunctionalCastExpr()

◆ BuildCXXMemberCallExpr()

◆ BuildCXXNamedCast()

◆ BuildCXXNestedNameSpecifier()

bool Sema::BuildCXXNestedNameSpecifier ( Scope * S,
NestedNameSpecInfo & IdInfo,
bool EnteringContext,
CXXScopeSpec & SS,
NamedDecl * ScopeLookupResult,
bool ErrorRecoveryLookup,
bool * IsCorrectedToColon = nullptr,
bool OnlyNamespace = false )

Build a new nested-name-specifier for "identifier::", as described by ActOnCXXNestedNameSpecifier.

Parameters
SScope in which the nested-name-specifier occurs.
IdInfoParser information about an identifier in the nested-name-spec.
EnteringContextIf true, enter the context specified by the nested-name-specifier.
SSOptional nested name specifier preceding the identifier.
ScopeLookupResultProvides the result of name lookup within the scope of the nested-name-specifier that was computed at template definition time.
ErrorRecoveryLookupSpecifies if the method is called to improve error recovery and what kind of recovery is performed.
IsCorrectedToColonIf not null, suggestion of replace '::' -> ':' are allowed. The bool value pointed by this parameter is set to 'true' if the identifier is treated as if it was followed by ':', not '::'.
OnlyNamespaceIf true, only considers namespaces in lookup.

This routine differs only slightly from ActOnCXXNestedNameSpecifier, in that it contains an extra parameter ScopeLookupResult, which provides the result of name lookup within the scope of the nested-name-specifier that was computed at template definition time.

If ErrorRecoveryLookup is true, then this call is used to improve error recovery. This means that it should not emit diagnostics, it should just return true on failure. It also means it should only return a valid scope if it knows that the result is correct. It should not return in a dependent context, for example. Nor will it extend SS with the scope specifier.

Definition at line 449 of file SemaCXXScopeSpec.cpp.

References clang::cast(), clang::Sema::NestedNameSpecInfo::CCLoc, clang::CXXScopeSpec::clear(), clang::TypeLocBuilder::clear(), computeDeclContext(), Context, CorrectTypo(), clang::CPlusPlus11, clang::FixItHint::CreateReplacement(), CurContext, clang::SemaBase::Diag(), diagnoseTypo(), DiagnoseUnknownTypeName(), DiagnoseUseOfDecl(), clang::LookupResult::empty(), clang::ErrorRecovery, clang::CXXScopeSpec::Extend(), ExtendNestedNameSpecifier(), clang::Found, clang::LookupResult::getAsSingle(), clang::DeclarationName::getAsString(), clang::NestedNameSpecifier::getAsType(), clang::Decl::getCanonicalDecl(), getLangOpts(), clang::Decl::getLocation(), clang::LookupResult::getNameLoc(), clang::DeclContext::getParent(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), GetTypeFromParser(), clang::TypeLocBuilder::getTypeLocInContext(), clang::NamedDecl::getUnderlyingDecl(), clang::CXXScopeSpec::getWithLocInContext(), clang::CXXRecordDecl::hasAnyDependentBases(), clang::Sema::NestedNameSpecInfo::Identifier, clang::Sema::NestedNameSpecInfo::IdentifierLoc, clang::isa(), isAcceptableNestedNameSpecifier(), clang::DeclContext::isDependentContext(), isDependentScopeSpecifier(), clang::Type::isDependentType(), clang::IdentifierInfo::isEditorPlaceholder(), clang::DeclContext::isFunctionOrMethod(), clang::QualType::isNull(), clang::DeclContext::isRecord(), clang::CXXScopeSpec::isSet(), LookupName(), LookupNamespaceName, LookupNestedNameSpecifierName, LookupOrdinaryName, LookupQualifiedName(), clang::CXXScopeSpec::Make(), clang::CXXScopeSpec::MakeTrivial(), MarkAnyDeclReferenced(), clang::None, clang::Sema::NestedNameSpecInfo::ObjectType, clang::SemaBase::PDiag(), clang::TypeLocBuilder::push(), RequireCompleteDeclContext(), clang::Result, clang::DependentNameTypeLoc::setElaboratedKeywordLoc(), clang::TagTypeLoc::setElaboratedKeywordLoc(), clang::LookupResult::suppressDiagnostics(), and clang::T.

Referenced by ActOnCXXNestedNameSpecifier(), and IsInvalidUnlessNestedName().

◆ BuildCXXNew()

ExprResult Sema::BuildCXXNew ( SourceRange Range,
bool UseGlobal,
SourceLocation PlacementLParen,
MultiExprArg PlacementArgs,
SourceLocation PlacementRParen,
SourceRange TypeIdParens,
QualType AllocType,
TypeSourceInfo * AllocTypeInfo,
std::optional< Expr * > ArraySize,
SourceRange DirectInitRange,
Expr * Initializer )

Definition at line 2139 of file SemaExprCXX.cpp.

References clang::alignedAllocationModeFromBool(), clang::AlreadyDiagnosed, clang::Both, clang::Braces, clang::cast(), CheckAllocatedType(), CheckArgsForPlaceholders(), checkArrayElementAlignment(), checkCall(), CheckPlaceholderExpr(), Context, clang::Converting, clang::CPlusPlus14, clang::CPlusPlus17, clang::CPlusPlus20, clang::CXXNewExpr::Create(), clang::IntegerLiteral::Create(), clang::InitializationKind::CreateDefault(), clang::InitializationKind::CreateDirect(), clang::InitializationKind::CreateDirectList(), clang::FixItHint::CreateRemoval(), DeduceAutoType(), DeduceTemplateSpecializationFromInitializer(), clang::SemaBase::Diag(), DiagnoseSentinelCalls(), DiagnoseUseOfDecl(), clang::DoesNotApply, doesUsualArrayDeleteWantSize(), clang::ExprError(), FindAllocationFunctions(), clang::Function, GatherArgumentsForCall(), clang::ActionResult< PtrTy, Compress >::get(), clang::SourceRange::getBegin(), clang::Stmt::getBeginLoc(), clang::Type::getContainedDeducedType(), clang::SourceRange::getEnd(), clang::Expr::getExprLoc(), getLangOpts(), clang::Decl::getLocation(), clang::ConstantArrayType::getMaxSizeBits(), clang::ConstantArrayType::getNumAddressingBits(), clang::Type::getObjCARCImplicitLifetime(), clang::QualType::getObjCLifetime(), getSourceManager(), clang::Stmt::getSourceRange(), clang::TypeLoc::getSourceRange(), getStdAlignValT(), clang::Expr::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::Global, clang::Expr::hasAnyTypeDependentArguments(), InitializationSequence, clang::InitializedEntity::InitializeNew(), clang::Initializer, clang::Inits, clang::isa(), clang::isAlignedAllocation(), clang::Type::isDependentType(), clang::Type::isEnumeralType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), isLegalArrayNewInitializer(), clang::QualType::isNull(), clang::Type::isObjCLifetimeType(), clang::isTypeAwareAllocation(), clang::SourceLocation::isValid(), clang::SourceRange::isValid(), MarkFunctionReferenced(), clang::None, clang::Normal, clang::Qualifiers::OCL_None, clang::OK_Ordinary, clang::ImplicitCastExpr::OnStack, clang::Parens, clang::ImplicitAllocationParameters::PassAlignment, clang::ImplicitAllocationParameters::PassTypeIdentity, clang::InitializationSequence::Perform(), PerformContextualImplicitConversion(), PerformImplicitConversion(), clang::Result, Sema(), ShouldUseTypeAwareOperatorNewOrDelete(), StdAlignValT, clang::Success, clang::T, toString(), and clang::VK_PRValue.

Referenced by ActOnCXXNew(), and clang::TreeTransform< AdjustConstraints >::RebuildCXXNewExpr().

◆ BuildCXXNoexceptExpr()

◆ BuildCXXThisExpr()

◆ BuildCXXThrow()

◆ BuildCXXTypeConstructExpr()

ExprResult Sema::BuildCXXTypeConstructExpr ( TypeSourceInfo * Type,
SourceLocation LParenLoc,
MultiExprArg Exprs,
SourceLocation RParenLoc,
bool ListInitialization )

Definition at line 1522 of file SemaExprCXX.cpp.

References clang::AlreadyDiagnosed, BuildCXXFunctionalCastExpr(), clang::cast(), Context, clang::CPlusPlus23, clang::CXXFunctionalCastExpr::Create(), clang::CXXUnresolvedConstructExpr::Create(), clang::InitializationKind::CreateDirect(), clang::InitializationKind::CreateDirectList(), clang::InitializationKind::CreateValue(), CurFPFeatureOverrides(), DeduceAutoType(), DeduceTemplateSpecializationFromInitializer(), clang::SemaBase::Diag(), clang::ExprError(), clang::Type::getAs(), clang::SourceRange::getBegin(), clang::Stmt::getBeginLoc(), clang::TypeLoc::getBeginLoc(), clang::Type::getContainedDeducedType(), clang::SourceRange::getEnd(), clang::Expr::getExprLoc(), getLangOpts(), clang::QualType::getNonReferenceType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::QualType::getUnqualifiedType(), clang::Expr::getValueKindForType(), clang::Expr::hasAnyTypeDependentArguments(), InitializationSequence, clang::InitializedEntity::InitializeTemporary(), clang::Inits, clang::isa(), clang::Type::isArrayType(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::QualType::isNull(), clang::Type::isVoidType(), clang::InitializationSequence::Perform(), RequireCompleteType(), clang::Result, clang::Success, and clang::VK_PRValue.

Referenced by ActOnCXXTypeConstructExpr(), clang::TreeTransform< AdjustConstraints >::RebuildCXXFunctionalCastExpr(), clang::TreeTransform< AdjustConstraints >::RebuildCXXScalarValueInitExpr(), clang::TreeTransform< AdjustConstraints >::RebuildCXXTemporaryObjectExpr(), and clang::TreeTransform< AdjustConstraints >::RebuildCXXUnresolvedConstructExpr().

◆ BuildCXXTypeId() [1/2]

◆ BuildCXXTypeId() [2/2]

◆ BuildCXXUuidof() [1/2]

ExprResult Sema::BuildCXXUuidof ( QualType TypeInfoType,
SourceLocation TypeidLoc,
Expr * Operand,
SourceLocation RParenLoc )

◆ BuildCXXUuidof() [2/2]

ExprResult Sema::BuildCXXUuidof ( QualType TypeInfoType,
SourceLocation TypeidLoc,
TypeSourceInfo * Operand,
SourceLocation RParenLoc )

◆ BuildDeclarationNameExpr() [1/2]

◆ BuildDeclarationNameExpr() [2/2]

◆ BuildDeclaratorGroup()

◆ BuildDeclRefExpr() [1/3]

DeclRefExpr * Sema::BuildDeclRefExpr ( ValueDecl * D,
QualType Ty,
ExprValueKind VK,
const DeclarationNameInfo & NameInfo,
const CXXScopeSpec * SS = nullptr,
NamedDecl * FoundD = nullptr,
SourceLocation TemplateKWLoc = SourceLocation(),
const TemplateArgumentListInfo * TemplateArgs = nullptr )

◆ BuildDeclRefExpr() [2/3]

◆ BuildDeclRefExpr() [3/3]

◆ BuildDecltypeType()

QualType Sema::BuildDecltypeType ( Expr * E,
bool AsUnevaluated = true )

◆ BuildDelegatingInitializer()

◆ BuildDependentDeclRefExpr()

◆ BuildEmptyCXXFoldExpr()

◆ BuildExceptionDeclaration()

VarDecl * Sema::BuildExceptionDeclaration ( Scope * S,
TypeSourceInfo * TInfo,
SourceLocation StartLoc,
SourceLocation IdLoc,
const IdentifierInfo * Id )

◆ BuildExpressionFromDeclTemplateArgument()

ExprResult Sema::BuildExpressionFromDeclTemplateArgument ( const TemplateArgument & Arg,
QualType ParamType,
SourceLocation Loc,
NamedDecl * TemplateParam = nullptr )

Given a non-type template argument that refers to a declaration and the type of its corresponding non-type template parameter, produce an expression that properly refers to that declaration.

FIXME: This is used in some contexts where the resulting expression doesn't need to live too long. It would be useful if this function could return a temporary expression.

Definition at line 7909 of file SemaTemplate.cpp.

References BuildDeclarationNameExpr(), clang::cast(), Context, CreateBuiltinUnaryOp(), clang::TemplateArgument::Declaration, DefaultFunctionArrayConversion(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getArrayElementTypeNoTypeQual(), clang::Type::getAs(), clang::TemplateArgument::getAsDecl(), getASTContext(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::Expr::getExprLoc(), clang::TemplateArgument::getKind(), clang::QualType::getNonLValueExprType(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::CanQual< T >::getTypePtr(), clang::Expr::getValueKind(), ImpCastExprToType(), clang::isa(), clang::Type::isArrayType(), IsFunctionConversion(), clang::Type::isFunctionType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isLValue(), clang::Type::isMemberPointerType(), clang::QualType::isNull(), clang::Type::isPointerType(), clang::DeclContext::isRecord(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::Type::isVoidPointerType(), clang::CXXScopeSpec::MakeTrivial(), clang::TemplateArgument::NullPtr, and clang::TemplateParam.

Referenced by BuildExpressionFromNonTypeTemplateArgument(), and getTrivialTemplateArgumentLoc().

◆ BuildExpressionFromNonTypeTemplateArgument()

◆ BuildExpressionTrait()

◆ BuildExprRequirement() [1/2]

concepts::ExprRequirement * Sema::BuildExprRequirement ( concepts::Requirement::SubstitutionDiagnostic * ExprSubstDiag,
bool IsSatisfied,
SourceLocation NoexceptLoc,
concepts::ExprRequirement::ReturnTypeRequirement ReturnTypeRequirement )

Definition at line 7944 of file SemaExprCXX.cpp.

References Context.

◆ BuildExprRequirement() [2/2]

concepts::ExprRequirement * Sema::BuildExprRequirement ( Expr * E,
bool IsSatisfied,
SourceLocation NoexceptLoc,
concepts::ExprRequirement::ReturnTypeRequirement ReturnTypeRequirement )

◆ BuildExtVectorType()

◆ BuildFieldReferenceExpr()

◆ BuildForRangeBeginEndCall()

Sema::ForRangeStatus Sema::BuildForRangeBeginEndCall ( SourceLocation Loc,
SourceLocation RangeLoc,
const DeclarationNameInfo & NameInfo,
LookupResult & MemberLookup,
OverloadCandidateSet * CandidateSet,
Expr * Range,
ExprResult * CallExpr )

Build a call to 'begin' or 'end' for a C++11 for-range statement.

If the given LookupResult is non-empty, it is assumed to describe a member which will be invoked. Otherwise, the function will be found via argument dependent lookup. CallExpr is set to a valid expression and FRS_Success returned on success, otherwise CallExpr is set to ExprError() and some non-success value is returned.

Definition at line 16885 of file SemaOverload.cpp.

References clang::OverloadCandidateSet::BestViableFunction(), BuildCallExpr(), BuildMemberReferenceExpr(), buildOverloadedCallSet(), clang::cast(), clang::OverloadCandidateSet::clear(), CreateUnresolvedLookupExpr(), clang::OverloadCandidateSet::CSK_Normal, clang::LookupResult::empty(), clang::OverloadCandidateSet::empty(), clang::ExprError(), FinishOverloadedCallExpr(), FRS_DiagnosticIssued, FRS_NoViableFunction, FRS_Success, clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::OR_No_Viable_Function, and clang::OR_Success.

Referenced by BuildNonArrayForRange().

◆ BuildFunctionType()

QualType Sema::BuildFunctionType ( QualType T,
MutableArrayRef< QualType > ParamTypes,
SourceLocation Loc,
DeclarationName Entity,
const FunctionProtoType::ExtProtoInfo & EPI )

Build a function type.

This routine checks the function type according to C++ rules and under the assumption that the result type and parameter types have just been instantiated from a template. It therefore duplicates some of the behavior of GetTypeForDeclarator, but in a much simpler form that is only suitable for this narrow use case.

Parameters
TThe return type of the function.
ParamTypesThe parameter types of the function. This array will be modified to account for adjustments to the types of the function parameters.
LocThe location of the entity whose type involves this function type or, if there is no such entity, the location of the type that will have function type.
EntityThe name of the entity that involves the function type, if known.
EPIExtra information about the function type. Usually this will be taken from an existing function with the same prototype.
Returns
A suitable function type, if there are no errors. The unqualified type will always be a FunctionProtoType. Otherwise, returns a NULL type.

Definition at line 2662 of file SemaType.cpp.

References checkExtParameterInfos(), CheckFunctionReturnType(), clang::SemaObjC::checkNSReturnsRetainedReturnType(), Context, clang::CPlusPlus20, clang::FixItHint::CreateInsertion(), clang::SemaBase::Diag(), clang::FunctionProtoType::ExtProtoInfo::ExtInfo, clang::FunctionProtoType::ExtProtoInfo::ExtParameterInfos, getLangOpts(), clang::QualType::getPointerAuth(), clang::FunctionType::ExtInfo::getProducesResult(), clang::Invalid, clang::Type::isHalfType(), clang::Type::isVoidType(), clang::QualType::isVolatileQualified(), clang::Type::isWebAssemblyTableType(), ObjC(), and clang::T.

Referenced by SubstituteExplicitTemplateArguments().

◆ BuildIfStmt()

StmtResult Sema::BuildIfStmt ( SourceLocation IfLoc,
IfStatementKind StatementKind,
SourceLocation LParenLoc,
Stmt * InitStmt,
ConditionResult Cond,
SourceLocation RParenLoc,
Stmt * ThenVal,
SourceLocation ElseLoc,
Stmt * ElseVal )

◆ BuildImplicitMemberExpr()

ExprResult Sema::BuildImplicitMemberExpr ( const CXXScopeSpec & SS,
SourceLocation TemplateKWLoc,
LookupResult & R,
const TemplateArgumentListInfo * TemplateArgs,
bool IsDefiniteInstance,
const Scope * S )

Builds an implicit member access expression.

The current context is known to be an instance method, and the given unqualified lookup set is known to contain only instance members, at least one of which is from an appropriate type.

Definition at line 1851 of file SemaExprMember.cpp.

References BuildCXXThisExpr(), BuildMemberReferenceExpr(), clang::LookupResult::empty(), clang::SourceRange::getBegin(), getCurrentThisType(), getLangOpts(), clang::LookupResult::getNameLoc(), clang::CXXScopeSpec::getRange(), HLSL(), clang::LookupResult::isAmbiguous(), clang::QualType::isNull(), and clang::SourceRange::isValid().

Referenced by BuildPossibleImplicitMemberExpr().

◆ BuildInitList()

◆ BuildLambdaExpr()

ExprResult Sema::BuildLambdaExpr ( SourceLocation StartLoc,
SourceLocation EndLoc )

Complete a lambda-expression having processed and attached the lambda body.

Definition at line 2141 of file SemaLambda.cpp.

References ActOnFields(), addBlockPointerConversion(), addFunctionPointerConversions(), AnalysisWarnings, BuildCaptureField(), BuildCaptureInit(), clang::sema::LambdaScopeInfo::CallOperator, clang::sema::LambdaScopeInfo::CaptureDefaultLoc, clang::sema::CapturingScopeInfo::Captures, clang::cast(), CheckCompletedCXXClass(), CheckConstexprFunctionDefinition(), clang::SemaCUDA::CheckLambdaCapture(), CheckValid, clang::Class, Cleanup, clang::sema::LambdaScopeInfo::Cleanup, ConstantEvaluated, clang::Constexpr, ConstructFixItRangeForUnusedCapture(), clang::sema::CapturingScopeInfo::ContainsUnexpandedParameterPack, Context, clang::CPlusPlus17, clang::CPlusPlus20, clang::LambdaExpr::Create(), clang::FixItHint::CreateInsertion(), CUDA(), CurContext, clang::SemaBase::Diag(), DiagnoseShadowingLambdaDecls(), DiagnoseUnusedLambdaCapture(), DiscardedStatement, clang::sema::LambdaScopeInfo::ExplicitCaptureRanges, clang::sema::LambdaScopeInfo::ExplicitParams, clang::ExprError(), ExprEvalContexts, FunctionScopes, clang::SourceRange::getBegin(), clang::FunctionDecl::getBody(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::sema::Capture::getEllipsisLoc(), clang::SourceRange::getEnd(), getLangOpts(), clang::sema::Capture::getLocation(), getLocForEndOfToken(), clang::sema::Capture::getVariable(), clang::sema::CapturingScopeInfo::HasImplicitReturnType, ImmediateFunctionContext, clang::sema::CapturingScopeInfo::ImpCaptureStyle, clang::Init, clang::sema::LambdaScopeInfo::IntroducerRange, clang::isa(), clang::sema::Capture::isBlockCapture(), clang::FunctionDecl::isConstexpr(), clang::sema::Capture::isCopyCapture(), clang::sema::Capture::isInitCapture(), clang::sema::Capture::isInvalid(), clang::Decl::isInvalidDecl(), clang::sema::Capture::isNonODRUsed(), clang::sema::Capture::isODRUsed(), clang::sema::Capture::isThisCapture(), clang::SourceRange::isValid(), clang::sema::Capture::isVariableCapture(), clang::sema::Capture::isVLATypeCapture(), clang::sema::LambdaScopeInfo::Lambda, LangOpts, clang::LCD_ByCopy, clang::LCD_None, clang::LCK_ByCopy, clang::LCK_ByRef, clang::LCK_StarThis, clang::LCK_This, clang::LCK_VLAType, mapImplicitCaptureStyle(), maybeAddDeclWithEffects(), MaybeBindToTemporary(), clang::sema::LambdaScopeInfo::NumExplicitCaptures, ObjC(), PopExpressionEvaluationContext(), PopFunctionScopeInfo(), PotentiallyEvaluated, PotentiallyEvaluatedIfUsed, clang::FunctionDecl::setConstexprKind(), clang::Decl::setLexicalDeclContext(), Unevaluated, UnevaluatedAbstract, UnevaluatedList, and clang::Unspecified.

Referenced by ActOnLambdaExpr(), and clang::TreeTransform< AdjustConstraints >::RebuildLambdaExpr().

◆ buildLambdaInitCaptureInitialization()

◆ buildLambdaScope()

◆ BuildLiteralOperatorCall()

ExprResult Sema::BuildLiteralOperatorCall ( LookupResult & R,
DeclarationNameInfo & SuffixInfo,
ArrayRef< Expr * > Args,
SourceLocation LitEndLoc,
TemplateArgumentListInfo * ExplicitTemplateArgs = nullptr )

◆ BuildMatrixType()

◆ BuildMemberExpr()

◆ BuildMemberInitializer()

◆ BuildMemberPointerType()

QualType Sema::BuildMemberPointerType ( QualType T,
const CXXScopeSpec & SS,
CXXRecordDecl * Cls,
SourceLocation Loc,
DeclarationName Entity )

Build a member pointer type T Class::*.

Parameters
Tthe type to which the member pointer refers.
Classthe class type into which the member pointer points.
Locthe location where this type begins
Entitythe name of the entity that will have this member pointer type
Returns
a member pointer type, if successful, or a NULL type if there was an error.

Definition at line 2715 of file SemaType.cpp.

References adjustMemberFunctionCC(), CheckDistantExceptionSpec(), computeDeclContext(), Context, clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXDestructorName, clang::SemaBase::Diag(), clang::DeclarationName::getAsIdentifierInfo(), clang::CXXScopeSpec::getBeginLoc(), getLangOpts(), clang::DeclarationName::getNameKind(), getOpenCLOptions(), getPrintableNameForEntity(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), HLSL(), isDependentScopeSpecifier(), clang::SourceLocation::isValid(), OpenCL(), and clang::T.

Referenced by GetFullTypeForDeclarator().

◆ BuildMemberReferenceExpr() [1/2]

ExprResult Sema::BuildMemberReferenceExpr ( Expr * Base,
QualType BaseType,
SourceLocation OpLoc,
bool IsArrow,
const CXXScopeSpec & SS,
SourceLocation TemplateKWLoc,
NamedDecl * FirstQualifierInScope,
LookupResult & R,
const TemplateArgumentListInfo * TemplateArgs,
const Scope * S,
bool SuppressQualifierCheck = false,
ActOnMemberAccessExtraArgs * ExtraArgs = nullptr )

Definition at line 869 of file SemaExprMember.cpp.

References ActOnDependentMemberExpr(), ActOnMemberAccessExpr(), ActOnStartCXXMemberReference(), clang::LookupResult::begin(), BuildAnonymousStructUnionMemberReference(), BuildCXXThisExpr(), BuildDeclarationNameExpr(), BuildFieldReferenceExpr(), BuildMemberExpr(), BuildMSPropertyRefExpr(), BuildTemplateIdExpr(), clang::cast(), CheckQualifiedMemberReference(), CheckVarTemplateId(), computeDeclContext(), Context, clang::CPlusPlus, clang::UnresolvedMemberExpr::Create(), clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), diagnoseMissingTemplateArguments(), DiagnoseUseOfDecl(), clang::LookupResult::empty(), clang::LookupResult::end(), clang::Enum, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::SourceRange::getBegin(), getCurFunctionDecl(), getCurScope(), clang::DeclarationName::getCXXOverloadedOperator(), clang::LookupResult::getFoundDecl(), getLangOpts(), clang::DeclarationNameInfo::getLoc(), clang::Decl::getLocation(), clang::LookupResult::getLookupName(), clang::LookupResult::getLookupNameInfo(), clang::DeclarationNameInfo::getName(), clang::LookupResult::getNameLoc(), clang::QualType::getNonReferenceType(), clang::UnresolvedSetIterator::getPair(), getPointeeType(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::Stmt::getSourceRange(), clang::VarDecl::getTemplateSpecializationKind(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::CXXScopeSpec::getWithLocInContext(), clang::Sema::SFINAETrap::hasErrorOccurred(), clang::Sema::ActOnMemberAccessExtraArgs::Id, IgnoredValueConversions(), clang::Expr::IgnoreImpCasts(), int, clang::isa(), clang::LookupResult::isAmbiguous(), clang::NamedDecl::isCXXInstanceMember(), clang::NestedNameSpecifier::isDependent(), isDependentScopeSpecifier(), clang::Type::isDependentType(), clang::CXXScopeSpec::isEmpty(), IsInFnTryBlockHandler(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::CXXScopeSpec::isInvalid(), clang::Decl::isInvalidDecl(), clang::LookupResult::isOverloadedResult(), clang::Expr::isPRValue(), clang::CXXScopeSpec::isSet(), clang::LookupResult::isSingleResult(), clang::Expr::isTypeDependent(), clang::LookupResult::isUnresolvableResult(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::SourceLocation::isValid(), clang::SourceRange::isValid(), clang::Sema::ActOnMemberAccessExtraArgs::ObjCImpDecl, clang::OK_Ordinary, clang::Sema::ActOnMemberAccessExtraArgs::S, clang::LookupResult::setBaseObjectType(), clang::VarDecl::setTemplateSpecializationKind(), clang::LookupResult::suppressDiagnostics(), TemporaryMaterializationConversion(), clang::TSK_ImplicitInstantiation, clang::ast_matchers::type, clang::VK_LValue, clang::VK_PRValue, and clang::LookupResult::wasNotFoundInCurrentInstantiation().

◆ BuildMemberReferenceExpr() [2/2]

◆ BuildMemInitializer()

MemInitResult Sema::BuildMemInitializer ( Decl * ConstructorD,
Scope * S,
CXXScopeSpec & SS,
IdentifierInfo * MemberOrBase,
ParsedType TemplateTypeTy,
const DeclSpec & DS,
SourceLocation IdLoc,
Expr * Init,
SourceLocation EllipsisLoc )

Handle a C++ member initializer.

Definition at line 4387 of file SemaDeclCXX.cpp.

References AdjustDeclIfTemplate(), clang::CXXRecordDecl::bases(), BuildBaseInitializer(), BuildDecltypeType(), BuildMemberInitializer(), BuildPackIndexingType(), clang::cast(), clang::TypeLoc::castAs(), CheckTypenameType(), clang::LookupResult::clear(), computeDeclContext(), clang::Constructor, Context, CorrectTypo(), clang::CPlusPlus20, Diag(), diagnoseTypo(), clang::LookupResult::empty(), clang::ErrorRecovery, FindBaseInitializer(), clang::OpaquePtr< PtrTy >::get(), clang::LookupResult::getAsSingle(), clang::CXXBaseSpecifier::getBeginLoc(), clang::DeclSpec::getBeginLoc(), clang::TypoCorrection::getCorrectionDeclAs(), clang::DeclSpec::getEllipsisLoc(), getLangOpts(), clang::Decl::getLocation(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupNameInfo(), clang::DeclSpec::getPackIndexingExpr(), clang::DeclSpec::getRepAsExpr(), clang::DeclSpec::getRepAsType(), clang::CXXScopeSpec::getScopeRep(), clang::CXXBaseSpecifier::getSourceRange(), clang::CXXBaseSpecifier::getType(), GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::DeclSpec::getTypeSpecType(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::CXXScopeSpec::getWithLocInContext(), clang::Init, clang::LookupResult::isAmbiguous(), isDependentScopeSpecifier(), clang::CXXScopeSpec::isEmpty(), clang::TypeLoc::isNull(), clang::CXXScopeSpec::isSet(), clang::SourceLocation::isValid(), LookupOrdinaryName, LookupParsedName(), MarkAnyDeclReferenced(), clang::Member, clang::None, clang::SemaBase::PDiag(), clang::TypeLocBuilder::push(), clang::TypeLocBuilder::pushTypeSpec(), clang::DependentNameTypeLoc::setElaboratedKeywordLoc(), clang::TagTypeLoc::setElaboratedKeywordLoc(), clang::LookupResult::setLookupName(), clang::DependentNameTypeLoc::setNameLoc(), clang::TypeSpecTypeLoc::setNameLoc(), clang::DependentNameTypeLoc::setQualifierLoc(), clang::LookupResult::suppressDiagnostics(), tryLookupCtorInitMemberDecl(), clang::TST_decltype, clang::TST_decltype_auto, and clang::TST_typename_pack_indexing.

Referenced by ActOnMemInitializer(), and ActOnMemInitializer().

◆ BuildMicrosoftCAnonymousStruct()

Decl * Sema::BuildMicrosoftCAnonymousStruct ( Scope * S,
DeclSpec & DS,
RecordDecl * Record )

◆ BuildModuleInclude()

◆ BuildMSDependentExistsStmt()

StmtResult Sema::BuildMSDependentExistsStmt ( SourceLocation KeywordLoc,
bool IsIfExists,
NestedNameSpecifierLoc QualifierLoc,
DeclarationNameInfo NameInfo,
Stmt * Nested )

◆ BuildNestedRequirement() [1/2]

◆ BuildNestedRequirement() [2/2]

concepts::NestedRequirement * Sema::BuildNestedRequirement ( StringRef InvalidConstraintEntity,
const ASTConstraintSatisfaction & Satisfaction )

Definition at line 7983 of file SemaExprCXX.cpp.

References Context, and clang::ASTConstraintSatisfaction::Rebuild().

◆ BuildOperatorCoawaitCall()

ExprResult Sema::BuildOperatorCoawaitCall ( SourceLocation Loc,
Expr * E,
UnresolvedLookupExpr * Lookup )

◆ BuildOperatorCoawaitLookupExpr()

◆ BuildOverloadedArrowExpr()

ExprResult Sema::BuildOverloadedArrowExpr ( Scope * S,
Expr * Base,
SourceLocation OpLoc,
bool * NoArrowOperatorFound = nullptr )

BuildOverloadedArrowExpr - Build a call to an overloaded operator-> (if one exists), where Base is an expression of class type and Member is the name of the member we're trying to find.

Definition at line 16679 of file SemaOverload.cpp.

References AddMethodCandidate(), clang::LookupResult::begin(), clang::OverloadCandidateSet::BestViableFunction(), clang::cast(), CheckCallReturnType(), CheckForImmediateInvocation(), CheckFunctionCall(), CheckMemberOperatorAccess(), checkPlaceholderForOverload(), clang::OverloadCandidateSet::CompleteCandidates(), Context, clang::CXXOperatorCallExpr::Create(), CreateFunctionRefExpr(), clang::FixItHint::CreateReplacement(), clang::OverloadCandidateSet::CSK_Operator, CurFPFeatureOverrides(), Diag(), clang::OverloadCandidateSet::empty(), clang::LookupResult::end(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getNonLValueExprType(), clang::StringLiteral::getString(), clang::Expr::getValueKindForType(), InitializeExplicitObjectArgument(), clang::LookupResult::isAmbiguous(), clang::ActionResult< PtrTy, Compress >::isInvalid(), LookupOrdinaryName, LookupQualifiedName(), MaybeBindToTemporary(), clang::Method, clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::SemaBase::PDiag(), PerformImplicitObjectArgumentInitialization(), RequireCompleteType(), clang::OverloadCandidateSet::size(), and clang::LookupResult::suppressAccessDiagnostics().

Referenced by ActOnStartCXXMemberReference().

◆ BuildOverloadedCallExpr()

ExprResult Sema::BuildOverloadedCallExpr ( Scope * S,
Expr * Fn,
UnresolvedLookupExpr * ULE,
SourceLocation LParenLoc,
MultiExprArg Args,
SourceLocation RParenLoc,
Expr * ExecConfig,
bool AllowTypoCorrection = true,
bool CalleesAddressIsTaken = false )

BuildOverloadedCallExpr - Given the call expression that calls Fn (which eventually refers to the declaration Func) and the call arguments Args/NumArgs, attempt to resolve the function call down to a specific function.

If overload resolution succeeds, returns the call expression produced by overload resolution. Otherwise, emits diagnostics and returns ExprError.

Definition at line 14855 of file SemaOverload.cpp.

References clang::OverloadCandidateSet::BestViableFunction(), buildOverloadedCallSet(), Context, clang::CallExpr::Create(), clang::OverloadCandidateSet::CSK_AddressOfOverloadSet, clang::OverloadCandidateSet::CSK_Normal, clang::CUDA, CurContext, CurFPFeatureOverrides(), clang::OverloadCandidateSet::end(), FinishOverloadedCallExpr(), clang::FunctionDecl::getReturnType(), clang::FunctionDecl::getTemplateInstantiationPattern(), clang::FunctionDecl::isTemplateInstantiation(), clang::Type::isUndeducedType(), LangOpts, markUnaddressableCandidatesUnviable(), clang::OR_No_Viable_Function, clang::OR_Success, clang::VK_PRValue, and clang::FunctionDecl::willHaveBody().

Referenced by BuildCallExpr().

◆ buildOverloadedCallSet()

◆ BuildPackIndexingExpr()

◆ BuildPackIndexingType()

◆ BuildParenType()

QualType Sema::BuildParenType ( QualType T)

Build a paren type including T.

Definition at line 1675 of file SemaType.cpp.

References Context, and clang::T.

Referenced by GetFullTypeForDeclarator().

◆ BuildParmVarDeclForTypedef()

ParmVarDecl * Sema::BuildParmVarDeclForTypedef ( DeclContext * DC,
SourceLocation Loc,
QualType T )

Synthesizes a variable for a parameter arising from a typedef.

Definition at line 15707 of file SemaDecl.cpp.

References Context, clang::ParmVarDecl::Create(), clang::SC_None, and clang::T.

Referenced by ActOnBlockArguments(), ActOnFunctionDeclarator(), and DeclClonePragmaWeak().

◆ BuildPointerType()

QualType Sema::BuildPointerType ( QualType T,
SourceLocation Loc,
DeclarationName Entity )

Build a pointer type.

Parameters
TThe type to which we'll be building a pointer.
LocThe location of the entity whose type involves this pointer type or, if there is no such entity, the location of the type that will have pointer type.
EntityThe name of the entity that involves the pointer type, if known.
Returns
A suitable pointer type, if there are no errors. Otherwise, returns a NULL type.

Definition at line 1805 of file SemaType.cpp.

References checkQualifiedFunction(), Context, deduceOpenCLPointeeAddrSpace(), clang::SemaBase::Diag(), getASTContext(), getLangOpts(), getOpenCLOptions(), getPrintableNameForEntity(), HLSL(), inferARCLifetimeForPointee(), clang::SourceLocation::isValid(), OpenCL(), and clang::T.

Referenced by BuiltinAddPointer(), and GetFullTypeForDeclarator().

◆ BuildPossibleImplicitMemberExpr()

◆ BuildPredefinedExpr()

◆ BuildPseudoDestructorExpr()

◆ BuildQualifiedDeclarationNameExpr()

ExprResult Sema::BuildQualifiedDeclarationNameExpr ( CXXScopeSpec & SS,
const DeclarationNameInfo & NameInfo,
bool IsAddressOfOperand,
TypeSourceInfo ** RecoveryTSI = nullptr )

◆ BuildQualifiedTemplateIdExpr()

◆ BuildQualifiedType() [1/2]

◆ BuildQualifiedType() [2/2]

◆ BuildReadPipeType()

QualType Sema::BuildReadPipeType ( QualType T,
SourceLocation Loc )

Build a Read-only Pipe type.

Parameters
TThe type to which we'll be building a Pipe.
LocWe do not use it for now.
Returns
A suitable pipe type, if there are no errors. Otherwise, returns a NULL type.

Definition at line 1933 of file SemaType.cpp.

References Context, and clang::T.

Referenced by GetFullTypeForDeclarator().

◆ BuildReferenceType()

QualType Sema::BuildReferenceType ( QualType T,
bool LValueRef,
SourceLocation Loc,
DeclarationName Entity )

Build a reference type.

Parameters
TThe type to which we'll be building a reference.
LocThe location of the entity whose type involves this reference type or, if there is no such entity, the location of the type that will have reference type.
EntityThe name of the entity that involves the reference type, if known.
Returns
A suitable reference type, if there are no errors. Otherwise, returns a NULL type.

Definition at line 1858 of file SemaType.cpp.

References checkQualifiedFunction(), Context, deduceOpenCLPointeeAddrSpace(), clang::SemaBase::Diag(), getASTContext(), getLangOpts(), getOpenCLOptions(), HLSL(), inferARCLifetimeForPointee(), clang::SourceLocation::isValid(), OpenCL(), and clang::T.

Referenced by buildLambdaInitCaptureInitialization(), BuiltinAddReference(), CastForMoving(), castForMoving(), checkTupleLikeDecomposition(), and GetFullTypeForDeclarator().

◆ BuildResolvedCallExpr()

ExprResult Sema::BuildResolvedCallExpr ( Expr * Fn,
NamedDecl * NDecl,
SourceLocation LParenLoc,
ArrayRef< Expr * > Arg,
SourceLocation RParenLoc,
Expr * Config = nullptr,
bool IsExecConfig = false,
ADLCallKind UsesADL = ADLCallKind::NotADL )

BuildResolvedCallExpr - Build a call to a resolved expression, i.e.

an expression not of OverloadTy. The expression should unary-convert to an expression of function-pointer or block-pointer type.

Parameters
NDeclthe declaration being called, if available

Definition at line 6912 of file SemaExpr.cpp.

References clang::Block, CallExprUnaryConversions(), clang::cast(), clang::Type::castAs(), CheckCallReturnType(), CheckForImmediateInvocation(), CheckFunctionCall(), clang::CallExpr::computeDependence(), clang::Scope::Contains(), Context, ConvertArgumentsForCall(), clang::CallExpr::Create(), clang::CUDAKernelCallExpr::Create(), CUDA(), CurFPFeatureOverrides(), CurrentDefer, DefaultArgumentPromotion(), clang::SemaBase::Diag(), DiagnoseSentinelCalls(), Diags, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::FunctionDecl::getBuiltinID(), clang::FunctionDecl::getCallResultType(), clang::FunctionType::getCallResultType(), clang::FunctionType::getCmseNSCallAttr(), getCurFunctionDecl(), getLangOpts(), clang::Decl::getLocation(), clang::Type::getPointeeType(), clang::FunctionType::getReturnType(), clang::Expr::getType(), clang::ValueDecl::getType(), getType(), clang::Expr::getValueKindForType(), clang::Decl::hasAttr(), clang::FunctionDecl::hasBody(), clang::TargetInfo::hasFeature(), clang::FunctionDecl::hasPrototype(), ImpCastExprToType(), clang::InitializedEntity::InitializeParameter(), clang::isa(), clang::Decl::isImplicit(), clang::Type::isInstantiationDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isVoidType(), MaybeBindToTemporary(), clang::Method, clang::FunctionDecl::param_size(), PerformCopyInitialization(), rebuildUnknownAnyFunction(), RequireCompleteType(), clang::Result, clang::CallExpr::setArg(), clang::Expr::setType(), clang::Expr::setValueKind(), and clang::VK_PRValue.

Referenced by BuildCallExpr(), BuildCallToMemberFunction(), and FinishOverloadedCallExpr().

◆ BuildResolvedCoawaitExpr()

◆ BuildReturnStmt()

StmtResult Sema::BuildReturnStmt ( SourceLocation ReturnLoc,
Expr * RetValExp,
bool AllowRecovery = false )

Definition at line 3985 of file SemaStmt.cpp.

References ActOnCapScopeReturnStmt(), ActOnFinishFullExpr(), clang::C2y, clang::cast(), CheckSimplerImplicitMovesMSVCWorkaround(), clang::Type::containsErrors(), Context, clang::CPlusPlus, clang::CPlusPlus11, clang::CPlusPlus14, clang::ReturnStmt::Create(), CreateRecoveryExpr(), CurContext, DeduceFunctionTypeFromReturnExpr(), clang::SemaBase::Diag(), DiagnoseUnexpandedParameterPack(), ExprEvalContexts, ForceOff, FunctionScopes, clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::Decl::getAttrs(), clang::Stmt::getBeginLoc(), clang::QualType::getCanonicalType(), clang::Type::getContainedAutoType(), getCopyElisionCandidate(), getCurFunction(), getCurFunctionDecl(), getCurFunctionOrMethodDecl(), getCurMethodDecl(), clang::Stmt::getEndLoc(), getLangOpts(), getNamedReturnInfo(), clang::FunctionDecl::getReturnType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Decl::hasAttr(), clang::Decl::hasAttrs(), IgnoredValueConversions(), ImpCastExprToType(), clang::InitializedEntity::InitializeRelatedResult(), clang::InitializedEntity::InitializeResult(), clang::isa(), clang::FunctionDecl::isConsteval(), clang::FunctionDecl::isConstexpr(), clang::Type::isDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::FunctionDecl::isMain(), clang::FunctionDecl::isNoReturn(), clang::QualType::isNull(), clang::Expr::isTypeDependent(), clang::Type::isVoidType(), Normal, PerformCopyInitialization(), PerformMoveOrCopyInitialization(), clang::Result, clang::Decl::setInvalidDecl(), and clang::StmtError().

Referenced by ActOnReturnStmt(), DefineImplicitCopyAssignment(), DefineImplicitLambdaToBlockPointerConversion(), DefineImplicitLambdaToFunctionPointerConversion(), DefineImplicitMoveAssignment(), and clang::TreeTransform< AdjustConstraints >::RebuildReturnStmt().

◆ BuildSourceLocExpr()

ExprResult Sema::BuildSourceLocExpr ( SourceLocIdentKind Kind,
QualType ResultTy,
SourceLocation BuiltinLoc,
SourceLocation RPLoc,
DeclContext * ParentContext )

◆ BuildStaticAssertDeclaration()

◆ BuildStdInitializerList()

QualType Sema::BuildStdInitializerList ( QualType Element,
SourceLocation Loc )

Looks for the std::initializer_list template and instantiates it with Element, or emits an error if it's not found.

Returns
The instantiated template, or null on error.

Definition at line 12374 of file SemaDeclCXX.cpp.

References BuildStdClassTemplate(), Diag(), LookupStdClassTemplate(), and StdInitializerList.

Referenced by DeduceAutoType().

◆ BuildStmtExpr()

◆ BuildSubstNonTypeTemplateParmExpr()

◆ BuildSynthesizedThreeWayComparison()

◆ BuildTemplateIdExpr()

◆ BuildTypeAwareUsualDelete()

◆ BuildTypeConstraint()

◆ BuildTypeofExprType()

◆ BuildTypeRequirement() [1/2]

concepts::TypeRequirement * Sema::BuildTypeRequirement ( concepts::Requirement::SubstitutionDiagnostic * SubstDiag)

Definition at line 7959 of file SemaExprCXX.cpp.

References Context.

◆ BuildTypeRequirement() [2/2]

concepts::TypeRequirement * Sema::BuildTypeRequirement ( TypeSourceInfo * Type)

Definition at line 7954 of file SemaExprCXX.cpp.

References Context.

Referenced by ActOnTypeRequirement().

◆ BuildTypeTrait()

◆ BuildUnaryOp()

◆ BuildUnaryTransformType()

◆ BuildUnresolvedCoawaitExpr()

◆ BuildUsingDeclaration()

NamedDecl * Sema::BuildUsingDeclaration ( Scope * S,
AccessSpecifier AS,
SourceLocation UsingLoc,
bool HasTypenameKeyword,
SourceLocation TypenameLoc,
CXXScopeSpec & SS,
DeclarationNameInfo NameInfo,
SourceLocation EllipsisLoc,
const ParsedAttributesView & AttrList,
bool IsInstantiation,
bool IsUsingIfExists )

Builds a using declaration.

Parameters
IsInstantiation- Whether this call arises from an instantiation of an unresolved using declaration. We treat the lookup differently for these declarations.

Definition at line 13104 of file SemaDeclCXX.cpp.

References clang::LookupResult::addDecl(), clang::AS_public, BuildUsingShadowDecl(), clang::cast(), CheckInheritingConstructorUsingDecl(), CheckUsingDeclQualifier(), CheckUsingDeclRedeclaration(), CheckUsingShadowDecl(), computeDeclContext(), Context, CorrectTypo(), clang::CPlusPlus14, clang::UnresolvedUsingIfExistsDecl::Create(), clang::UnresolvedUsingTypenameDecl::Create(), clang::UnresolvedUsingValueDecl::Create(), clang::UsingDecl::Create(), clang::FixItHint::CreateInsertion(), CurContext, clang::DeclarationName::CXXConstructorName, Diag(), DiagnoseTemplateParameterShadow(), diagnoseTypo(), clang::LookupResult::empty(), clang::ErrorRecovery, FilterUsingLookup(), ForVisibleRedeclaration, clang::DeclarationName::getAsIdentifierInfo(), clang::LookupResult::getAsSingle(), clang::CXXScopeSpec::getBeginLoc(), clang::NamedDecl::getDeclName(), clang::LookupResult::getFoundDecl(), getLangOpts(), clang::DeclarationNameInfo::getLoc(), clang::Decl::getLocation(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupNameInfo(), clang::DeclarationNameInfo::getName(), clang::DeclarationName::getNameKind(), clang::DeclContext::getParent(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), getSourceManager(), clang::NestedNameSpecifierLoc::getSourceRange(), clang::CXXScopeSpec::getWithLocInContext(), clang::Invalid, clang::isa(), clang::LookupResult::isAmbiguous(), clang::CXXRecordDecl::isInjectedClassName(), clang::CXXScopeSpec::isInvalid(), clang::SourceLocation::isValid(), LookupConstructors(), LookupName(), LookupOrdinaryName, LookupQualifiedName(), LookupUsingDeclName, clang::NestedNameSpecifierLocBuilder::MakeTrivial(), clang::SemaBase::PDiag(), PP, Previous, ProcessDeclAttributeList(), RequireCompleteDeclContext(), clang::LookupResult::resolveKind(), clang::Decl::setAccess(), clang::LookupResult::setBaseObjectType(), clang::LookupResult::setHideTags(), clang::Decl::setInvalidDecl(), clang::DeclarationNameInfo::setName(), clang::DeclarationNameInfo::setNamedTypeInfo(), and clang::LookupResult::suppressDiagnostics().

Referenced by ActOnUsingDeclaration().

◆ BuildUsingEnumDeclaration()

◆ BuildUsingPackDecl()

NamedDecl * Sema::BuildUsingPackDecl ( NamedDecl * InstantiatedFrom,
ArrayRef< NamedDecl * > Expansions )

◆ BuildUsingShadowDecl()

◆ BuildVAArgExpr()

◆ BuildVariableInstantiation()

void Sema::BuildVariableInstantiation ( VarDecl * NewVar,
VarDecl * OldVar,
const MultiLevelTemplateArgumentList & TemplateArgs,
LateInstantiatedAttrVec * LateAttrs,
DeclContext * Owner,
LocalInstantiationScope * StartingScope,
bool InstantiatingVarTemplate = false,
VarTemplateSpecializationDecl * PrevVTSD = nullptr )

BuildVariableInstantiation - Used after a new variable has been created.

Sets basic variable data and decides whether to postpone the variable instantiation.

Definition at line 6071 of file SemaTemplateInstantiateDecl.cpp.

References clang::DeclContext::addHiddenDecl(), clang::cast(), CheckVariableDeclaration(), Context, CurrentInstantiationScope, DiagnoseUnusedDecl(), FindInstantiatedDecl(), ForExternalRedeclaration, forRedeclarationInCurContext(), clang::Decl::getAccess(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::VarDecl::getDescribedVarTemplate(), clang::VarDecl::getInitStyle(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::VarDecl::getPreviousDecl(), clang::VarDecl::getTSCSpec(), clang::ValueDecl::getType(), clang::NamedDecl::hasLinkage(), InstantiateAttrs(), InstantiateVariableInitializer(), clang::isa(), clang::VarDecl::isConstexpr(), clang::VarDecl::isCXXForRangeDecl(), clang::DeclContext::isDependentContext(), clang::Type::isDependentType(), clang::DeclContext::isFunctionOrMethod(), clang::VarDecl::isInitCapture(), clang::VarDecl::isInline(), clang::Decl::isInvalidDecl(), clang::Decl::isLocalExternDecl(), clang::VarDecl::isObjCForDecl(), clang::VarDecl::isOutOfLine(), clang::VarDecl::isPreviousDeclInSameBlockScope(), clang::Decl::isReferenced(), clang::VarDecl::isStaticDataMember(), clang::VarDecl::isThisDeclarationADefinition(), clang::Type::isUndeducedType(), clang::Decl::isUsed(), LookupOrdinaryName, LookupQualifiedName(), LookupRedeclarationWithLinkage, clang::DeclContext::makeDeclVisibleInContext(), Previous, clang::Decl::setAccess(), clang::VarDecl::setConstexpr(), clang::VarDecl::setCXXForRangeDecl(), clang::VarDecl::setInitCapture(), clang::VarDecl::setInitStyle(), clang::VarDecl::setInstantiationOfStaticDataMember(), clang::Decl::setIsUsed(), clang::Decl::setLexicalDeclContext(), clang::Decl::setLocalExternDecl(), clang::VarDecl::setObjCForDecl(), clang::VarDecl::setPreviousDeclInSameBlockScope(), clang::Decl::setReferenced(), clang::VarDecl::setTSCSpec(), clang::TSK_ExplicitSpecialization, and clang::TSK_ImplicitInstantiation.

◆ BuildVarTemplateInstantiation()

◆ BuildVectorLiteral()

◆ BuildVectorType()

◆ BuildWritePipeType()

QualType Sema::BuildWritePipeType ( QualType T,
SourceLocation Loc )

Build a Write-only Pipe type.

Parameters
TThe type to which we'll be building a Pipe.
LocWe do not use it for now.
Returns
A suitable pipe type, if there are no errors. Otherwise, returns a NULL type.

Definition at line 1937 of file SemaType.cpp.

References Context, and clang::T.

◆ BuiltinAddPointer()

QualType Sema::BuiltinAddPointer ( QualType BaseType,
SourceLocation Loc )

Definition at line 9917 of file SemaType.cpp.

References BuildPointerType(), and Pointer.

Referenced by BuildUnaryTransformType(), and BuiltinDecay().

◆ BuiltinAddReference()

QualType Sema::BuiltinAddReference ( QualType BaseType,
UTTKind UKind,
SourceLocation Loc )

Definition at line 9949 of file SemaType.cpp.

References BuildReferenceType(), LangOpts, and clang::Reference.

Referenced by BuildUnaryTransformType().

◆ BuiltinChangeCVRQualifiers()

QualType Sema::BuiltinChangeCVRQualifiers ( QualType BaseType,
UTTKind UKind,
SourceLocation Loc )

◆ BuiltinChangeSignedness()

◆ BuiltinConstantArg()

◆ BuiltinConstantArgMultiple()

bool Sema::BuiltinConstantArgMultiple ( CallExpr * TheCall,
unsigned ArgNum,
unsigned Multiple )

BuiltinConstantArgMultiple - Handle a check if argument ArgNum of CallExpr TheCall is a constant expression is a multiple of Num.

Definition at line 6352 of file SemaChecking.cpp.

References BuiltinConstantArg(), clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::Num, and clang::Result.

◆ BuiltinConstantArgPower2()

bool Sema::BuiltinConstantArgPower2 ( CallExpr * TheCall,
unsigned ArgNum )

BuiltinConstantArgPower2 - Check if argument ArgNum of TheCall is a constant expression representing a power of 2.

Definition at line 6372 of file SemaChecking.cpp.

References BuiltinConstantArg(), clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::Result.

◆ BuiltinConstantArgRange()

bool Sema::BuiltinConstantArgRange ( CallExpr * TheCall,
unsigned ArgNum,
int Low,
int High,
bool RangeIsError = true )

◆ BuiltinConstantArgShiftedByte()

bool Sema::BuiltinConstantArgShiftedByte ( CallExpr * TheCall,
unsigned ArgNum,
unsigned ArgBits )

BuiltinConstantArgShiftedByte - Check if argument ArgNum of TheCall is a constant expression representing an arbitrary byte value shifted left by a multiple of 8 bits.

Definition at line 6413 of file SemaChecking.cpp.

References BuiltinConstantArg(), clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), IsShiftedByte(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::Result.

◆ BuiltinConstantArgShiftedByteOrXXFF()

bool Sema::BuiltinConstantArgShiftedByteOrXXFF ( CallExpr * TheCall,
unsigned ArgNum,
unsigned ArgBits )

BuiltinConstantArgShiftedByteOr0xFF - Check if argument ArgNum of TheCall is a constant expression representing either a shifted byte value, or a value of the form 0x?

?FF (i.e. a member of the arithmetic progression 0x00FF, 0x01FF, ..., 0xFFFF). This strange range check is needed for some Arm MVE intrinsics.

Definition at line 6437 of file SemaChecking.cpp.

References BuiltinConstantArg(), clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), IsShiftedByte(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::Result.

◆ BuiltinDecay()

◆ BuiltinElementwiseTernaryMath()

◆ BuiltinEnumUnderlyingType()

QualType Sema::BuiltinEnumUnderlyingType ( QualType BaseType,
SourceLocation Loc )

◆ BuiltinIsBaseOf()

◆ BuiltinRemoveCVRef()

QualType clang::Sema::BuiltinRemoveCVRef ( QualType BaseType,
SourceLocation Loc )
inline

Definition at line 15410 of file Sema.h.

References BuiltinRemoveReference().

Referenced by BuiltinInvoke().

◆ BuiltinRemoveExtent()

QualType Sema::BuiltinRemoveExtent ( QualType BaseType,
UTTKind UKind,
SourceLocation Loc )

Definition at line 9961 of file SemaType.cpp.

References Context.

Referenced by BuildUnaryTransformType().

◆ BuiltinRemovePointer()

QualType Sema::BuiltinRemovePointer ( QualType BaseType,
SourceLocation Loc )

Definition at line 9926 of file SemaType.cpp.

References clang::Type::getPointeeType().

Referenced by BuildUnaryTransformType().

◆ BuiltinRemoveReference()

QualType Sema::BuiltinRemoveReference ( QualType BaseType,
UTTKind UKind,
SourceLocation Loc )

◆ BuiltinShuffleVector()

◆ BuiltinVectorMath()

◆ BuiltinVectorToScalarMath()

bool Sema::BuiltinVectorToScalarMath ( CallExpr * TheCall)

Definition at line 16420 of file SemaChecking.cpp.

References BuiltinVectorMath(), and clang::Expr::setType().

◆ CallExprUnaryConversions()

ExprResult Sema::CallExprUnaryConversions ( Expr * E)

CallExprUnaryConversions - a special case of an unary conversion performed on a function designator of a call expression.

Definition at line 765 of file SemaExpr.cpp.

References Context, DefaultLvalueConversion(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), ImpCastExprToType(), clang::Type::isFunctionType(), and clang::ActionResult< PtrTy, Compress >::isInvalid().

Referenced by BuildResolvedCallExpr().

◆ CanBeGetReturnObject()

bool Sema::CanBeGetReturnObject ( const FunctionDecl * FD)
static

Definition at line 16482 of file SemaDecl.cpp.

References methodHasName().

Referenced by CheckCoroutineWrapper(), and clang::sema::visitFunctionCallArguments().

◆ CanBeGetReturnTypeOnAllocFailure()

bool Sema::CanBeGetReturnTypeOnAllocFailure ( const FunctionDecl * FD)
static

Definition at line 16486 of file SemaDecl.cpp.

References clang::FunctionDecl::isStatic(), and methodHasName().

Referenced by CheckCoroutineWrapper().

◆ canCalleeThrow()

◆ canDelayFunctionBody()

bool Sema::canDelayFunctionBody ( const Declarator & D)

Determine whether we can delay parsing the body of a function or function template until it is used, assuming we don't care about emitting code for that function.

This will be false if we may need the body of the function in the middle of parsing an expression (where it's impractical to switch to parsing a different function), for instance, if it's constexpr in C++11 or has an 'auto' return type in C++14. These cases are essentially bugs.

Definition at line 16380 of file SemaDecl.cpp.

References clang::DeclaratorChunk::Function, clang::Declarator::getDeclSpec(), clang::Declarator::getNumTypeObjects(), GetTypeFromParser(), clang::Declarator::getTypeObject(), clang::DeclSpec::hasAutoTypeSpec(), clang::DeclSpec::hasConstexprSpecifier(), clang::QualType::isNull(), and clang::Type::isUndeducedType().

◆ canFullyTypeCheckRedeclaration()

bool Sema::canFullyTypeCheckRedeclaration ( ValueDecl * NewD,
ValueDecl * OldD,
QualType NewT,
QualType OldT )

Determines if we can perform a correct type check for D as a redeclaration of PrevDecl.

If not, we can generally still perform a best-effort check.

Parameters
NewDThe new declaration.
OldDThe old declaration.
NewTThe portion of the type of the new declaration to check.
OldTThe portion of the type of the old declaration to check.

Definition at line 11312 of file SemaDecl.cpp.

References clang::Decl::getFriendObjectKind(), clang::Decl::getLexicalDeclContext(), clang::DeclContext::isDependentContext(), clang::Type::isDependentType(), and clang::Decl::isLocalExternDecl().

Referenced by MergeFunctionDecl(), and shouldLinkDependentDeclWithPrevious().

◆ CanPerformAggregateInitializationForOverloadResolution()

bool Sema::CanPerformAggregateInitializationForOverloadResolution ( const InitializedEntity & Entity,
InitListExpr * From )

Determine whether we can perform aggregate initialization for the purposes of overload resolution.

Definition at line 3622 of file SemaInit.cpp.

References clang::InitializedEntity::getType().

Referenced by TryListConversion().

◆ CanPerformCopyInitialization()

bool Sema::CanPerformCopyInitialization ( const InitializedEntity & Entity,
ExprResult Init )

◆ canSkipFunctionBody()

bool Sema::canSkipFunctionBody ( Decl * D)

Determine whether we can skip parsing the body of a function definition, assuming we don't care about analyzing its body or emitting code for that function.

This will be false only if we may need the body of the function in order to parse the rest of the program (for instance, if it is constexpr in C++11 or has an 'auto' return type in C++14).

Definition at line 16404 of file SemaDecl.cpp.

References Consumer, and clang::Decl::getAsFunction().

◆ canThrow()

◆ CanUseDecl()

bool Sema::CanUseDecl ( NamedDecl * D,
bool TreatUnavailableAsInvalid )

◆ CaptureHasSideEffects()

◆ captureSwiftVersionIndependentAPINotes()

bool clang::Sema::captureSwiftVersionIndependentAPINotes ( )
inline

Whether APINotes should be gathered for all applicable Swift language versions, without being applied.

Leaving clients of the current module to select and apply the correct version.

Definition at line 1644 of file Sema.h.

References APINotes.

Referenced by applyAPINotesType(), applyNullability(), and ProcessVersionedAPINotes().

◆ CheckAdditionOperands()

◆ checkAddressOfFunctionIsAvailable()

bool Sema::checkAddressOfFunctionIsAvailable ( const FunctionDecl * Function,
bool Complain = false,
SourceLocation Loc = SourceLocation() )

Returns whether the given function's address can be taken or not, optionally emitting a diagnostic if the address can't be taken.

Returns false if taking the address of the function is illegal.

Definition at line 11712 of file SemaOverload.cpp.

References clang::Function.

Referenced by BuildCallExpr(), BuiltinFunctionStart(), CheckAddressOfOperand(), DefaultFunctionArrayConversion(), clang::InitializationSequence::Diagnose(), FinishOverloadedCallExpr(), isExprAnUnaddressableFunction(), IsStandardConversion(), markUnaddressableCandidatesUnviable(), maybeDiagnoseAssignmentToFunction(), and clang::InitializationSequence::Perform().

◆ CheckAddressOfMemberAccess()

◆ CheckAddressOfOperand()

QualType Sema::CheckAddressOfOperand ( ExprResult & Operand,
SourceLocation OpLoc )

CheckAddressOfOperand - The operand of & must be either a function designator or an lvalue designating an object.

If it is an lvalue, the object cannot be declared with storage class register or be a bit field. Note: The usual conversions are not applied to the operand of the & operator (C99 6.3.2.1p[2-4]), and its result is never an lvalue. In C++, the operand might be an overloaded function name, in which case we allow the '&' but retain the overloaded-function type.

Definition at line 14664 of file SemaExpr.cpp.

References clang::C99, clang::cast(), checkAddressOfFunctionIsAvailable(), CheckPlaceholderExpr(), CheckUseOfCXXMethodAsAddressOfOperand(), clang::Expr::ClassifyLValue(), Context, clang::CPlusPlus, CreateMaterializeTemporaryExpr(), clang::SemaBase::Diag(), diagnoseAddressOfInvalidType(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsPlaceholderType(), clang::SourceRange::getBegin(), clang::Stmt::getBeginLoc(), clang::DeclRefExpr::getDecl(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::Expr::getExprLoc(), getLangOpts(), clang::Expr::getObjectKind(), clang::CXXMethodDecl::getParent(), clang::DeclContext::getParent(), getPrimaryDecl(), clang::DeclRefExpr::getQualifier(), clang::FunctionDecl::getReturnType(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::Expr::hasPlaceholderType(), clang::Expr::IgnoreParens(), clang::isa(), isCompleteType(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isObjCObjectType(), clang::DeclContext::isRecord(), clang::Type::isReferenceType(), isSFINAEContext(), clang::Expr::isTypeDependent(), isUnevaluatedContext(), clang::CXXMethodDecl::isVirtual(), clang::Type::isVoidType(), clang::QualType::isWebAssemblyReferenceType(), clang::Type::isWebAssemblyTableType(), LangOpts, clang::Expr::LV_ArrayTemporary, clang::Expr::LV_ClassTemporary, clang::Expr::LV_IncompleteVoidType, clang::Expr::LV_MemberFunction, clang::Expr::LV_Valid, clang::OK_BitField, clang::OK_MatrixComponent, clang::OK_VectorComponent, clang::FunctionDecl::parameters(), RequireCompleteType(), ResolveSingleFunctionTemplateSpecialization(), clang::SC_Register, and clang::T.

Referenced by BuiltinAddressof(), and CreateBuiltinUnaryOp().

◆ CheckAlignasTypeArgument()

bool Sema::CheckAlignasTypeArgument ( StringRef KWName,
TypeSourceInfo * TInfo,
SourceLocation OpLoc,
SourceRange R )

◆ CheckAlignasUnderalignment()

◆ CheckAllocatedType()

◆ CheckAllocationAccess()

Sema::AccessResult Sema::CheckAllocationAccess ( SourceLocation OperatorLoc,
SourceRange PlacementRange,
CXXRecordDecl * NamingClass,
DeclAccessPair FoundDecl,
bool Diagnose = true )

Checks access to an overloaded operator new or delete.

Definition at line 1732 of file SemaAccess.cpp.

References AR_accessible, clang::AS_public, CheckAccess(), Context, Diagnose, clang::Found, and getLangOpts().

Referenced by CheckDeleteOperator(), and resolveAllocationOverloadInterior().

◆ CheckAltivecInitFromScalar()

bool Sema::CheckAltivecInitFromScalar ( SourceRange R,
QualType VecTy,
QualType SrcTy )

◆ CheckAlwaysInlineAttr()

bool Sema::CheckAlwaysInlineAttr ( const Stmt * OrigSt,
const Stmt * CurSt,
const AttributeCommonInfo & A )

Definition at line 292 of file SemaStmtAttr.cpp.

References CheckStmtInlineAttr().

Referenced by handleAlwaysInlineAttr().

◆ checkAndRewriteMustTailAttr()

bool Sema::checkAndRewriteMustTailAttr ( Stmt * St,
const Attr & MTA )

Check whether the given statement can have musttail applied to it, issuing a diagnostic and returning false if not.

In the success case, the statement is rewritten to remove implicit nodes from the return value.

Definition at line 660 of file SemaStmt.cpp.

References clang::cast(), CurContext, clang::ReturnStmt::getRetValue(), clang::IgnoreElidableImplicitConstructorSingleStep(), clang::IgnoreExprNodes(), clang::IgnoreImplicitAsWrittenSingleStep(), clang::Expr::isInstantiationDependent(), and clang::ReturnStmt::setRetValue().

Referenced by BuildAttributedStmt().

◆ checkArgCount()

◆ checkArgCountAtLeast()

bool Sema::checkArgCountAtLeast ( CallExpr * Call,
unsigned MinArgCount )

Checks that a call expression's argument count is at least the desired number.

This is useful when doing custom type-checking on a variadic function. Returns true on error.

Definition at line 135 of file SemaChecking.cpp.

References clang::Call, and clang::SemaBase::Diag().

Referenced by BuiltinDumpStruct(), checkArgCount(), checkArgCountRange(), and checkBuiltinInferAllocToken().

◆ checkArgCountAtMost()

bool Sema::checkArgCountAtMost ( CallExpr * Call,
unsigned MaxArgCount )

Checks that a call expression's argument count is at most the desired number.

This is useful when doing custom type-checking on a variadic function. Returns true on error.

Definition at line 145 of file SemaChecking.cpp.

References clang::Call, and clang::SemaBase::Diag().

Referenced by checkArgCountRange().

◆ checkArgCountRange()

bool Sema::checkArgCountRange ( CallExpr * Call,
unsigned MinArgCount,
unsigned MaxArgCount )

Checks that a call expression's argument count is in the desired range.

This is useful when doing custom type-checking on a variadic function. Returns true on error.

Definition at line 154 of file SemaChecking.cpp.

References clang::Call, checkArgCountAtLeast(), and checkArgCountAtMost().

Referenced by BuiltinCountZeroBitsGeneric(), BuiltinMaskedGather(), and BuiltinMaskedLoad().

◆ CheckArgsForPlaceholders()

bool Sema::CheckArgsForPlaceholders ( MultiExprArg args)

Check an argument list for placeholders that we won't try to handle later.

Definition at line 6343 of file SemaExpr.cpp.

References CheckPlaceholderExpr(), clang::ActionResult< PtrTy, Compress >::get(), getType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and isPlaceholderToRemoveAsArg().

Referenced by ActOnArraySubscriptExpr(), BuildCallExpr(), and BuildCXXNew().

◆ checkArrayElementAlignment()

◆ CheckAssignmentConstraints() [1/2]

AssignConvertType Sema::CheckAssignmentConstraints ( QualType LHSType,
ExprResult & RHS,
CastKind & Kind,
bool ConvertRHS = true )

Check assignment constraints and optionally prepare for a conversion of the RHS to the LHS type.

CheckAssignmentConstraints (C99 6.5.16) - This routine currently has code to accommodate several GCC extensions when type checking pointers.

The conversion is prepared for if ConvertRHS is true.

Here are some objectionable examples that GCC considers warnings:

int a, *pint; short *pshort; struct foo *pfoo;

pint = pshort; // warning: assignment from incompatible pointer type a = pint; // warning: assignment makes integer from pointer without a cast pint = a; // warning: assignment makes pointer from integer without a cast pint = pfoo; // warning: assignment from incompatible pointer type

As a result, the code for dealing with pointers is more complex than the C99 spec dictates.

Sets 'Kind' for any result kind except Incompatible.

Definition at line 9453 of file SemaExpr.cpp.

References clang::AltiVecBool, clang::AltiVecPixel, clang::AltiVecVector, anyAltivecTypes(), ARM(), clang::C23, CheckAssignmentConstraints(), checkBlockPointerTypesForAssignment(), checkObjCPointerTypesForAssignment(), checkPointerTypesForAssignment(), clang::Compatible, Context, clang::CPlusPlus, clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::Expr::getExprLoc(), getLangOpts(), clang::VectorType::getNumElements(), clang::Type::getPointeeType(), getPointeeType(), clang::Expr::getType(), clang::VectorType::getVectorKind(), ImpCastExprToType(), clang::Incompatible, clang::IncompatibleObjCWeakRef, clang::IncompatiblePointer, clang::IncompatibleVectors, clang::IntToBlockPointer, clang::IntToPointer, clang::isa(), clang::Type::isArithmeticType(), IsAssignConvertCompatible(), clang::Type::isBlockCompatibleObjCPointerType(), clang::Type::isBlockPointerType(), clang::Type::isEnumeralType(), clang::Type::isExtVectorBoolType(), clang::Type::isIntegerType(), isLaxVectorConversion(), clang::Expr::isNullPointerConstant(), clang::Type::isNullPtrType(), clang::Type::isObjCClassType(), clang::Type::isObjCIdType(), clang::Type::isObjCObjectPointerType(), clang::Type::isRVVSizelessBuiltinType(), clang::Type::isSamplerT(), clang::Type::isScalarType(), clang::Type::isSVESizelessBuiltinType(), clang::Type::isVectorType(), clang::Type::isVoidPointerType(), maybeExtendBlockObject(), clang::Expr::NPC_ValueDependentIsNull, ObjC(), clang::PointerToInt, PrepareScalarCast(), prepareVectorSplat(), clang::Result, and unsupportedTypeConversion().

◆ CheckAssignmentConstraints() [2/2]

AssignConvertType Sema::CheckAssignmentConstraints ( SourceLocation Loc,
QualType LHSType,
QualType RHSType )

CheckAssignmentConstraints - Perform type checking for assignment, argument passing, variable initialization, and function return values.

C99 6.5.16.

Definition at line 9414 of file SemaExpr.cpp.

References CheckAssignmentConstraints(), and clang::VK_PRValue.

Referenced by ActOnCleanupAttr(), CheckAssignmentConstraints(), CheckAssignmentConstraints(), CheckAssignmentOperands(), CheckSingleAssignmentConstraints(), CheckTransparentUnionArgumentConstraints(), and PerformImplicitConversion().

◆ CheckAssignmentOperands()

QualType Sema::CheckAssignmentOperands ( Expr * LHSExpr,
ExprResult & RHS,
SourceLocation Loc,
QualType CompoundType,
BinaryOperatorKind Opc )

Definition at line 14205 of file SemaExpr.cpp.

References clang::Assigning, BoundsSafetyCheckAssignmentToCountAttrPtr(), CheckAssignmentConstraints(), clang::sema::checkAssignmentLifetime(), CheckForModifiableLvalue(), CheckForNullPointerDereference(), CheckIdentityFieldAssignment(), clang::SemaObjC::checkRetainCycles(), CheckSingleAssignmentConstraints(), checkUnsafeExprAssigns(), clang::Compatible, Context, clang::CPlusPlus20, clang::SemaBase::Diag(), DiagnoseAssignmentResult(), Diags, ExprEvalContexts, clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAtomicUnqualifiedType(), clang::Stmt::getBeginLoc(), getCurFunction(), clang::DeclRefExpr::getDecl(), getLangOpts(), clang::SourceLocation::getLocWithOffset(), clang::QualType::getObjCLifetime(), getOpenCLOptions(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::Decl::hasAttr(), clang::Expr::hasPlaceholderType(), clang::Expr::IgnoreParenCasts(), clang::IncompatiblePointer, IsAssignConvertCompatible(), clang::SourceLocation::isFileID(), clang::Type::isHalfType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNonWeakInMRRWithObjCWeak(), clang::QualType::isNull(), clang::Type::isObjCObjectPointerType(), clang::Type::isObjCObjectType(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::QualType::isVolatileQualified(), clang::Type::isWebAssemblyTableType(), clang::sema::FunctionScopeInfo::markSafeWeakUse(), ObjC(), clang::Qualifiers::OCL_Strong, and OpenCL().

Referenced by CreateBuiltinBinOp().

◆ CheckAttributesOnDeducedType()

void Sema::CheckAttributesOnDeducedType ( Decl * D)

CheckAttributesOnDeducedType - Calls Sema functions for attributes that requires the type to be deduced.

Definition at line 3365 of file SemaDecl.cpp.

References clang::Decl::attrs().

Referenced by ActOnUninitializedDecl(), and AddInitializerToDecl().

◆ CheckAttrNoArgs()

bool Sema::CheckAttrNoArgs ( const ParsedAttr & CurrAttr)

◆ CheckAttrTarget()

◆ CheckBaseClassAccess() [1/2]

AccessResult clang::Sema::CheckBaseClassAccess ( SourceLocation AccessLoc,
CXXRecordDecl * Base,
CXXRecordDecl * Derived,
const CXXBasePath & Path,
unsigned DiagID,
llvm::function_ref< void(PartialDiagnostic &PD)> SetupPDiag,
bool ForceCheck = false,
bool ForceUnprivileged = false )

◆ CheckBaseClassAccess() [2/2]

Sema::AccessResult Sema::CheckBaseClassAccess ( SourceLocation AccessLoc,
QualType Base,
QualType Derived,
const CXXBasePath & Path,
unsigned DiagID,
bool ForceCheck = false,
bool ForceUnprivileged = false )

Checks access for a hierarchy conversion.

Parameters
ForceChecktrue if this check should be performed even if access control is disabled; some things rely on this for semantics
ForceUnprivilegedtrue if this check should proceed as if the context had no special privileges

Definition at line 1896 of file SemaAccess.cpp.

References CheckBaseClassAccess(), and clang::Type::getAsCXXRecordDecl().

Referenced by buildDeclareReductionRef(), buildUserDefinedMapperRef(), CheckBaseClassAccess(), CheckDerivedToBaseConversion(), CheckMemberPointerConversion(), DiagnoseInvalidExplicitObjectParameterInLambda(), findDecomposableBaseClass(), handlerCanCatch(), and hasUserDefinedMapper().

◆ CheckBaseSpecifier()

◆ CheckBitwiseOperands()

◆ CheckBooleanCondition()

ExprResult Sema::CheckBooleanCondition ( SourceLocation Loc,
Expr * E,
bool IsConstexpr = false )

CheckBooleanCondition - Diagnose problems involving the use of the given expression as a boolean condition (e.g.

in an if statement). Also performs the standard function and array decays, possibly changing the input variable.

Parameters
Loc- A location associated with the condition, e.g. the 'if' keyword.
Returns
true iff there were any errors

Definition at line 20923 of file SemaExpr.cpp.

References CheckCXXBooleanCondition(), CheckPlaceholderExpr(), clang::CPlusPlus, DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), DiagnoseAssignmentAsCondition(), DiagnoseEqualityWithExtraParens(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), getLangOpts(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isTypeDependent(), and clang::T.

Referenced by ActOnCondition(), ActOnDoStmt(), BuildCXXForRangeStmt(), and CheckConditionVariable().

◆ checkCall()

void Sema::checkCall ( NamedDecl * FDecl,
const FunctionProtoType * Proto,
const Expr * ThisArg,
ArrayRef< const Expr * > Args,
bool IsMemberFunction,
SourceLocation Loc,
SourceRange Range,
VariadicCallType CallType )

Handles the checks for format strings, non-POD arguments to vararg functions, NULL arguments passed to non-NULL parameters, diagnose_if attributes and AArch64 SME attributes.

Definition at line 4038 of file SemaChecking.cpp.

References clang::FunctionProtoType::ExtProtoInfo::AArch64SMEAttributes, clang::FunctionType::ARM_None, clang::SemaARM::ArmStreaming, clang::SemaARM::ArmStreamingCompatible, clang::cast(), clang::SemaPPC::checkAIXMemberAlignment(), checkLifetimeCaptureBy(), CheckNonNullArguments(), checkVariadicArgument(), clang::Expr::containsErrors(), Context, CurContext, clang::SemaBase::Diag(), diagnoseArgDependentDiagnoseIfAttrs(), clang::DoesNotApply, clang::getArmStreamingFnType(), clang::FunctionType::getArmZAState(), clang::FunctionType::getArmZT0State(), clang::Decl::getAttr(), clang::FunctionDecl::getBuiltinID(), clang::Expr::getExprLoc(), clang::FunctionProtoType::getExtProtoInfo(), clang::NamedDecl::getFormalLinkage(), clang::Decl::getFunctionType(), clang::APValue::getInt(), getLangOpts(), clang::FunctionProtoType::getNumParams(), clang::FunctionProtoType::getParamType(), clang::FunctionType::getReturnType(), clang::Expr::getType(), clang::Decl::hasAttr(), clang::NamedDecl::hasLinkage(), clang::Internal, clang::Type::isSizelessVectorType(), MaximumAlignment, PPC(), clang::FunctionType::SME_PStateSMCompatibleMask, clang::FunctionType::SME_PStateSMEnabledMask, clang::Decl::specific_attrs(), and clang::Expr::EvalResult::Val.

Referenced by BuildCXXNew(), CheckFunctionCall(), and CreateOverloadedBinOp().

◆ CheckCallingConvAttr()

bool Sema::CheckCallingConvAttr ( const ParsedAttr & attr,
CallingConv & CC,
const FunctionDecl * FD = nullptr,
CUDAFunctionTarget CFT = CUDAFunctionTarget::InvalidTarget )

Check validaty of calling convention attribute attr.

If FD is not null pointer, use FD to determine the CUDA/HIP host/device target. Otherwise, it is specified by CFT.

Definition at line 5517 of file SemaDeclAttr.cpp.

References clang::CC_AAPCS, clang::CC_AAPCS_VFP, clang::CC_AArch64SVEPCS, clang::CC_AArch64VectorCall, clang::CC_C, clang::CC_DeviceKernel, clang::CC_IntelOclBicc, clang::CC_M68kRTD, clang::CC_PreserveAll, clang::CC_PreserveMost, clang::CC_PreserveNone, clang::CC_RISCVVectorCall, clang::CC_RISCVVLSCall_32, clang::CC_Swift, clang::CC_SwiftAsync, clang::CC_Win64, clang::CC_X86_64SysV, clang::CC_X86FastCall, clang::CC_X86Pascal, clang::CC_X86RegCall, clang::CC_X86StdCall, clang::CC_X86ThisCall, clang::CC_X86VectorCall, clang::TargetInfo::CCCR_Error, clang::TargetInfo::CCCR_Ignore, clang::TargetInfo::CCCR_OK, clang::TargetInfo::CCCR_Warning, clang::ParsedAttr::checkAtLeastNumArgs(), clang::ParsedAttr::checkAtMostNumArgs(), clang::TargetInfo::checkCallingConvention(), clang::ParsedAttr::checkExactlyNumArgs(), checkStringLiteralArgumentAttr(), checkUInt32Argument(), Context, CUDA(), clang::Device, clang::SemaBase::Diag(), ForThisTarget, clang::ParsedAttr::getArgAsExpr(), clang::ParsedAttr::getKind(), clang::AttributeCommonInfo::getLoc(), clang::ParsedAttr::getNumArgs(), clang::ParsedAttr::getProcessingCache(), clang::TargetInfo::getTriple(), clang::Global, clang::ParsedAttr::hasProcessingCache(), clang::Host, clang::HostDevice, clang::SemaCUDA::IdentifyTarget(), clang::InvalidTarget, clang::NamedDecl::isCXXInstanceMember(), clang::ParsedAttr::isInvalid(), clang::FunctionDecl::isVariadic(), LangOpts, clang::ParsedAttr::setInvalid(), and clang::ParsedAttr::setProcessingCache().

Referenced by getCCForDeclaratorChunk(), handleCallConvAttr(), and handleFunctionTypeAttr().

◆ CheckCallReturnType()

◆ CheckCaseExpression()

◆ CheckCastAlign()

◆ checkClassLevelCodeSegAttribute()

void Sema::checkClassLevelCodeSegAttribute ( CXXRecordDecl * Class)

◆ checkClassLevelDLLAttribute()

◆ CheckClassTemplate()

DeclResult Sema::CheckClassTemplate ( Scope * S,
unsigned TagSpec,
TagUseKind TUK,
SourceLocation KWLoc,
CXXScopeSpec & SS,
IdentifierInfo * Name,
SourceLocation NameLoc,
const ParsedAttributesView & Attr,
TemplateParameterList * TemplateParams,
AccessSpecifier AS,
SourceLocation ModulePrivateLoc,
SourceLocation FriendLoc,
unsigned NumOuterTemplateParamLists,
TemplateParameterList ** OuterTemplateParamLists,
SkipBodyInfo * SkipBody = nullptr )

Definition at line 1912 of file SemaTemplate.cpp.

References ActOnDocumentableDecl(), AddAlignmentAttributesForRecord(), clang::Decl::addAttr(), AddMsStructLayoutForRecord(), AddPushedVisibilityAttribute(), clang::AS_none, clang::AS_public, clang::cast(), CheckRedeclarationInModule(), CheckTemplateDeclScope(), CheckTemplateParameterList(), computeDeclContext(), Context, clang::ClassTemplateDecl::Create(), clang::CXXRecordDecl::Create(), clang::FriendDecl::Create(), clang::FixItHint::CreateReplacement(), CurContext, clang::Definition, clang::SemaBase::Diag(), DiagnoseClassNameShadow(), diagnoseQualifiedDeclaration(), DiagnoseTemplateParameterShadow(), clang::DeclContext::Encloses(), EnterTemplatedContext(), clang::Enum, clang::DeclContext::Equals(), forRedeclarationInCurContext(), clang::Friend, clang::Decl::getAccess(), clang::Decl::getDeclContext(), clang::RecordDecl::getDefinition(), clang::Scope::getFlags(), clang::ClassTemplateDecl::getInstantiatedFromMemberTemplate(), clang::TagDecl::getKindName(), clang::Decl::getLocation(), clang::DeclContext::getLookupParent(), clang::Scope::getParent(), clang::CXXScopeSpec::getRange(), clang::DeclContext::getRedeclContext(), getScopeForDeclContext(), clang::CXXScopeSpec::getScopeRep(), clang::TagDecl::getTagKind(), clang::KeywordHelpers::getTagTypeKindForTypeSpec(), clang::ClassTemplateDecl::getTemplatedDecl(), GetTemplateParameterList(), clang::TemplateDecl::getTemplateParameters(), clang::NamedDecl::getUnderlyingDecl(), inferGslOwnerPointerAttribute(), inferNullableClassAttribute(), clang::Invalid, clang::isa(), isAcceptableTagRedeclaration(), isDeclInScope(), clang::DeclContext::isDependentContext(), clang::CXXScopeSpec::isEmpty(), clang::DeclContext::isFileContext(), clang::CXXScopeSpec::isInvalid(), clang::CXXScopeSpec::isNotEmpty(), clang::DeclContext::isRecord(), isRedefinitionAllowedFor(), clang::CXXScopeSpec::isSet(), clang::Decl::isTemplateParameter(), clang::Scope::isTemplateParamScope(), clang::DeclContext::isTransparentContext(), clang::CXXScopeSpec::isValid(), clang::SourceLocation::isValid(), LangOpts, LookupName(), LookupOrdinaryName, LookupQualifiedName(), LookupTagName, clang::DeclContext::makeDeclVisibleInContext(), makeMergedDefinitionVisible(), mergeDeclAttributes(), clang::SkipBodyInfo::Previous, Previous, ProcessDeclAttributeList(), PushOnScopeChains(), RebuildTemplateParamsInCurrentInstantiation(), clang::Reference, RequireCompleteDeclContext(), clang::Decl::setAccess(), clang::CXXRecordDecl::setDescribedClassTemplate(), clang::Decl::setInvalidDecl(), clang::Decl::setLexicalDeclContext(), SetMemberAccessSpecifier(), clang::RedeclarableTemplateDecl::setMemberSpecialization(), clang::NamedDecl::setModulePrivate(), SetNestedNameSpecifier(), clang::Decl::setObjectOfFriendDecl(), clang::Redeclarable< decl_type >::setPreviousDecl(), clang::TagDecl::setTemplateParameterListsInfo(), clang::SkipBodyInfo::ShouldSkip, clang::TemplateParameterList::size(), clang::TagDecl::startDefinition(), TemplateParameterListsAreEqual(), clang::Scope::TemplateParamScope, TPC_ClassTemplateMember, TPC_FriendClassTemplate, TPC_Other, and TPL_TemplateMatch.

Referenced by ActOnClassTemplateSpecialization(), ActOnTag(), and ActOnTemplatedFriendTag().

◆ checkCommonAttributeFeatures() [1/2]

bool Sema::checkCommonAttributeFeatures ( const Decl * D,
const ParsedAttr & A,
bool SkipArgCountCheck = false )

Handles semantic checking for features that are common to all attributes, such as checking whether a parameter was properly specified, or the correct number of arguments were passed, etc.

Returns true if the attribute has been diagnosed.

Definition at line 1630 of file SemaAttr.cpp.

Referenced by ProcessDeclAttribute(), and ProcessStmtAttribute().

◆ checkCommonAttributeFeatures() [2/2]

bool Sema::checkCommonAttributeFeatures ( const Stmt * S,
const ParsedAttr & A,
bool SkipArgCountCheck = false )

Definition at line 1634 of file SemaAttr.cpp.

◆ CheckCompareOperands()

QualType Sema::CheckCompareOperands ( ExprResult & LHS,
ExprResult & RHS,
SourceLocation Loc,
BinaryOperatorKind Opc )

Definition at line 12637 of file SemaExpr.cpp.

References clang::C11, clang::Type::castAs(), checkArithmeticNull(), checkArithmeticOrEnumeralCompare(), CheckComparisonCategoryType(), clang::SemaObjC::CheckObjCConversion(), CheckPtrComparisonWithNullChar(), CheckSizelessVectorCompareOperands(), CheckVectorCompareOperands(), Context, convertPointersToCompositeType(), clang::CPlusPlus, CurContext, DefaultFunctionArrayLvalueConversion(), DefaultLvalueConversion(), clang::SemaBase::Diag(), DiagnoseAlwaysNonNullPointer(), diagnoseDistinctPointerComparison(), diagnoseFunctionPointerToVoidComparison(), diagnoseLogicalNotOnLHSofCheck(), diagnoseObjCLiteralComparison(), diagnoseTautologicalComparison(), clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), clang::Type::getAs(), getASTContext(), clang::QualType::getCanonicalType(), clang::FunctionType::getCFIUncheckedCalleeAttr(), clang::getComparisonCategoryForBuiltinCmp(), getLangOpts(), clang::DeclContext::getParent(), clang::PointerType::getPointeeType(), clang::Type::getPointeeType(), getPointeeType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), ImpCastExprToType(), clang::Implicit, InvalidOperands(), clang::isa(), clang::QualType::isAddressSpaceOverlapping(), clang::Type::isAnyPointerType(), clang::Type::isArithmeticType(), clang::Type::isBlockCompatibleObjCPointerType(), clang::Type::isBlockPointerType(), clang::Type::isClkEventT(), clang::Type::isEnumeralType(), clang::BinaryOperator::isEqualityOp(), clang::Type::isFunctionPointerType(), clang::Type::isFunctionType(), clang::Type::isIncompleteType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isMemberPointerType(), clang::Expr::isNullPointerConstant(), clang::Type::isNullPtrType(), isObjCObjectLiteral(), clang::Type::isObjCObjectPointerType(), clang::Type::isPointerType(), clang::Type::isQueueT(), clang::Type::isReferenceType(), clang::BinaryOperator::isRelationalOp(), isSFINAEContext(), clang::Type::isSveVLSBuiltinType(), clang::Type::isVectorType(), clang::Type::isVoidPointerType(), clang::Type::isVoidType(), clang::QualType::isWebAssemblyReferenceType(), LangOpts, clang::Expr::NPC_ValueDependentIsNull, clang::Expr::NPCK_NotNull, ObjC(), OpenCL(), and OperatorInExpression.

Referenced by CreateBuiltinBinOp().

◆ CheckComparisonCategoryType()

◆ CheckCompatibleReinterpretCast()

◆ CheckCompletedCoroutineBody()

◆ CheckCompletedCXXClass()

void Sema::CheckCompletedCXXClass ( Scope * S,
CXXRecordDecl * Record )

Perform semantic checks on a class definition that has been completing, introducing implicitly-declared members, checking for abstract types, etc.

Parameters
SThe scope in which the class was parsed. Null if we didn't just parse a class definition.
RecordThe completed class.

Definition at line 6963 of file SemaDeclCXX.cpp.

References clang::AS_public, clang::Sema::DefaultedFunctionKind::asComparison(), clang::CXXRecordDecl::bases(), clang::CanNeverPassInRegs, clang::CannotPassInRegs, canPassInRegisters(), clang::CanPassInRegs, CheckAbstractClassUsage(), checkClassLevelCodeSegAttribute(), checkClassLevelDLLAttribute(), checkCUDADeviceBuiltinSurfaceClassTemplate(), checkCUDADeviceBuiltinTextureClassTemplate(), CheckExplicitlyDefaultedFunction(), checkIllFormedTrivialABIStruct(), checkIncorrectVTablePointerAuthenticationAttribute(), clang::ConsiderTrivialABI, Context, clang::CopyConstructor, clang::FixItHint::CreateInsertion(), CUDA(), clang::LangOptionsBase::Default, clang::DefaultConstructor, DefineDefaultedFunction(), DelayedDllExportMemberFunctions, clang::Destructor, Diag(), DiagnoseAbsenceOfOverrideControl(), DiagnoseAbstractType(), DiagnoseDeletedDefaultedFunction(), DiagnoseHiddenVirtualMethods(), clang::RecordDecl::fields(), clang::Decl::getAccess(), clang::Decl::getAsFunction(), clang::NamedDecl::getDeclName(), getDefaultedFunctionKind(), getLangOpts(), clang::Decl::getLocation(), getLocForEndOfToken(), clang::FunctionDecl::getOverloadedOperator(), getSpecialMember(), clang::FunctionDecl::getStorageClass(), clang::ValueDecl::getType(), clang::NamedDecl::getUnderlyingDecl(), clang::CXXRecordDecl::hasConstexprDestructor(), clang::Incomplete, clang::Invalid, clang::isa(), clang::DeclarationName::isAnyOperatorNewOrDelete(), clang::TagDecl::isCompleteDefinition(), clang::FunctionDecl::isConsteval(), clang::FunctionDecl::isDefaulted(), clang::FunctionDecl::isDeleted(), clang::Decl::isInvalidDecl(), clang::FunctionDecl::isTypeAwareOperatorNewOrDelete(), clang::CXXMethodDecl::isVirtual(), MarkVTableUsed(), clang::MoveConstructor, clang::LangOptionsBase::MSVC2015, NotEqual, Relational, ReportOverrides(), clang::SC_Static, SpecialMemberIsTrivial(), clang::T, and V.

Referenced by ActOnFinishCXXMemberSpecification(), ActOnLambdaError(), and BuildLambdaExpr().

◆ CheckCompleteDecompositionDeclaration()

◆ CheckCompleteDestructorVariant()

void Sema::CheckCompleteDestructorVariant ( SourceLocation CurrentLocation,
CXXDestructorDecl * Dtor )

Do semantic checks to allow the complete destructor variant to be emitted when the destructor is defined in another translation unit.

In the Itanium C++ ABI, destructor variants are emitted together. In the MS C++ ABI, they can be emitted in separate TUs. To emit the complete variant, run a subset of the checks performed when emitting a regular destructor.

Definition at line 14573 of file SemaDeclCXX.cpp.

References Context, clang::Destructor, clang::CXXRecordDecl::getNumVBases(), and MarkVirtualBaseDestructorsReferenced().

Referenced by MarkFunctionReferenced().

◆ CheckCompleteVariableDeclaration()

void Sema::CheckCompleteVariableDeclaration ( VarDecl * VD)

Definition at line 14791 of file SemaDecl.cpp.

References clang::sema::FunctionScopeInfo::addByrefBlockVar(), clang::AttributeCommonInfo::AS_Declspec, BSSSegStack, clang::C23, clang::cast(), CheckCompleteDecompositionDeclaration(), ConstSegStack, Context, clang::CPlusPlus, clang::CPlusPlus11, clang::FixItHint::CreateInsertion(), CUDA(), CurInitSeg, CurInitSegLoc, clang::Sema::PragmaStack< ValueType >::CurrentPragmaLocation, clang::Sema::PragmaStack< ValueType >::CurrentValue, DataSegStack, clang::SemaBase::Diag(), DiagnoseUniqueObjectDuplication(), clang::QualType::DK_nontrivial_c_struct, FinalizeVarWithDestructor(), clang::Type::getAsCXXRecordDecl(), getCurFunction(), getDiagnostics(), clang::Expr::getExprLoc(), getLangOpts(), clang::Attr::getLocation(), clang::VarDecl::getPreviousDecl(), clang::AttributeCommonInfo::getRange(), clang::Stmt::getSourceRange(), clang::CXXRecordDecl::hasTrivialDestructor(), clang::Init, inTemplateInstantiation(), clang::isa(), clang::isTemplateInstantiation(), clang::VarDecl::isThisDeclarationADefinition(), clang::SemaCUDA::MaybeAddConstantAttr(), clang::QualType::NonTrivialCtor, ObjC(), clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, OpenCL(), clang::SemaBase::PDiag(), PP, clang::ASTContext::PSF_Implicit, clang::ASTContext::PSF_Read, clang::ASTContext::PSF_Write, clang::SC_Register, setFunctionHasBranchProtectedScope(), clang::VarDecl::TLS_Static, clang::ast_matchers::type, and UnifySection().

Referenced by ActOnEndOfTranslationUnit(), ActOnUninitializedDecl(), AddInitializerToDecl(), buildCoroutinePromise(), and checkTupleLikeDecomposition().

◆ CheckConceptRedefinition()

◆ CheckConceptTemplateId()

◆ CheckConceptUseInDefinition()

bool Sema::CheckConceptUseInDefinition ( NamedDecl * Concept,
SourceLocation Loc )

Definition at line 9275 of file SemaTemplate.cpp.

References Concept, and clang::SemaBase::Diag().

Referenced by CheckTypeConstraint(), and DiagnoseUseOfDecl().

◆ CheckConditionalOperands()

QualType Sema::CheckConditionalOperands ( ExprResult & Cond,
ExprResult & LHS,
ExprResult & RHS,
ExprValueKind & VK,
ExprObjectKind & OK,
SourceLocation QuestionLoc )

Note that LHS is not null here, even if this is the gnu "x ?: y" extension.

In that case, LHS = cond. C99 6.5.15

Definition at line 8668 of file SemaExpr.cpp.

References checkBlockType(), checkCondition(), checkConditionalBlockPointerCompatibility(), checkConditionalNullPointer(), checkConditionalObjectPointersCompatibility(), CheckPlaceholderExpr(), checkPointerIntegerMismatch(), CheckVectorOperands(), clang::Cond, clang::Conditional, clang::Expr::containsErrors(), Context, clang::CPlusPlus, CXXCheckConditionalOperands(), clang::SemaBase::Diag(), DiagnoseConditionalForNull(), clang::SemaObjC::FindCompositeObjCPointerType(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), getLangOpts(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), ImpCastExprToType(), clang::Type::isArithmeticType(), clang::Type::isBitIntType(), clang::Type::isBlockPointerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Type::isNullPtrType(), clang::Type::isPointerType(), clang::Type::isRecordType(), clang::Expr::isTypeDependent(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Type::isVectorType(), clang::Type::isVoidType(), clang::Type::isWebAssemblyTableType(), ObjC(), clang::OK_Ordinary, OpenCL(), OpenCLCheckVectorConditional(), PrepareScalarCast(), unsupportedTypeConversion(), UsualArithmeticConversions(), UsualUnaryConversions(), and clang::VK_PRValue.

Referenced by ActOnConditionalOp(), and builtinCommonTypeImpl().

◆ CheckConditionVariable()

◆ checkConstantPointerAuthKey()

◆ CheckConstexprFunctionDefinition()

◆ CheckConstrainedAuto()

void Sema::CheckConstrainedAuto ( const AutoType * AutoT,
SourceLocation Loc )

Definition at line 4249 of file SemaChecking.cpp.

References DiagnoseUseOfDecl().

Referenced by ActOnTypeName(), and ActOnVariableDeclarator().

◆ CheckConstraintExpression()

bool Sema::CheckConstraintExpression ( const Expr * CE,
Token NextToken = Token(),
bool * PossibleNonPrimary = nullptr,
bool IsTrailingRequiresClause = false )

Check whether the given expression is a valid constraint expression.

A diagnostic is emitted if it is not, false is returned, and PossibleNonPrimary will be set to true if the failure might be due to a non-primary expression being used as an atomic constraint.

Definition at line 93 of file SemaConcept.cpp.

References clang::C, CheckConstraintExpression(), Context, clang::CPlusPlus11, clang::SemaBase::Diag(), clang::getBinOpPrecedence(), getCurFunction(), clang::Expr::getExprLoc(), clang::Token::getKind(), getLangOpts(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), clang::Token::is(), clang::isa(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::Type::isSpecificBuiltinType(), clang::Expr::isTypeDependent(), and clang::prec::LogicalAnd.

Referenced by CheckConstraintExpression().

◆ CheckConstraintSatisfaction()

bool Sema::CheckConstraintSatisfaction ( ConstrainedDeclOrNestedRequirement Entity,
ArrayRef< AssociatedConstraint > AssociatedConstraints,
const MultiLevelTemplateArgumentList & TemplateArgLists,
SourceRange TemplateIDRange,
ConstraintSatisfaction & Satisfaction,
const ConceptReference * TopLevelConceptId = nullptr,
Expr ** ConvertedExpr = nullptr )

Check whether the given list of constraint expressions are satisfied (as if in a 'conjunction') given template arguments.

Parameters
Templatethe template-like entity that triggered the constraints check (either a concept or a constrained entity).
ConstraintExprsa list of constraint expressions, treated as if they were 'AND'ed together.
TemplateArgListsthe list of template arguments to substitute into the constraint expression.
TemplateIDRangeThe source range of the template id that caused the constraints check.
Satisfactionif true is returned, will contain details of the satisfaction, with enough information to diagnose an unsatisfied expression.
Returns
true if an error occurred and satisfaction could not be checked, false otherwise.

Definition at line 1211 of file SemaConcept.cpp.

References clang::TemplateArgument::Args, CheckConstraintSatisfaction(), Context, clang::ConceptReference::getNamedConcept(), getSourceManager(), clang::ConstraintSatisfaction::IsSatisfied, clang::SourceRange::printToString(), clang::ConstraintSatisfaction::Profile(), and clang::Template.

Referenced by BuildNestedRequirement(), CheckConceptTemplateId(), CheckConstraintSatisfaction(), CheckDeducedArgumentConstraints(), CheckDeducedPlaceholderConstraints(), CheckFunctionConstraints(), CheckFunctionConstraintsWithoutInstantiation(), CheckFunctionTemplateConstraints(), and EnsureTemplateArgumentListConstraints().

◆ CheckConstructor()

void Sema::CheckConstructor ( CXXConstructorDecl * Constructor)

CheckConstructor - Checks a fully-formed constructor for well-formedness, issuing any diagnostics required.

Returns true if the constructor declarator is invalid.

Definition at line 11086 of file SemaDeclCXX.cpp.

References clang::Constructor, Context, clang::FixItHint::CreateInsertion(), and Diag().

Referenced by ActOnFinishDelayedCXXMethodDeclaration(), and CheckFunctionDeclaration().

◆ CheckConstructorAccess() [1/2]

◆ CheckConstructorAccess() [2/2]

◆ CheckConstructorDeclarator()

QualType Sema::CheckConstructorDeclarator ( Declarator & D,
QualType R,
StorageClass & SC )

CheckConstructorDeclarator - Called by ActOnDeclarator to check the well-formedness of the constructor declarator D with type R.

If there are any errors in the declarator, this routine will emit diagnostics and set the invalid bit to true. In any case, the type will be updated to reflect a well-formed type for the constructor and returned.

Definition at line 11025 of file SemaDeclCXX.cpp.

References clang::Type::castAs(), checkMethodTypeQualifiers(), Context, clang::FixItHint::CreateRemoval(), Diag(), diagnoseIgnoredQualifiers(), diagnoseInvalidDeclaratorChunks(), clang::DeclSpec::getAtomicSpecLoc(), clang::DeclSpec::getConstSpecLoc(), clang::Declarator::getDeclSpec(), clang::FunctionProtoType::getExtProtoInfo(), clang::Declarator::getFunctionTypeInfo(), clang::Declarator::getIdentifierLoc(), clang::FunctionProtoType::getParamTypes(), clang::DeclaratorChunk::FunctionTypeInfo::getRefQualifierLoc(), clang::DeclSpec::getRestrictSpecLoc(), clang::FunctionType::getReturnType(), clang::DeclSpec::getStorageClassSpecLoc(), clang::DeclSpec::getTypeQualifiers(), clang::DeclSpec::getVirtualSpecLoc(), clang::DeclSpec::getVolatileSpecLoc(), clang::DeclaratorChunk::FunctionTypeInfo::hasRefQualifier(), clang::Declarator::isInvalidType(), clang::DeclSpec::isVirtualSpecified(), clang::FunctionProtoType::ExtProtoInfo::RefQualifier, clang::DeclaratorChunk::FunctionTypeInfo::RefQualifierIsLValueRef, clang::RQ_None, clang::SC_None, clang::SC_Static, clang::Declarator::setInvalidType(), and clang::FunctionProtoType::ExtProtoInfo::TypeQuals.

Referenced by CreateNewFunctionDecl().

◆ CheckConversionDeclarator()

void Sema::CheckConversionDeclarator ( Declarator & D,
QualType & R,
StorageClass & SC )

CheckConversionDeclarator - Called by ActOnDeclarator to check the well-formednes of the conversion function declarator D with type R.

If there are any errors in the declarator, this routine will emit diagnostics and return true. Otherwise, it will return false. Either way, the type R will be updated to reflect a well-formed type for the conversion operator.

Definition at line 11337 of file SemaDeclCXX.cpp.

References clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::Type::castAs(), Context, clang::UnqualifiedId::ConversionFunctionId, clang::CPlusPlus11, clang::CPlusPlus20, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateInsertionFromRange(), clang::FixItHint::CreateRemoval(), Diag(), extendLeft(), extendRight(), clang::First, clang::DeclaratorChunk::Function, clang::SourceRange::getBegin(), clang::Declarator::getDeclSpec(), clang::TypeLoc::getEndLoc(), clang::DeclSpec::getExplicitSpecLoc(), clang::DeclSpec::getExplicitSpecRange(), clang::Declarator::getFunctionTypeInfo(), clang::Declarator::getIdentifierLoc(), getLangOpts(), getLocForEndOfToken(), clang::Declarator::getName(), clang::TypeLoc::getSourceRange(), clang::UnqualifiedId::getSourceRange(), clang::DeclSpec::getStorageClassSpecLoc(), clang::CharSourceRange::getTokenRange(), GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclSpec::getTypeQualifiers(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::DeclSpec::hasExplicitSpecifier(), clang::DeclSpec::hasTypeSpecifier(), clang::Type::isArrayType(), clang::Type::isFunctionType(), clang::Declarator::isInvalidType(), clang::SourceRange::isValid(), clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::ParamInfo::Param, clang::DeclaratorChunk::FunctionTypeInfo::Params, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, clang::SC_None, clang::SC_Static, clang::Declarator::setInvalidType(), and clang::Declarator::type_objects().

Referenced by CreateNewFunctionDecl().

◆ CheckConvertedConstantExpression() [1/2]

ExprResult Sema::CheckConvertedConstantExpression ( Expr * From,
QualType T,
APValue & Value,
CCEKind CCE,
NamedDecl * Dest = nullptr )

Definition at line 6523 of file SemaOverload.cpp.

References clang::T.

◆ CheckConvertedConstantExpression() [2/2]

ExprResult Sema::CheckConvertedConstantExpression ( Expr * From,
QualType T,
llvm::APSInt & Value,
CCEKind CCE )

◆ CheckCoroutineWrapper()

◆ CheckCountedByAttrOnField()

bool clang::Sema::CheckCountedByAttrOnField ( FieldDecl * FD,
Expr * E,
bool CountInBytes,
bool OrNull )

Check if applying the specified attribute variant from the "counted by" family of attributes to FieldDecl FD is semantically valid.

If semantically invalid diagnostics will be emitted explaining the problems.

Parameters
FDThe FieldDecl to apply the attribute to
EThe count expression on the attribute
CountInBytesIf true the attribute is from the "sized_by" family of attributes. If the false the attribute is from "counted_by" family of attributes.
OrNullIf true the attribute is from the "_or_null" suffixed family of attributes. If false the attribute does not have the suffix.

Together CountInBytes and OrNull decide the attribute variant. E.g. CountInBytes and OrNull both being true indicates the counted_by_or_null attribute.

Returns
false iff semantically valid.

Definition at line 53 of file SemaBoundsSafety.cpp.

References clang::SemaBase::Diag(), clang::FLEXIBLE_ARRAY_MEMBER, clang::FUNCTION, clang::ASTContext::getAsArrayType(), getASTContext(), clang::DeclaratorDecl::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::getCountAttrKind(), clang::ArrayType::getElementType(), clang::GetEnclosingNamedOrTopAnonRecord(), getLangOpts(), clang::Decl::getLocation(), clang::FieldDecl::getParent(), clang::Type::getPointeeType(), clang::FieldDecl::getSourceRange(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::INCOMPLETE, clang::LangOptionsBase::IncompleteOnly, int, clang::Type::isAlwaysIncompleteType(), clang::Type::isBooleanType(), clang::Decl::isFlexibleArrayMemberLike(), clang::Type::isFunctionType(), clang::Type::isIntegerType(), clang::Type::isSizelessType(), clang::Type::isStructureTypeWithFlexibleArrayMember(), clang::TagDecl::isUnion(), clang::Type::isVoidType(), clang::SIZELESS, and clang::VALID.

Referenced by handleCountedByAttrField().

◆ CheckCXX2CRelocatable()

◆ CheckCXXBooleanCondition()

◆ CheckCXXDefaultArgExpr()

◆ CheckCXXDefaultArguments()

void Sema::CheckCXXDefaultArguments ( FunctionDecl * FD)

Helpers for dealing with blocks and functions.

CheckCXXDefaultArguments - Verify that the default arguments for a function declaration are well-formed according to C++ [dcl.fct.default].

Definition at line 1765 of file SemaDeclCXX.cpp.

References CurrentInstantiationScope, Diag(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::FunctionDecl::getTemplateSpecializationKind(), and clang::TSK_ExplicitSpecialization.

Referenced by ActOnFinishDelayedCXXMethodDeclaration(), ActOnStartOfLambdaDefinition(), and CheckFunctionDeclaration().

◆ CheckCXXThisCapture()

bool Sema::CheckCXXThisCapture ( SourceLocation Loc,
bool Explicit = false,
bool BuildAndDiagnose = true,
const unsigned *const FunctionScopeIndexToStopAt = nullptr,
bool ByCopy = false )

Make sure the value of 'this' is actually available in the current context, if it is a potentially evaluated context.

Parameters
LocThe location at which the capture of 'this' occurs.
ExplicitWhether 'this' is explicitly captured in a lambda capture list.
FunctionScopeIndexToStopAtIf non-null, it points to the index of the FunctionScopeInfo stack beyond which we do not attempt to capture. This is useful when enclosing lambdas must speculatively capture 'this' that may or may not be used in certain specializations of a nested generic lambda (depending on whether the name resolves to a non-static member function or a static function).
Returns
returns 'true' if failed, 'false' if success.

Definition at line 1289 of file SemaExprCXX.cpp.

References clang::sema::CapturingScopeInfo::addThisCapture(), buildLambdaThisCaptureFixit(), clang::sema::LambdaScopeInfo::CallOperator, clang::cast(), clang::SemaBase::Diag(), clang::Explicit, FunctionScopes, getCurrentThisType(), clang::Type::getPointeeType(), clang::sema::CapturingScopeInfo::ImpCap_Block, clang::sema::CapturingScopeInfo::ImpCap_CapturedRegion, clang::sema::CapturingScopeInfo::ImpCap_LambdaByref, clang::sema::CapturingScopeInfo::ImpCap_LambdaByval, clang::isa(), clang::isGenericLambdaCallOperatorSpecialization(), isUnevaluatedContext(), and clang::Decl::setInvalidDecl().

Referenced by ActOnLambdaClosureQualifiers(), ActOnLambdaExpressionAfterIntroducer(), CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), DiagnoseDependentMemberLookup(), clang::getStackIndexOfNearestEnclosingCaptureCapableLambda(), MarkThisReferenced(), and tryImplicitlyCaptureThisIfImplicitMemberFunctionAccessWithDependentArgs().

◆ CheckCXXThisType()

bool Sema::CheckCXXThisType ( SourceLocation Loc,
QualType Type )

Check whether the type of 'this' is valid in the current context.

Definition at line 1414 of file SemaExprCXX.cpp.

References CurContext, clang::SemaBase::Diag(), getFunctionLevelDeclContext(), clang::isLambdaCallWithExplicitObjectParameter(), and clang::Method.

Referenced by ActOnCXXThis().

◆ CheckCXXThrowOperand()

◆ CheckDeclCompatibleWithTemplateTemplate()

◆ CheckDeductionGuideDeclarator()

bool Sema::CheckDeductionGuideDeclarator ( Declarator & D,
QualType & R,
StorageClass & SC )

◆ CheckDeductionGuideTemplate()

◆ CheckDelayedMemberExceptionSpecs()

◆ CheckDelegatingCtorCycles()

void Sema::CheckDelegatingCtorCycles ( )

◆ CheckDependentFunctionTemplateSpecialization()

bool Sema::CheckDependentFunctionTemplateSpecialization ( FunctionDecl * FD,
const TemplateArgumentListInfo * ExplicitTemplateArgs,
LookupResult & Previous )

Perform semantic analysis for the given dependent function template specialization.

The only possible way to get a dependent function template specialization is with a friend declaration, like so:

template \<class T> void foo(T);
template \<class T> class A {
friend void foo<>(T);
};

There really isn't any useful analysis we can do here, so we just store the information.

Definition at line 9480 of file SemaTemplate.cpp.

References Context, clang::SemaBase::Diag(), clang::LookupResult::Filter::done(), clang::LookupResult::Filter::erase(), clang::Decl::FOK_None, clang::Decl::getDeclContext(), clang::Decl::getFriendObjectKind(), clang::Decl::getLocation(), clang::DeclContext::getRedeclContext(), clang::NamedDecl::getUnderlyingDecl(), clang::LookupResult::Filter::hasNext(), clang::DeclContext::InEnclosingNamespaceSetOf(), clang::isa(), clang::LookupResult::Filter::next(), Previous, and clang::FunctionDecl::setDependentTemplateSpecialization().

Referenced by ActOnFunctionDeclarator().

◆ CheckDerivedToBaseConversion() [1/2]

◆ CheckDerivedToBaseConversion() [2/2]

bool Sema::CheckDerivedToBaseConversion ( QualType Derived,
QualType Base,
unsigned InaccessibleBaseID,
unsigned AmbiguousBaseConvID,
SourceLocation Loc,
SourceRange Range,
DeclarationName Name,
CXXCastPath * BasePath,
bool IgnoreAccess = false )

CheckDerivedToBaseConversion - Check whether the Derived-to-Base conversion (where Derived and Base are class types) is well-formed, meaning that the conversion is unambiguous (and that all of the base classes are accessible).

Returns true and emits a diagnostic if the code is ill-formed, returns false otherwise. Loc is the location where this routine should point to if there is an error, and Range is the source range to highlight if there is an error.

If either InaccessibleBaseID or AmbiguousBaseConvID are 0, then the diagnostic for the respective type of error will be suppressed, but the check for ill-formed code will still be performed.

Definition at line 3119 of file SemaDeclCXX.cpp.

References AR_accessible, AR_delayed, AR_dependent, AR_inaccessible, BuildBasePathArray(), CheckBaseClassAccess(), clang::CXXBasePaths::clear(), Context, Diag(), clang::CXXBasePaths::front(), getAmbiguousPathsDisplayString(), getLangOpts(), clang::CXXBasePaths::isAmbiguous(), IsDerivedFrom(), and clang::CXXBasePaths::setRecordingPaths().

◆ CheckDestructor()

bool Sema::CheckDestructor ( CXXDestructorDecl * Destructor)

CheckDestructor - Checks a fully-formed destructor definition for well-formedness, issuing any diagnostics required.

Returns true on error.

Definition at line 11118 of file SemaDeclCXX.cpp.

References ActOnCXXThis(), Context, clang::declaresSameEntity(), clang::Destructor, Diag(), DiagnoseUseOfDecl(), FindDeallocationFunctionForDestructor(), clang::Type::getAsCXXRecordDecl(), clang::Decl::getLocation(), clang::isa(), MarkFunctionReferenced(), clang::Passing, and PerformImplicitConversion().

Referenced by ActOnFinishFunctionBody(), DefineImplicitDestructor(), and MarkVTableUsed().

◆ CheckDestructorAccess()

◆ CheckDestructorDeclarator()

QualType Sema::CheckDestructorDeclarator ( Declarator & D,
QualType R,
StorageClass & SC )

CheckDestructorDeclarator - Called by ActOnDeclarator to check the well-formednes of the destructor declarator D with type R.

If there are any errors in the declarator, this routine will emit diagnostics and set the declarator to invalid. Even if this happens, will be updated to reflect a well-formed type for the destructor and returned.

Definition at line 11220 of file SemaDeclCXX.cpp.

References clang::Type::castAs(), checkMethodTypeQualifiers(), Context, clang::FixItHint::CreateRemoval(), clang::UnqualifiedId::DestructorName, Diag(), diagnoseIgnoredQualifiers(), diagnoseInvalidDeclaratorChunks(), clang::DeclaratorChunk::FunctionTypeInfo::freeParams(), clang::FTIHasNonVoidParameters(), clang::Type::getAs(), clang::DeclSpec::getAtomicSpecLoc(), clang::DeclSpec::getConstSpecLoc(), clang::Declarator::getDeclSpec(), clang::FunctionProtoType::getExtProtoInfo(), clang::Declarator::getFunctionTypeInfo(), clang::Declarator::getIdentifierLoc(), clang::Declarator::getName(), clang::DeclaratorChunk::FunctionTypeInfo::getRefQualifierLoc(), clang::DeclSpec::getRestrictSpecLoc(), clang::DeclSpec::getStorageClassSpecLoc(), GetTypeFromParser(), clang::DeclSpec::getTypeQualifiers(), clang::DeclSpec::getTypeSpecTypeLoc(), clang::DeclSpec::getVolatileSpecLoc(), clang::DeclaratorChunk::FunctionTypeInfo::hasRefQualifier(), clang::DeclSpec::hasTypeSpecifier(), clang::Declarator::isInvalidType(), clang::DeclaratorChunk::FunctionTypeInfo::isVariadic, clang::DeclaratorChunk::FunctionTypeInfo::RefQualifierIsLValueRef, clang::RQ_None, clang::SC_None, clang::SC_Static, clang::Declarator::setInvalidType(), and clang::FunctionProtoType::ExtProtoInfo::Variadic.

Referenced by CreateNewFunctionDecl().

◆ CheckDistantExceptionSpec()

bool clang::Sema::CheckDistantExceptionSpec ( QualType T)

CheckDistantExceptionSpec - Check if the given type is a pointer or pointer to member to a function with an exception specification.

This means that it is invalid to add another level of indirection.

Definition at line 188 of file SemaExceptionSpec.cpp.

References clang::CPlusPlus17, getLangOpts(), clang::FunctionProtoType::hasExceptionSpec(), and clang::T.

Referenced by BuildMemberPointerType(), and GetFullTypeForDeclarator().

◆ CheckEnableIf()

EnableIfAttr * Sema::CheckEnableIf ( FunctionDecl * Function,
SourceLocation CallLoc,
ArrayRef< Expr * > Args,
bool MissingImplicitThis = false )

Check the enable_if expressions on the given function.

Returns the first failing attribute, or NULL if they were all successful.

Definition at line 7545 of file SemaOverload.cpp.

References Context, convertArgsForAvailabilityChecks(), clang::Function, clang::Sema::DelayedDiagnostics::pushUndelayed(), and clang::Result.

Referenced by AddConversionCandidate(), AddMethodCandidate(), AddOverloadCandidate(), AddSurrogateCandidate(), BuildCallToMemberFunction(), and checkDirectCallValidity().

◆ checkEnumArithmeticConversions()

void Sema::checkEnumArithmeticConversions ( Expr * LHS,
Expr * RHS,
SourceLocation Loc,
ArithConvKind ACK )

◆ CheckEnumConstant()

◆ CheckEnumRedeclaration()

bool Sema::CheckEnumRedeclaration ( SourceLocation EnumLoc,
bool IsScoped,
QualType EnumUnderlyingTy,
bool IsFixed,
const EnumDecl * Prev )

Check whether this is a valid redeclaration of a previous enumeration.

Returns
true if the redeclaration was invalid.

Definition at line 17501 of file SemaDecl.cpp.

References Context, clang::SemaBase::Diag(), clang::EnumDecl::getIntegerType(), clang::EnumDecl::getIntegerTypeRange(), clang::Decl::getLocation(), clang::Type::isDependentType(), clang::EnumDecl::isFixed(), and clang::EnumDecl::isScoped().

Referenced by ActOnTag().

◆ CheckEnumUnderlyingType()

bool Sema::CheckEnumUnderlyingType ( TypeSourceInfo * TI)

Check that this is a valid underlying type for an enum declaration.

Definition at line 17460 of file SemaDecl.cpp.

References clang::SemaBase::Diag(), clang::TypeLoc::getBeginLoc(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::Qualifiers::hasConst(), clang::Qualifiers::hasVolatile(), and clang::T.

Referenced by ActOnTag().

◆ CheckEquivalentExceptionSpec() [1/3]

bool clang::Sema::CheckEquivalentExceptionSpec ( const FunctionProtoType * Old,
SourceLocation OldLoc,
const FunctionProtoType * New,
SourceLocation NewLoc )

CheckEquivalentExceptionSpec - Check if the two types have equivalent exception specifications.

Exception specifications are equivalent if they allow exactly the same set of exception types. It does not matter how that is achieved. See C++ [except.spec]p2.

Definition at line 487 of file SemaExceptionSpec.cpp.

References clang::CheckEquivalentExceptionSpecImpl(), getLangOpts(), New, clang::SemaBase::PDiag(), and clang::Result.

◆ CheckEquivalentExceptionSpec() [2/3]

bool clang::Sema::CheckEquivalentExceptionSpec ( const PartialDiagnostic & DiagID,
const PartialDiagnostic & NoteID,
const FunctionProtoType * Old,
SourceLocation OldLoc,
const FunctionProtoType * New,
SourceLocation NewLoc )

◆ CheckEquivalentExceptionSpec() [3/3]

◆ CheckExceptionSpecCompatibility()

◆ checkExceptionSpecification()

◆ CheckExceptionSpecSubset()

bool clang::Sema::CheckExceptionSpecSubset ( const PartialDiagnostic & DiagID,
const PartialDiagnostic & NestedDiagID,
const PartialDiagnostic & NoteID,
const PartialDiagnostic & NoThrowDiagID,
const FunctionProtoType * Superset,
bool SkipSupersetFirstParameter,
SourceLocation SuperLoc,
const FunctionProtoType * Subset,
bool SkipSubsetFirstParameter,
SourceLocation SubLoc )

◆ CheckExplicitlyDefaultedComparison()

bool Sema::CheckExplicitlyDefaultedComparison ( Scope * S,
FunctionDecl * MD,
DefaultedComparisonKind DCK )

Definition at line 8907 of file SemaDeclCXX.cpp.

References clang::Qualifiers::addConst(), clang::QualType::addConst(), clang::cast(), clang::Type::castAs(), CheckComparisonCategoryType(), CheckConstexprParameterTypes(), CheckConstexprReturnType(), clang::Constexpr, Context, clang::CPlusPlus23, clang::FunctionDecl::DefaultedOrDeletedFunctionInfo::Create(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateReplacement(), DefaultedOperator, Diag(), Diagnose, clang::EST_None, clang::EST_Unevaluated, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::First, clang::CXXRecordDecl::friends(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::SourceRange::getBegin(), clang::DeclaratorDecl::getBeginLoc(), clang::CXXRecordDecl::getCanonicalDecl(), clang::FunctionDecl::getCanonicalDecl(), clang::FunctionDecl::getDeclaredReturnType(), clang::FunctionDecl::getDefaultLoc(), clang::FunctionDecl::getExceptionSpecType(), clang::Decl::getFriendObjectKind(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), getLocForEndOfToken(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getOverloadedOperator(), clang::DeclContext::getParent(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::ParmVarDecl::getSourceRange(), clang::ValueDecl::getType(), clang::FunctionDecl::hasCXXExplicitFunctionObjectParameter(), int, inTemplateInstantiation(), clang::isa(), clang::FunctionDecl::isConsteval(), clang::FunctionDecl::isConstexpr(), clang::TagDecl::isDependentType(), clang::Type::isDependentType(), clang::Decl::isImplicit(), clang::SourceLocation::isInvalid(), clang::QualType::isNull(), clang::Type::isUndeducedAutoType(), clang::SourceLocation::isValid(), lookupOperatorsForDefaultedComparison(), None, Ok, clang::UnresolvedSetImpl::pairs(), clang::FunctionDecl::parameters(), clang::FunctionProtoType::ExtProtoInfo::RefQualifier, clang::Qualifiers::removeVolatile(), RequireCompleteType(), clang::RQ_None, clang::RQ_RValue, clang::FunctionDecl::setConstexprKind(), SetDeclDeleted(), clang::FunctionDecl::setDefaultedOrDeletedInfo(), clang::ValueDecl::setType(), SubstAutoType(), clang::T, ThreeWay, clang::FunctionProtoType::ExceptionSpecInfo::Type, clang::FunctionProtoType::ExtProtoInfo::TypeQuals, and clang::CanQual< T >::withConst().

Referenced by CheckExplicitlyDefaultedFunction(), and SetDeclDefaulted().

◆ CheckExplicitlyDefaultedFunction()

◆ CheckExplicitlyDefaultedSpecialMember()

bool Sema::CheckExplicitlyDefaultedSpecialMember ( CXXMethodDecl * MD,
CXXSpecialMemberKind CSM,
SourceLocation DefaultLoc )

Definition at line 7752 of file SemaDeclCXX.cpp.

References clang::Type::castAs(), clang::Consteval, clang::Constexpr, Context, clang::CopyAssignment, clang::CopyConstructor, clang::CPlusPlus14, clang::CPlusPlus20, clang::FixItHint::CreateReplacement(), clang::DefaultConstructor, defaultedSpecialMemberIsConstexpr(), clang::Destructor, Diag(), clang::EST_Unevaluated, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::First, clang::Qualifiers::getAddressSpace(), clang::DeclaratorDecl::getBeginLoc(), clang::CXXMethodDecl::getCanonicalDecl(), clang::CXXMethodDecl::getFunctionObjectParameterType(), getLangOpts(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), clang::CXXMethodDecl::getNumExplicitParams(), clang::CXXRecordDecl::getNumVBases(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::QualType::getQualifiers(), clang::FunctionDecl::getSourceRange(), clang::FunctionDecl::getTemplatedKind(), clang::ValueDecl::getType(), clang::CXXRecordDecl::implicitCopyAssignmentHasConstParam(), clang::CXXRecordDecl::implicitCopyConstructorHasConstParam(), inTemplateInstantiation(), clang::Invalid, clang::isa(), clang::FunctionDecl::isConsteval(), clang::FunctionDecl::isConstexpr(), clang::QualType::isConstQualified(), clang::TagDecl::isDependentType(), clang::FunctionDecl::isExplicitlyDefaulted(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::QualType::isNull(), clang::Type::isReferenceType(), clang::FunctionDecl::isTemplateInstantiation(), clang::SourceLocation::isValid(), clang::FunctionDecl::isVariadic(), clang::QualType::isVolatileQualified(), clang::MoveAssignment, clang::None, clang::FunctionDecl::setConstexprKind(), SetDeclDeleted(), clang::ValueDecl::setType(), ShouldDeleteSpecialMember(), clang::FunctionProtoType::ExceptionSpecInfo::SourceDecl, clang::FunctionDecl::TK_NonTemplate, clang::FunctionProtoType::ExceptionSpecInfo::Type, clang::Unspecified, and clang::CXXRecordDecl::vbases().

Referenced by CheckExplicitlyDefaultedFunction(), and SetDeclDefaulted().

◆ CheckExplicitObjectLambda()

void Sema::CheckExplicitObjectLambda ( Declarator & D)

Definition at line 11566 of file SemaDeclCXX.cpp.

References CheckExplicitObjectMemberFunction().

Referenced by getLambdaType().

◆ CheckExplicitObjectMemberFunction() [1/2]

◆ CheckExplicitObjectMemberFunction() [2/2]

void Sema::CheckExplicitObjectMemberFunction ( DeclContext * DC,
Declarator & D,
DeclarationName Name,
QualType R )

Definition at line 11561 of file SemaDeclCXX.cpp.

References CheckExplicitObjectMemberFunction().

◆ CheckExplicitObjectOverride()

bool Sema::CheckExplicitObjectOverride ( CXXMethodDecl * New,
const CXXMethodDecl * Old )

Definition at line 18779 of file SemaDeclCXX.cpp.

References Diag(), clang::Decl::getLocation(), and New.

Referenced by AddOverriddenMethods().

◆ CheckExtraCXXDefaultArguments()

void Sema::CheckExtraCXXDefaultArguments ( Declarator & D)

◆ CheckExtVectorCast()

◆ CheckFieldDecl()

FieldDecl * Sema::CheckFieldDecl ( DeclarationName Name,
QualType T,
TypeSourceInfo * TInfo,
RecordDecl * Record,
SourceLocation Loc,
bool Mutable,
Expr * BitfieldWidth,
InClassInitStyle InitStyle,
SourceLocation TSSL,
AccessSpecifier AS,
NamedDecl * PrevDecl,
Declarator * D = nullptr )

Build a new FieldDecl and check its well-formedness.

This routine builds a new FieldDecl given the fields name, type, record, etc. PrevDecl should refer to any previous declaration with the same name and in the same scope as the field to be created.

Returns
a new FieldDecl.
Todo
The Declarator argument is a hack. It will be removed once

Definition at line 19179 of file SemaDecl.cpp.

References AbstractFieldType, clang::cast(), CheckAlignasUnderalignment(), checkDuplicateDefaultInit(), CheckNontrivialField(), clang::Type::containsErrors(), Context, clang::CPlusPlus, clang::FieldDecl::Create(), clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsCXXRecordDecl(), clang::DeclarationName::getAsIdentifierInfo(), getCurScope(), clang::NamedDecl::getDeclName(), clang::Declarator::getDeclSpec(), getLangOpts(), clang::Decl::getLocation(), getOpenCLOptions(), clang::DeclSpec::getStorageClassSpecLoc(), clang::Decl::hasAttrs(), clang::ICIS_NoInit, clang::isa(), clang::LangOptions::isCompatibleWithMSVC(), clang::Type::isDependentType(), clang::Type::isIncompleteType(), clang::Decl::isInvalidDecl(), clang::Declarator::isInvalidType(), clang::NamedDecl::isPlaceholderVar(), clang::Type::isReferenceType(), clang::SourceLocation::isValid(), LangOpts, clang::LangOptionsBase::MSVC2015, ObjC(), PPC(), ProcessDeclAttributes(), RequireCompleteSizedType(), RequireCompleteType(), RequireNonAbstractType(), clang::Decl::setAccess(), clang::Decl::setInvalidDecl(), clang::T, tryToFixVariablyModifiedVarType(), VerifyBitField(), and warnOnCTypeHiddenInCPlusPlus().

Referenced by HandleField().

◆ checkFinalSuspendNoThrow()

bool Sema::checkFinalSuspendNoThrow ( const Stmt * FinalSuspend)

Check that the expression co_await promise.final_suspend() shall not be potentially-throwing.

Definition at line 655 of file SemaCoroutine.cpp.

References checkNoThrow(), clang::SemaBase::Diag(), and clang::Decl::getEndLoc().

Referenced by ActOnCoroutineBodyStart().

◆ CheckFloatComparison()

void Sema::CheckFloatComparison ( SourceLocation Loc,
const Expr * LHS,
const Expr * RHS,
BinaryOperatorKind Opcode )

◆ CheckForConstantInitializer()

bool Sema::CheckForConstantInitializer ( Expr * Init,
unsigned DiagID = diag::err_init_element_not_constant )

type checking declaration initializers (C99 6.7.8)

Definition at line 12842 of file SemaDecl.cpp.

References Context, clang::SemaBase::Diag(), clang::Expr::getExprLoc(), clang::Stmt::getSourceRange(), and clang::Init.

Referenced by AddInitializerToDecl(), and BuildCompoundLiteralExpr().

◆ CheckForFunctionRedefinition()

◆ CheckForImmediateInvocation()

ExprResult Sema::CheckForImmediateInvocation ( ExprResult E,
FunctionDecl * Decl )

Wrap the expression in a ConstantExpr if it is a potential immediate invocation.

Opportunistically remove the callee from ReferencesToConsteval if we can. It's OK if this fails; we'll also remove this in HandleImmediateInvocations, but catching it here allows us to avoid walking the AST looking for it in simple cases.

Value-dependent constant expressions should not be immediately evaluated until they are instantiated.

Definition at line 18006 of file SemaExpr.cpp.

References clang::Call, Cleanup, clang::ConstantExpr::Create(), clang::ExprWithCleanups::Create(), clang::Expr::EvalStatus::Diag, clang::Expr::EvaluateAsConstantExpr(), ExprEvalContexts, clang::ActionResult< PtrTy, Compress >::get(), getASTContext(), clang::ConstantExpr::getStorageKind(), clang::APValue::hasValue(), clang::Expr::IgnoreImplicit(), isAlwaysConstantEvaluatedContext(), isCheckingDefaultArgumentOrInitializer(), isImmediateFunctionContext(), isUnevaluatedContext(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Expr::isValueDependent(), MarkExpressionAsImmediateEscalating(), clang::ConstantExpr::MoveIntoResult(), RebuildingImmediateInvocation, and clang::Expr::EvalResult::Val.

Referenced by BuildCallToMemberFunction(), BuildCallToObjectOfClassType(), BuildCXXConstructExpr(), BuildCXXMemberCallExpr(), BuildLiteralOperatorCall(), BuildOverloadedArrowExpr(), BuildResolvedCallExpr(), CreateOverloadedArraySubscriptExpr(), CreateOverloadedBinOp(), CreateOverloadedUnaryOp(), and PerformConstructorInitialization().

◆ CheckFormatStringsCompatible()

bool Sema::CheckFormatStringsCompatible ( FormatStringType FST,
const StringLiteral * AuthoritativeFormatString,
const StringLiteral * TestedFormatString,
const Expr * FunctionCallArg = nullptr )

Verify that two format strings (as understood by attribute(format) and attribute(format_matches) are compatible.

If they are incompatible, diagnostics are emitted with the assumption that AuthoritativeFormatString is correct and TestedFormatString is wrong. If FunctionCallArg is provided, diagnostics will point to it and a note will refer to TestedFormatString or AuthoritativeFormatString as appropriate.

Definition at line 9618 of file SemaChecking.cpp.

References CompareFormatSpecifiers(), clang::FreeBSDKPrintf, clang::Kprintf, clang::NSString, clang::OSLog, clang::OSTrace, and clang::Printf.

Referenced by CheckFormatString(), and mergeFormatMatchesAttr().

◆ CheckFriendAccess()

◆ CheckFunctionCall()

◆ CheckFunctionConstraints()

◆ CheckFunctionDeclaration()

bool Sema::CheckFunctionDeclaration ( Scope * S,
FunctionDecl * NewFD,
LookupResult & Previous,
bool IsMemberSpecialization,
bool DeclIsDefn )

Perform semantic checking of a new function declaration.

Performs semantic analysis of the new function declaration NewFD. This routine performs all semantic checking that does not require the actual declarator involved in the declaration, and is used both for the declaration of functions as they are parsed (called via ActOnDeclarator) and for the declaration of functions that have been instantiated via C++ template instantiation (called via InstantiateDecl).

Parameters
IsMemberSpecializationwhether this new function declaration is a member specialization (that replaces any definition provided by the previous declaration).

This sets NewFD->isInvalidDecl() to true if there was an error.

Returns
true if the function declaration is a redeclaration.

Definition at line 12221 of file SemaDecl.cpp.

References ActOnConversionDeclarator(), clang::SemaOpenMP::ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(), clang::Decl::addAttr(), clang::Qualifiers::addConst(), AddOverriddenMethods(), AllowOverloadingOfFunction(), ARM(), clang::cast(), clang::Type::castAs(), CheckConstPureAttributesUsage(), CheckConstructor(), CheckCXXDefaultArguments(), CheckDeductionGuideTemplate(), checkForConflictWithNonVisibleExternC(), CheckLiteralOperatorDeclaration(), CheckMultiVersionFunction(), CheckOverload(), CheckOverloadedOperatorDeclaration(), clang::SemaARM::CheckSMEFunctionDefAttributes(), clang::SemaSYCL::CheckSYCLEntryPointFunctionDecl(), clang::SemaSYCL::CheckSYCLExternalFunctionDecl(), clang::SemaCUDA::checkTargetOverload(), checkThisInStaticMemberFunctionType(), clang::AssociatedConstraint::ConstraintExpr, clang::Constructor, Context, clang::CPlusPlus, clang::CPlusPlus14, clang::CPlusPlus17, clang::FixItHint::CreateInsertion(), CUDA(), CurContext, clang::Destructor, clang::SemaBase::Diag(), clang::Decl::FOK_None, clang::TypeLoc::getAs(), clang::Decl::getAsFunction(), clang::Decl::getAttr(), clang::Stmt::getBeginLoc(), clang::NamedDecl::getDeclName(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::FunctionProtoType::getExtProtoInfo(), clang::Decl::getFriendObjectKind(), clang::FunctionTemplateDecl::getInstantiatedFromMemberTemplate(), getLangOpts(), clang::FunctionDecl::getLiteralIdentifier(), clang::Decl::getLocation(), getLocForEndOfToken(), clang::CXXMethodDecl::getMethodQualifiers(), clang::FunctionProtoType::getParamTypes(), clang::FunctionDecl::getPrimaryTemplate(), clang::FunctionDecl::getReturnType(), clang::FunctionType::getReturnType(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::ValueDecl::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::Decl::hasAttr(), clang::Qualifiers::hasConst(), clang::TypeLoc::IgnoreParens(), inferLifetimeCaptureByAttribute(), inTemplateInstantiation(), clang::isa(), clang::FunctionDecl::isConstexpr(), clang::NamedDecl::isCXXClassMember(), clang::DeclContext::isDependentContext(), clang::FunctionDecl::isExternC(), clang::Type::isIncompleteType(), clang::Type::isObjCObjectPointerType(), IsOverload(), clang::FunctionDecl::isOverloadedOperator(), clang::QualType::isPODType(), clang::CXXMethodDecl::isStatic(), clang::Type::isUndeducedType(), clang::Type::isVariablyModifiedType(), clang::Type::isVoidType(), LangOpts, clang::Match, MergeFunctionDecl(), clang::FunctionTemplateDecl::mergePrevDecl(), clang::Method, clang::NonFunction, OpenMP(), clang::Overload, clang::FunctionDecl::parameters(), PPC(), Previous, clang::Redeclaration, clang::Decl::setAccess(), clang::Decl::setInvalidDecl(), clang::RedeclarableTemplateDecl::setMemberSpecialization(), clang::FunctionDecl::setPreviousDeclaration(), clang::ValueDecl::setType(), shouldLinkDependentDeclWithPrevious(), SubstAutoTypeDependent(), SYCL(), clang::T, clang::TSK_ExplicitSpecialization, and clang::FunctionProtoType::ExtProtoInfo::TypeQuals.

Referenced by ActOnFunctionDeclarator(), and CheckImplicitSpecialMemberDeclaration().

◆ checkFunctionOrMethodParameterIndex()

template<typename AttrInfo>
bool clang::Sema::checkFunctionOrMethodParameterIndex ( const Decl * D,
const AttrInfo & AI,
unsigned AttrArgNum,
const Expr * IdxExpr,
ParamIdx & Idx,
bool CanIndexImplicitThis = false,
bool CanIndexVariadicArguments = false )
inline

◆ CheckFunctionOrTemplateParamDeclarator()

◆ CheckFunctionReturnType()

◆ CheckFunctionTemplateConstraints()

bool Sema::CheckFunctionTemplateConstraints ( SourceLocation PointOfInstantiation,
FunctionDecl * Decl,
ArrayRef< TemplateArgument > TemplateArgs,
ConstraintSatisfaction & Satisfaction )

◆ CheckFunctionTemplateSpecialization()

bool Sema::CheckFunctionTemplateSpecialization ( FunctionDecl * FD,
TemplateArgumentListInfo * ExplicitTemplateArgs,
LookupResult & Previous,
bool QualifiedFriend = false )

Perform semantic analysis for the given function template specialization.

This routine performs all of the semantic analysis required for an explicit function template specialization. On successful completion, the function declaration FD will become a function template specialization.

Parameters
FDthe function declaration, which will be updated to become a function template specialization.
ExplicitTemplateArgsthe explicitly-provided template arguments, if any. Note that this may be valid info even when 0 arguments are explicitly provided as in, e.g., void sort<>(char*, char*); as it anyway contains info on the angle brackets locations.
Previousthe set of declarations that may be specialized by this function specialization.
QualifiedFriendwhether this is a lookup for a qualified friend declaration with no explicit template argument list that might be befriending a function template specialization.

Definition at line 9522 of file SemaTemplate.cpp.

References clang::TemplateSpecCandidateSet::addCandidate(), clang::Qualifiers::addConst(), clang::UnresolvedSetImpl::addDecl(), clang::UnresolvedSetImpl::begin(), clang::cast(), clang::Type::castAs(), CheckSpecializationInstantiationRedecl(), CheckTemplateSpecializationScope(), Context, clang::CPlusPlus17, clang::TemplateArgumentList::CreateCopy(), clang::CRK_None, CUDA(), clang::CUDATargetMismatch, DeduceTemplateArguments(), clang::SemaBase::Diag(), clang::UnresolvedSetImpl::empty(), clang::UnresolvedSetImpl::end(), clang::Decl::FOK_None, clang::FunctionDecl::getConstexprKind(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::FunctionProtoType::getExtProtoInfo(), clang::Decl::getFriendObjectKind(), clang::FunctionDecl::getInstantiatedFromMemberFunction(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::TemplateSpecCandidateSet::getLocation(), getMostSpecialized(), clang::FunctionProtoType::getParamTypes(), clang::FunctionTemplateSpecializationInfo::getPointOfInstantiation(), clang::DeclContext::getRedeclContext(), clang::FunctionType::getReturnType(), clang::FunctionTemplateSpecializationInfo::getTemplateSpecializationKind(), clang::ValueDecl::getType(), clang::NamedDecl::getUnderlyingDecl(), clang::DeclContext::InEnclosingNamespaceSetOf(), clang::SemaCUDA::inheritTargetAttrs(), clang::isa(), clang::FunctionTemplateSpecializationInfo::isExplicitSpecialization(), clang::isUnresolvedExceptionSpec(), LangOpts, clang::MakeDeductionFailureInfo(), MarkUnusedFileScopedDecl(), clang::TemplateSpecCandidateSet::NoteCandidates(), NoteOverloadCandidate(), clang::SemaBase::PDiag(), Previous, ResolveExceptionSpec(), clang::Result, clang::TemplateSpecCandidate::set(), clang::FunctionTemplateSpecializationInfo::setTemplateSpecializationKind(), clang::Specialization, clang::Success, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, clang::TSK_Undeclared, and clang::FunctionProtoType::ExtProtoInfo::TypeQuals.

Referenced by ActOnFunctionDeclarator(), and CheckOverload().

◆ CheckIfFunctionSpecializationIsImmediate()

◆ CheckIfOverriddenFunctionIsMarkedFinal()

bool Sema::CheckIfOverriddenFunctionIsMarkedFinal ( const CXXMethodDecl * New,
const CXXMethodDecl * Old )

CheckIfOverriddenFunctionIsMarkedFinal - Checks whether a virtual member function overrides a virtual member function marked 'final', according to C++11 [class.virtual]p4.

Definition at line 3346 of file SemaDeclCXX.cpp.

References Diag(), clang::Decl::getAttr(), clang::Decl::getLocation(), and New.

Referenced by AddOverriddenMethods().

◆ checkIllFormedTrivialABIStruct()

◆ CheckImmediateEscalatingFunctionDefinition()

◆ CheckImplicitConversion()

void Sema::CheckImplicitConversion ( Expr * E,
QualType T,
SourceLocation CC,
bool * ICContext = nullptr,
bool IsListInit = false )

Definition at line 12777 of file SemaChecking.cpp.

References clang::SemaObjC::adornBoolConversionDiagWithTernaryFixit(), ARM(), clang::cast(), clang::SemaObjC::checkArrayLiteral(), clang::SemaObjC::checkDictionaryLiteral(), Context, clang::CPlusPlus, clang::SemaBase::Diag(), DiagnoseAlwaysNonNullPointer(), DiagnoseFloatingImpCast(), DiagnoseImpCast(), DiagnoseIntInBoolContext(), DiagnoseMixedUnicodeImplicitConversion(), DiagnoseNullConversion(), DiagRuntimeBehavior(), DiscardingCFIUncheckedCallee(), DiscardMisalignedMemberAddress(), clang::Expr::EvaluateAsFixedPoint(), clang::Expr::EvaluateAsInt(), clang::Expr::EvaluateAsRValue(), clang::CallExpr::getArg(), clang::Type::getAs(), getASTContext(), clang::Expr::getEnumCoercedType(), clang::Expr::getExprLoc(), clang::ASTContext::getFloatingTypeSemanticOrder(), clang::Expr::getIntegerConstantExpr(), getLangOpts(), clang::CallExpr::getNumArgs(), clang::VectorType::getNumElements(), clang::ConstantMatrixType::getNumElementsFlattened(), clang::Stmt::getSourceRange(), clang::Type::getSveEltType(), clang::Expr::getType(), clang::QualType::getTypePtr(), HLSL(), clang::Expr::IgnoreParenImpCasts(), clang::isa(), clang::Type::isBooleanType(), isConstantEvaluatedContext(), clang::BuiltinType::isFloatingPoint(), clang::Type::isFloatingType(), clang::BuiltinType::isInteger(), clang::Type::isIntegerType(), clang::SourceLocation::isInvalid(), clang::Expr::isKnownToHaveBooleanValue(), IsSameFloatAfterCast(), isSameWidthConstantConversion(), clang::BuiltinType::isSignedInteger(), clang::Type::isSveVLSBuiltinType(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::Expr::NPCK_NotNull, ObjC(), clang::SemaBase::PDiag(), PrettyPrintInRange(), clang::Result, clang::Expr::SE_AllowSideEffects, SourceMgr, clang::T, clang::Target, toString(), TryGetExprRange(), and clang::Expr::EvalResult::Val.

Referenced by AnalyzeImplicitConversions(), CheckBoolLikeConversion(), CheckCommaOperand(), CheckConditionalOperand(), CheckConditionalOperator(), and clang::checkOpenCLEnqueueIntType().

◆ CheckImplicitNullabilityTypeSpecifier()

bool Sema::CheckImplicitNullabilityTypeSpecifier ( QualType & Type,
NullabilityKind Nullability,
SourceLocation DiagLoc,
bool AllowArrayTypes,
bool OverrideExisting )

Check whether a nullability type specifier can be added to the given type through some means not written in source (e.g.

API notes).

Parameters
TypeThe type to which the nullability specifier will be added. On success, this type will be updated appropriately.
NullabilityThe nullability specifier to add.
DiagLocThe location to use for diagnostics.
AllowArrayTypesWhether to accept nullability specifiers on an array type (e.g., because it will decay to a pointer).
OverrideExistingWhether to override an existing, locally-specified nullability specifier rather than complaining about the conflict.
Returns
true if nullability cannot be applied, false otherwise.

Definition at line 7417 of file SemaType.cpp.

References CheckNullabilityTypeSpecifier().

Referenced by ApplyNullability().

◆ CheckImplicitSpecialMemberDeclaration()

◆ checkIncorrectVTablePointerAuthenticationAttribute()

void Sema::checkIncorrectVTablePointerAuthenticationAttribute ( CXXRecordDecl & RD)

Check that VTable Pointer authentication is only being set on the first first instantiation of the vtable.

Definition at line 10668 of file SemaDeclCXX.cpp.

References clang::CXXRecordDecl::bases(), Context, Diag(), clang::Decl::getAttr(), clang::Decl::getLocation(), clang::CXXRecordDecl::hasAnyDependentBases(), clang::CXXRecordDecl::isPolymorphic(), and RequireCompleteType().

Referenced by CheckCompletedCXXClass().

◆ CheckInheritingConstructorUsingDecl()

◆ checkInitializerLifetime()

void Sema::checkInitializerLifetime ( const InitializedEntity & Entity,
Expr * Init )

Check that the lifetime of the initializer (and its subobjects) is sufficient for initializing the entity, and perform lifetime extension (when permitted) if not.

Definition at line 7664 of file SemaInit.cpp.

References clang::sema::checkInitLifetime(), and clang::Init.

Referenced by CollectFieldInitializer(), clang::InitializationSequence::Perform(), and TryOrBuildParenListInitialization().

◆ checkLifetimeCaptureBy()

◆ CheckLiteralOperatorDeclaration()

◆ checkLiteralOperatorId()

◆ CheckLogicalOperands()

◆ CheckLookupAccess()

◆ CheckLoopHintExpr()

◆ CheckLValueToRValueConversionOperand()

◆ CheckMain()

void Sema::CheckMain ( FunctionDecl * FD,
const DeclSpec & D )

Definition at line 12607 of file SemaDecl.cpp.

References clang::cast(), clang::CC_C, Context, clang::CPlusPlus, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), clang::Qualifiers::empty(), clang::Type::getAs(), clang::Decl::getAttr(), clang::SourceRange::getBegin(), clang::FunctionType::getCallConv(), clang::DeclSpec::getConstexprSpecLoc(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::FunctionType::getExtInfo(), clang::DeclSpec::getInlineSpecLoc(), getLangOpts(), clang::Decl::getLocation(), getLocForEndOfToken(), clang::DeclSpec::getNoreturnSpecLoc(), clang::FunctionDecl::getNumParams(), clang::FunctionProtoType::getNumParams(), clang::FunctionProtoType::getParamType(), clang::PointerType::getPointeeType(), clang::FunctionType::getReturnType(), clang::FunctionDecl::getReturnTypeSourceRange(), clang::FunctionDecl::getStorageClass(), clang::DeclSpec::getStorageClassSpecLoc(), clang::ValueDecl::getType(), clang::DeclaratorDecl::getTypeSpecStartLoc(), clang::GNUMode, clang::Decl::hasAttr(), HLSL(), clang::isa(), clang::FunctionDecl::isConsteval(), clang::FunctionDecl::isConstexpr(), clang::DeclContext::isExternCContext(), clang::FunctionDecl::isInlineSpecified(), clang::Decl::isInNamedModule(), clang::Decl::isInvalidDecl(), clang::DeclSpec::isNoreturnSpecified(), clang::SourceRange::isValid(), clang::FunctionProtoType::isVariadic(), OpenCL(), clang::Qualifiers::removeConst(), clang::SC_Static, clang::FunctionDecl::setConstexprKind(), clang::FunctionDecl::setHasImplicitReturnZero(), clang::Decl::setInvalidDecl(), clang::ValueDecl::setType(), clang::QualifierCollector::strip(), clang::T, clang::Unspecified, and clang::FunctionType::ExtInfo::withCallingConv().

Referenced by ActOnFunctionDeclarator().

◆ CheckMatrixCast()

◆ CheckMatrixElementwiseOperands()

◆ CheckMatrixLogicalOperands()

◆ CheckMatrixMultiplyOperands()

◆ CheckMemberAccess()

Sema::AccessResult Sema::CheckMemberAccess ( SourceLocation UseLoc,
CXXRecordDecl * NamingClass,
DeclAccessPair Found )

Checks access to a member.

Definition at line 1751 of file SemaAccess.cpp.

References AR_accessible, clang::AS_public, CheckAccess(), Context, clang::Found, and getLangOpts().

◆ CheckMemberOperatorAccess() [1/3]

Sema::AccessResult Sema::CheckMemberOperatorAccess ( SourceLocation Loc,
Expr * ObjectExpr,
ArrayRef< Expr * > ArgExprs,
DeclAccessPair FoundDecl )

Definition at line 1804 of file SemaAccess.cpp.

References CheckMemberOperatorAccess().

◆ CheckMemberOperatorAccess() [2/3]

◆ CheckMemberOperatorAccess() [3/3]

Sema::AccessResult Sema::CheckMemberOperatorAccess ( SourceLocation Loc,
Expr * ObjectExpr,
Expr * ArgExpr,
DeclAccessPair FoundDecl )

Checks access to an overloaded member operator, including conversion operators.

Definition at line 1795 of file SemaAccess.cpp.

References CheckMemberOperatorAccess(), clang::Found, and clang::Stmt::getSourceRange().

◆ CheckMemberPointerConversion()

Sema::MemberPointerConversionResult Sema::CheckMemberPointerConversion ( QualType FromType,
const MemberPointerType * ToPtrType,
CastKind & Kind,
CXXCastPath & BasePath,
SourceLocation CheckLoc,
SourceRange OpRange,
bool IgnoreBaseAccess,
MemberPointerConversionDirection Direction )

◆ CheckMemberSpecialization()

bool Sema::CheckMemberSpecialization ( NamedDecl * Member,
LookupResult & Previous )

Perform semantic analysis for the given non-template member specialization.

This routine performs all of the semantic analysis required for an explicit member function specialization. On successful completion, the function declaration FD will become a member function specialization.

Parameters
Memberthe member declaration, which will be updated to become a specialization.
Previousthe set of declarations, one of which may be specialized by this function specialization; the set will be modified to contain the redeclared member.

Definition at line 9794 of file SemaTemplate.cpp.

References clang::UnresolvedSetImpl::addDecl(), adjustCCAndNoReturn(), Ambiguous, clang::UnresolvedSetImpl::begin(), clang::cast(), CheckFunctionConstraints(), CheckSpecializationInstantiationRedecl(), CheckTemplateSpecializationScope(), Context, clang::SemaBase::Diag(), clang::UnresolvedSetImpl::empty(), clang::UnresolvedSetImpl::end(), clang::Decl::FOK_None, clang::Function, clang::FunctionDecl::getCanonicalDecl(), clang::CXXRecordDecl::getInstantiatedFromMemberClass(), clang::EnumDecl::getInstantiatedFromMemberEnum(), clang::FunctionDecl::getInstantiatedFromMemberFunction(), clang::VarDecl::getInstantiatedFromStaticDataMember(), clang::Decl::getLocation(), clang::CXXRecordDecl::getMemberSpecializationInfo(), clang::EnumDecl::getMemberSpecializationInfo(), clang::FunctionDecl::getMemberSpecializationInfo(), clang::VarDecl::getMemberSpecializationInfo(), getMoreConstrainedFunction(), clang::MemberSpecializationInfo::getPointOfInstantiation(), clang::FunctionDecl::getTemplateSpecializationKind(), clang::MemberSpecializationInfo::getTemplateSpecializationKind(), getTemplateSpecializationKind(), hasExplicitCallingConv(), clang::isa(), clang::FunctionDecl::isDeleted(), clang::VarDecl::isStaticDataMember(), clang::Member, clang::Method, Previous, clang::FunctionDecl::setDeletedAsWritten(), clang::TSK_ExplicitSpecialization, and clang::TSK_ImplicitInstantiation.

Referenced by ActOnFunctionDeclarator(), ActOnTag(), and ActOnVariableDeclarator().

◆ CheckMicrosoftIfExistsSymbol() [1/2]

◆ CheckMicrosoftIfExistsSymbol() [2/2]

IfExistsResult Sema::CheckMicrosoftIfExistsSymbol ( Scope * S,
SourceLocation KeywordLoc,
bool IsIfExists,
CXXScopeSpec & SS,
UnqualifiedId & Name )

◆ checkMSInheritanceAttrOnDefinition()

◆ CheckMSVCRTEntryPoint()

◆ CheckMultiplyDivideOperands()

◆ CheckNoInlineAttr()

bool Sema::CheckNoInlineAttr ( const Stmt * OrigSt,
const Stmt * CurSt,
const AttributeCommonInfo & A )

Definition at line 287 of file SemaStmtAttr.cpp.

References CheckStmtInlineAttr().

Referenced by handleNoInlineAttr().

◆ CheckNonDependentConversions()

bool Sema::CheckNonDependentConversions ( FunctionTemplateDecl * FunctionTemplate,
ArrayRef< QualType > ParamTypes,
ArrayRef< Expr * > Args,
OverloadCandidateSet & CandidateSet,
ConversionSequenceList & Conversions,
CheckNonDependentConversionsFlag UserConversionFlag,
CXXRecordDecl * ActingContext = nullptr,
QualType ObjectType = QualType(),
Expr::Classification ObjectClassification = {},
OverloadCandidateParamOrder PO = {} )

◆ checkNonTrivialCUnion()

◆ checkNonTrivialCUnionInInitializer()

void Sema::checkNonTrivialCUnionInInitializer ( const Expr * Init,
SourceLocation Loc )

Emit diagnostics if the initializer or any of its explicit or implicitly-generated subexpressions require copying or default-initializing a type that is or contains a C union type that is non-trivial to copy or default-initialize.

Definition at line 13414 of file SemaDecl.cpp.

References checkNonTrivialCUnion(), checkNonTrivialCUnionInInitializer(), clang::CopyInit, clang::DefaultInitializedObject, clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::QualType::hasNonTrivialToPrimitiveDefaultInitializeCUnion(), clang::Init, clang::isa(), clang::SourceLocation::isValid(), NTCUK_Copy, and NTCUK_Init.

Referenced by AddInitializerToDecl(), BuildCompoundLiteralExpr(), and checkNonTrivialCUnionInInitializer().

◆ CheckNontrivialField()

◆ CheckNonTypeTemplateParameterType() [1/2]

QualType Sema::CheckNonTypeTemplateParameterType ( QualType T,
SourceLocation Loc )

◆ CheckNonTypeTemplateParameterType() [2/2]

QualType Sema::CheckNonTypeTemplateParameterType ( TypeSourceInfo *& TSI,
SourceLocation Loc )

Check that the type of a non-type template parameter is well-formed.

Returns
the (possibly-promoted) parameter type if valid; otherwise, produces a diagnostic and returns a NULL type.

Definition at line 1337 of file SemaTemplate.cpp.

References CheckNonTypeTemplateParameterType(), clang::TypeSourceInfo::getType(), clang::Type::isUndeducedType(), and SubstAutoTypeSourceInfoDependent().

Referenced by ActOnNonTypeTemplateParameter(), CheckNonTypeTemplateParameterType(), CheckTemplateArgument(), and CheckTemplateArgument().

◆ CheckOverload()

OverloadKind Sema::CheckOverload ( Scope * S,
FunctionDecl * New,
const LookupResult & OldDecls,
NamedDecl *& OldDecl,
bool UseMemberUsingDeclRules )

Determine whether the given New declaration is an overload of the declarations in Old.

This routine returns OverloadKind::Match or OverloadKind::NonFunction if New and Old cannot be overloaded, e.g., if New has the same signature as some function in Old (C++ 1.3.10) or if the Old declarations aren't functions (or function templates) at all. When it does return OverloadKind::Match or OverloadKind::NonFunction, MatchedDecl will point to the decl that New cannot be overloaded with. This decl may be a UsingShadowDecl on top of the underlying declaration.

Example: Given the following input:

void f(int, float); // #1 void f(int, int); // #2 int f(int, int); // #3

When we process #1, there is no previous declaration of "f", so IsOverload will not be used.

When we process #2, Old contains only the FunctionDecl for #1. By comparing the parameter types, we see that #1 and #2 are overloaded (since they have different signatures), so this routine returns OverloadKind::Overload; MatchedDecl is unchanged.

When we process #3, Old is an overload set containing #1 and #2. We compare the signatures of #3 to #1 (they're overloaded, so we do nothing) and then #3 to #2. Since the signatures of #3 and #2 are identical (return types of functions are not part of the signature), IsOverload returns OverloadKind::Match and MatchedDecl will be set to point to the FunctionDecl for #2.

'NewIsUsingShadowDecl' indicates that 'New' is being introduced into a class by a using declaration. The rules for whether to hide shadow declarations ignore some properties which otherwise figure into a function template's signature.

Definition at line 1213 of file SemaOverload.cpp.

References clang::LookupResult::addAllDecls(), clang::LookupResult::begin(), clang::cast(), CheckFunctionTemplateSpecialization(), CurContext, clang::LookupResult::end(), clang::Decl::getAsFunction(), clang::LookupResult::getAsSingle(), getASTContext(), clang::LookupResult::getLookupKind(), HideUsingShadowDecl(), clang::isa(), IsOverload(), isVisible(), LookupUsingDeclName, clang::Match, New, clang::NonFunction, clang::Overload, and clang::LookupResult::Temporary.

Referenced by CheckFunctionDeclaration(), and CheckUsingShadowDecl().

◆ CheckOverloadedOperatorDeclaration()

◆ CheckOverrideControl()

◆ CheckOverridingFunctionAttributes()

◆ CheckOverridingFunctionExceptionSpec()

◆ CheckOverridingFunctionReturnType()

◆ CheckPackExpansion() [1/3]

ExprResult Sema::CheckPackExpansion ( Expr * Pattern,
SourceLocation EllipsisLoc,
UnsignedOrNone NumExpansions )

Invoked when parsing an expression followed by an ellipsis, which creates a pack expansion.

Parameters
PatternThe expression preceding the ellipsis, which will become the pattern of the pack expansion.
EllipsisLocThe location of the ellipsis.

Definition at line 823 of file SemaTemplateVariadic.cpp.

References clang::Expr::containsUnexpandedParameterPack(), Context, clang::SemaBase::Diag(), clang::ExprError(), and clang::Stmt::getSourceRange().

◆ CheckPackExpansion() [2/3]

QualType Sema::CheckPackExpansion ( QualType Pattern,
SourceRange PatternRange,
SourceLocation EllipsisLoc,
UnsignedOrNone NumExpansions )

Construct a pack expansion type from the pattern of the pack expansion.

Definition at line 798 of file SemaTemplateVariadic.cpp.

References clang::Type::containsUnexpandedParameterPack(), Context, clang::SemaBase::Diag(), and clang::Type::getContainedDeducedType().

◆ CheckPackExpansion() [3/3]

◆ CheckParameter()

◆ CheckParameterPacksForExpansion()

bool Sema::CheckParameterPacksForExpansion ( SourceLocation EllipsisLoc,
SourceRange PatternRange,
ArrayRef< UnexpandedParameterPack > Unexpanded,
const MultiLevelTemplateArgumentList & TemplateArgs,
bool FailOnPackProducingTemplates,
bool & ShouldExpand,
bool & RetainExpansion,
UnsignedOrNone & NumExpansions,
bool Diagnose = true )

Determine whether we could expand a pack expansion with the given set of parameter packs into separate arguments by repeatedly transforming the pattern.

Parameters
EllipsisLocThe location of the ellipsis that identifies the pack expansion.
PatternRangeThe source range that covers the entire pattern of the pack expansion.
UnexpandedThe set of unexpanded parameter packs within the pattern.
ShouldExpandWill be set to true if the transformer should expand the corresponding pack expansions into separate arguments. When set, NumExpansions must also be set.
RetainExpansionWhether the caller should add an unexpanded pack expansion after all of the expanded arguments. This is used when extending explicitly-specified template argument packs per C++0x [temp.arg.explicit]p9.
NumExpansionsThe number of separate arguments that will be in the expanded form of the corresponding pack expansion. This is both an input and an output parameter, which can be set by the caller if the number of expansions is known a priori (e.g., due to a prior substitution) and will be set by the callee when the number of expansions is known. The callee must set this value when ShouldExpand is true; it may set this value in other cases.
Returns
true if an error occurred (e.g., because the parameter packs are to be instantiated with arguments of different lengths), false otherwise. If false, ShouldExpand (and possibly NumExpansions) must be set.

Definition at line 842 of file SemaTemplateVariadic.cpp.

References clang::cast(), clang::Type::castAs(), CurrentInstantiationScope, clang::SemaBase::Diag(), Diagnose, clang::TemplateArgument::Expression, clang::TemplateArgument::getAsExpr(), clang::TemplateArgument::getAsType(), clang::SourceRange::getBegin(), clang::getDepthAndIndex(), clang::NamedDecl::getIdentifier(), clang::IdentifierLoc::getIdentifierInfo(), clang::TemplateArgument::getKind(), clang::IdentifierLoc::getLoc(), clang::FunctionParmPackExpr::getNumExpansions(), clang::MultiLevelTemplateArgumentList::getNumLevels(), clang::TemplateArgument::getNumTemplateExpansions(), clang::MultiLevelTemplateArgumentList::hasTemplateArgument(), clang::isa(), clang::TemplateArgument::isPackExpansion(), clang::isPackProducingBuiltinTemplateName(), clang::SourceLocation::isValid(), and clang::TemplateArgument::Type.

Referenced by instantiateDependentAlignedAttr(), InstantiateMemInitializers(), and PreparePackForExpansion().

◆ CheckParamExceptionSpec()

bool clang::Sema::CheckParamExceptionSpec ( const PartialDiagnostic & NestedDiagID,
const PartialDiagnostic & NoteID,
const FunctionProtoType * Target,
bool SkipTargetFirstParameter,
SourceLocation TargetLoc,
const FunctionProtoType * Source,
bool SkipSourceFirstParameter,
SourceLocation SourceLoc )

CheckParamExceptionSpec - Check if the parameter and return types of the two functions have equivalent exception specs.

This is part of the assignment and override compatibility check. We do not check the parameters of parameter function pointers recursively, as no sane programmer would even be able to write such a function type.

Definition at line 878 of file SemaExceptionSpec.cpp.

References clang::CheckSpecForTypesEquivalent(), clang::SemaBase::PDiag(), and clang::Target.

Referenced by CheckExceptionSpecSubset().

◆ CheckParmsForFunctionDef()

bool Sema::CheckParmsForFunctionDef ( ArrayRef< ParmVarDecl * > Parameters,
bool CheckParameterNames )

CheckParmsForFunctionDef - Check that the parameters of the given function are appropriate for the definition of a function.

This takes care of any checks that cannot be performed on the declaration itself, e.g., that the types of each of the function parameters are complete.

Definition at line 14835 of file SemaChecking.cpp.

References AbstractParamType, clang::C23, clang::CPlusPlus, clang::Destructor, clang::SemaBase::Diag(), diagnoseArrayStarInParamType(), DiagnoseUseOfDecl(), getLangOpts(), clang::DeclContext::getParent(), clang::Attr::getSpelling(), clang::DeclContext::isFunctionOrMethod(), LangOpts, LookupDestructor(), MarkFunctionReferenced(), RequireCompleteType(), and RequireNonAbstractType().

Referenced by ActOnBlockArguments(), ActOnStartOfFunctionDef(), and CompleteLambdaCallOperator().

◆ CheckPlaceholderExpr()

ExprResult Sema::CheckPlaceholderExpr ( Expr * E)

Check for operands with placeholder types and complain if found.

Returns ExprError() if there was an error and no recovery was possible.

Definition at line 21509 of file SemaExpr.cpp.

References clang::TemplateArgumentListInfo::addArgument(), clang::CXXScopeSpec::Adopt(), BuildDeclRefExpr(), clang::cast(), clang::SemaPseudoObject::checkRValue(), CheckTemplateIdType(), clang::Expr::containsErrors(), Context, clang::DeclRefExpr::copyTemplateArgumentsInto(), clang::CPlusPlus20, clang::CallExpr::Create(), CreateBuiltinMatrixSingleSubscriptExpr(), CreateRecoveryExpr(), clang::DeclarationName::CXXDestructorName, clang::SemaBase::Diag(), clang::SemaObjC::diagnoseARCUnbridgedCast(), diagnoseUnknownAnyExpr(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsPlaceholderType(), clang::DeclarationNameInfo::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::DeclRefExpr::getDecl(), clang::DeclarationNameInfo::getEndLoc(), clang::Expr::getExprLoc(), clang::DeclRefExpr::getFoundDecl(), clang::BuiltinType::getKind(), getLangOpts(), clang::DeclarationNameInfo::getLoc(), clang::Decl::getLocation(), clang::DeclarationNameInfo::getName(), clang::DeclRefExpr::getNameInfo(), clang::DeclRefExpr::getQualifierLoc(), clang::DeclRefExpr::getTemplateKeywordLoc(), clang::Expr::getType(), clang::DeclRefExpr::hasExplicitTemplateArgs(), clang::DeclRefExpr::hasQualifier(), HLSL(), clang::Expr::IgnoreParenImpCasts(), clang::Expr::IgnoreParens(), ImpCastExprToType(), InstantiateFunctionDefinition(), clang::isa(), clang::TemplateArgument::isDependent(), clang::QualType::isNull(), clang::None, ObjC(), clang::SemaBase::PDiag(), PseudoObject(), resolveAndFixAddressOfSingleOverloadCandidate(), ResolveAndFixSingleFunctionTemplateSpecialization(), clang::Result, clang::SemaObjC::stripARCUnbridgedCast(), tryToRecoverWithCall(), clang::VK_LValue, and clang::VK_PRValue.

Referenced by ActOnArraySubscriptExpr(), ActOnCoawaitExpr(), ActOnConditionalOp(), ActOnDecltypeExpression(), ActOnFinishFullExpr(), ActOnForEachLValueExpr(), ActOnGCCAsmStmt(), ActOnStartCXXMemberReference(), BuildArrayType(), BuildBinOp(), BuildCallExpr(), BuildCoreturnStmt(), BuildCoyieldExpr(), BuildCXXAssumeExpr(), BuildCXXNew(), BuildCXXNoexceptExpr(), BuildCXXTypeId(), BuildExpressionTrait(), BuildInitList(), BuildResolvedCoawaitExpr(), BuildUnaryOp(), BuildUnresolvedCoawaitExpr(), CheckAddressOfOperand(), CheckArgsForPlaceholders(), CheckArrow(), CheckBooleanCondition(), CheckCommaOperands(), CheckConditionalOperands(), CheckIncrementDecrementOperand(), CheckIndirectionOperand(), CheckObjCCollectionLiteralElement(), checkPlaceholderForOverload(), checkPointerAuthValue(), CheckRealImagOperand(), CreateBuiltinMatrixSingleSubscriptExpr(), CreateBuiltinMatrixSubscriptExpr(), CreateOverloadedBinOp(), CreateUnaryExprOrTypeTraitExpr(), DeduceAutoType(), DefaultFunctionArrayConversion(), DefaultLvalueConversion(), DefaultVariadicArgumentPromotion(), HandleExprEvaluationContextForTypeof(), IgnoredValueConversions(), clang::InitializationSequence::InitializeFrom(), LookupInlineAsmIdentifier(), clang::InitializationSequence::Perform(), PerformContextualImplicitConversion(), PerformImplicitConversion(), and PerformMemberExprBaseConversion().

◆ checkPointerAuthDiscriminatorArg()

◆ checkPointerAuthEnabled()

bool Sema::checkPointerAuthEnabled ( SourceLocation Loc,
SourceRange Range )

◆ CheckPointerConversion()

bool Sema::CheckPointerConversion ( Expr * From,
QualType ToType,
CastKind & Kind,
CXXCastPath & BasePath,
bool IgnoreBaseAccess,
bool Diagnose = true )

CheckPointerConversion - Check the pointer conversion from the expression From to the type ToType.

This routine checks for ambiguous or inaccessible derived-to-base pointer conversions for which IsPointerConversion has already returned true. It returns true and produces a diagnostic if there was an error, or returns false otherwise.

Definition at line 3568 of file SemaOverload.cpp.

References CheckDerivedToBaseConversion(), Context, Diag(), Diagnose, DiagRuntimeBehavior(), clang::Type::getAs(), clang::Expr::getExprLoc(), getLangOpts(), clang::Type::getPointeeType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Type::isAnyPointerType(), clang::Type::isBlockPointerType(), clang::Type::isFunctionType(), clang::Expr::isNullPointerConstant(), clang::Type::isRecordType(), isUnevaluatedContext(), clang::Expr::NPC_ValueDependentIsNotNull, clang::Expr::NPC_ValueDependentIsNull, clang::Expr::NPCK_ZeroExpression, and clang::SemaBase::PDiag().

Referenced by CheckSingleAssignmentConstraints(), and PerformImplicitConversion().

◆ CheckPointerToMemberOperands()

◆ CheckPtrComparisonWithNullChar()

◆ CheckPureMethod()

bool Sema::CheckPureMethod ( CXXMethodDecl * Method,
SourceRange InitRange )

Mark the given method pure.

Parameters
Methodthe method to be marked pure.
InitRangethe source range that covers the "0" initializer.

Definition at line 18899 of file SemaDeclCXX.cpp.

References Diag(), clang::SourceRange::getEnd(), clang::SourceLocation::isValid(), and clang::Method.

Referenced by ActOnPureSpecifier().

◆ CheckQualifiedFunctionForTypeId()

◆ CheckQualifiedMemberReference()

◆ CheckRebuiltStmtAttributes()

bool Sema::CheckRebuiltStmtAttributes ( ArrayRef< const Attr * > Attrs)

Definition at line 752 of file SemaStmtAttr.cpp.

References CheckForDuplicateLoopAttrs().

◆ CheckRedeclarationExported()

bool Sema::CheckRedeclarationExported ( NamedDecl * New,
NamedDecl * Old )

[module.interface]p6: A redeclaration of an entity X is implicitly exported if X was introduced by an exported declaration; otherwise it shall not be exported.

Definition at line 1738 of file SemaDecl.cpp.

References clang::SemaBase::Diag(), clang::NamedDecl::getFormalLinkage(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::DeclContext::getNonTransparentContext(), clang::Internal, clang::DeclContext::isFileContext(), clang::Decl::isInExportDeclContext(), clang::Decl::isInNamedModule(), clang::Module, and New.

Referenced by CheckRedeclarationInModule().

◆ CheckRedeclarationInModule()

bool Sema::CheckRedeclarationInModule ( NamedDecl * New,
NamedDecl * Old )

A wrapper function for checking the semantic restrictions of a redeclaration within a module.

Definition at line 1784 of file SemaDecl.cpp.

References CheckRedeclarationExported(), CheckRedeclarationModuleOwnership(), and New.

Referenced by ActOnAliasDeclaration(), ActOnTag(), CheckClassTemplate(), MergeFunctionDecl(), and MergeVarDecl().

◆ CheckRedeclarationModuleOwnership()

◆ CheckRegparmAttr()

bool Sema::CheckRegparmAttr ( const ParsedAttr & attr,
unsigned & value )

Checks a regparm attribute, returning true if it is ill-formed and otherwise setting numParams to the appropriate value.

Definition at line 5737 of file SemaDeclAttr.cpp.

References clang::ParsedAttr::checkExactlyNumArgs(), checkUInt32Argument(), Context, clang::SemaBase::Diag(), clang::ParsedAttr::getArgAsExpr(), clang::AttributeCommonInfo::getLoc(), clang::Stmt::getSourceRange(), clang::ParsedAttr::isInvalid(), and clang::ParsedAttr::setInvalid().

Referenced by handleFunctionTypeAttr().

◆ CheckRemainderOperands()

◆ checkSectionName()

bool Sema::checkSectionName ( SourceLocation LiteralLoc,
StringRef Str )

◆ CheckShadow() [1/2]

◆ CheckShadow() [2/2]

void Sema::CheckShadow ( Scope * S,
VarDecl * D )

Check -Wshadow without the advantage of a previous lookup.

Definition at line 8698 of file SemaDecl.cpp.

References CheckShadow(), Diags, ForVisibleRedeclaration, clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), getShadowedDeclaration(), LookupName(), and LookupOrdinaryName.

◆ CheckShadowingDeclModification()

void Sema::CheckShadowingDeclModification ( Expr * E,
SourceLocation Loc )

Warn if 'E', which is an expression that is about to be modified, refers to a shadowing declaration.

Check if 'E', which is an expression that is about to be modified, refers to a constructor parameter that shadows a field.

Definition at line 8712 of file SemaDecl.cpp.

References clang::cast(), clang::CPlusPlus, clang::SemaBase::Diag(), clang::Decl::getDeclContext(), getLangOpts(), clang::Decl::getLocation(), and clang::Expr::IgnoreParenImpCasts().

Referenced by CheckForModifiableLvalue().

◆ CheckShiftOperands()

◆ CheckSingleAssignmentConstraints()

AssignConvertType Sema::CheckSingleAssignmentConstraints ( QualType LHSType,
ExprResult & RHS,
bool Diagnose = true,
bool DiagnoseCFAudited = false,
bool ConvertRHS = true )

Check assignment constraints for an assignment of RHS to LHSType.

Parameters
LHSTypeThe destination type for the assignment.
RHSThe source expression for the assignment.
DiagnoseIf true, diagnostics may be produced when checking for assignability. If a diagnostic is produced, RHS will be set to ExprError(). Note that this function may still return without producing a diagnostic, even for an invalid assignment.
DiagnoseCFAuditedIf true, the target is a function parameter in an audited Core Foundation API and does not need to be checked for ARC retain issues.
ConvertRHSIf true, RHS will be updated to model the conversions necessary to perform the assignment. If false, Diagnose must also be false.

Definition at line 9908 of file SemaExpr.cpp.

References clang::SemaObjC::ACR_okay, clang::Assigning, clang::C23, CheckAssignmentConstraints(), CheckPointerConversion(), checkPointerTypesForAssignment(), CheckSufficientAllocSize(), clang::Compatible, clang::CompatibleVoidPtrToNonVoidPtr, Context, clang::CPlusPlus, DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), Diagnose, FixOverloadedFunctionReference(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::QualType::getAtomicUnqualifiedType(), clang::Stmt::getBeginLoc(), clang::QualType::getCanonicalType(), clang::Expr::getExprLoc(), getLangOpts(), clang::QualType::getNonLValueExprType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), ImpCastExprToType(), clang::Implicit, clang::Incompatible, clang::IncompatibleObjCWeakRef, clang::Type::isAtomicType(), clang::Type::isBlockPointerType(), clang::Type::isBooleanType(), clang::ImplicitConversionSequence::isFailure(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::SourceLocation::isMacroID(), clang::Expr::isNullPointerConstant(), clang::Type::isNullPtrType(), clang::Type::isObjCObjectPointerType(), clang::Type::isPointerType(), clang::Type::isQueueT(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::Type::isVoidPointerType(), clang::Expr::NPC_ValueDependentIsNull, ObjC(), PerformImplicitConversion(), ResolveAddressOfOverloadedFunction(), TryImplicitConversion(), and clang::VK_PRValue.

Referenced by ActOnIndirectGotoStmt(), CheckAssignmentOperands(), clang::checkCollectionLiteralElement(), IsStandardConversion(), and clang::InitializationSequence::Perform().

◆ CheckSizelessVectorCompareOperands()

◆ CheckSizelessVectorOperands()

◆ CheckSpanLikeType()

bool Sema::CheckSpanLikeType ( const AttributeCommonInfo & CI,
const QualType & Ty )

Check that the type is a plain record with one field being a pointer type and the other field being an integer.

This matches the common implementation of std::span or sized_allocation_t in P0901R11.

Definition at line 1842 of file SemaDeclAttr.cpp.

References Context, clang::SemaBase::Diag(), clang::RecordDecl::field_begin(), clang::RecordDecl::field_end(), clang::Type::getAsRecordDecl(), clang::AttributeCommonInfo::getLoc(), isCompleteType(), clang::Type::isDependentType(), clang::TagDecl::isUnion(), and clang::T.

Referenced by handleMallocSpanAttr(), and instantiateDependentMallocSpanAttr().

◆ CheckSpecializationInstantiationRedecl()

bool Sema::CheckSpecializationInstantiationRedecl ( SourceLocation NewLoc,
TemplateSpecializationKind ActOnExplicitInstantiationNewTSK,
NamedDecl * PrevDecl,
TemplateSpecializationKind PrevTSK,
SourceLocation PrevPtOfInstantiation,
bool & SuppressNew )

Diagnose cases where we have an explicit template specialization before/after an explicit template instantiation, producing diagnostics for those cases where they are required and determining whether the new specialization/instantiation will have any effect.

Parameters
NewLocthe location of the new explicit specialization or instantiation.
NewTSKthe kind of the new explicit specialization or instantiation.
PrevDeclthe previous declaration of the entity.
PrevTSKthe kind of the old explicit specialization or instantiatin.
PrevPointOfInstantiationif valid, indicates where the previous declaration was instantiated (either implicitly or explicitly).
HasNoEffectwill be set to true to indicate that the new specialization or instantiation has no effect and should be ignored.
Returns
true if there was an error that should prevent the introduction of the new declaration into the AST, false otherwise.

Definition at line 9316 of file SemaTemplate.cpp.

References Context, clang::SemaBase::Diag(), DiagLocForExplicitInstantiation(), getLangOpts(), clang::Decl::getLocation(), clang::Decl::getPreviousDecl(), getTemplateSpecializationKind(), clang::SourceLocation::isInvalid(), clang::SourceLocation::isValid(), StripImplicitInstantiation(), clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, and clang::TSK_Undeclared.

Referenced by ActOnExplicitInstantiation(), ActOnExplicitInstantiation(), ActOnExplicitInstantiation(), CheckFunctionTemplateSpecialization(), CheckMemberSpecialization(), and InstantiateClassMembers().

◆ checkSpecializationReachability()

void Sema::checkSpecializationReachability ( SourceLocation Loc,
NamedDecl * Spec )

◆ checkSpecializationVisibility()

void Sema::checkSpecializationVisibility ( SourceLocation Loc,
NamedDecl * Spec )

We've found a use of a templated declaration that would trigger an implicit instantiation.

Check that any relevant explicit specializations and partial specializations are visible/reachable, and diagnose if not.

Definition at line 11795 of file SemaTemplate.cpp.

References getLangOpts(), and Visible.

Referenced by checkSpecializationReachability(), and DoMarkVarDeclReferenced().

◆ CheckSpecifiedExceptionType()

bool clang::Sema::CheckSpecifiedExceptionType ( QualType & T,
SourceRange Range )

CheckSpecifiedExceptionType - Check if the given type is valid in an exception specification.

Incomplete types, or pointers to incomplete types other than void are not allowed.

Parameters
[in,out]TThe exception type. This will be decayed to a pointer type when the input is an array or a function type.

Definition at line 117 of file SemaExceptionSpec.cpp.

References Context, clang::SemaBase::Diag(), clang::Type::getAsRecordDecl(), getLangOpts(), clang::Type::getPointeeType(), clang::Type::isSizelessType(), clang::Type::isVoidType(), clang::QualType::isWebAssemblyReferenceType(), RequireCompleteType(), and clang::T.

Referenced by checkExceptionSpecification().

◆ CheckStaticArrayArgument()

void Sema::CheckStaticArrayArgument ( SourceLocation CallLoc,
ParmVarDecl * Param,
const Expr * ArgExpr )

CheckStaticArrayArgument - If the given argument corresponds to a static array parameter, check that it is non-null, and that if it is formed by array-to-pointer decay, the underlying array is sufficiently large.

C99 6.7.5.3p7: If the keyword static also appears within the [ and ] of the array type derivation, then for each call to the function, the value of the corresponding actual argument shall provide access to the first element of an array with at least as many elements as specified by the size expression.

Definition at line 6218 of file SemaExpr.cpp.

References Context, clang::CPlusPlus, clang::SemaBase::Diag(), DiagnoseCalleeStaticArrayParam(), getASTContext(), clang::ArrayType::getElementType(), getLangOpts(), clang::ConstantArrayType::getSize(), clang::ArrayType::getSizeModifier(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::getTypeSizeInCharsIfKnown(), clang::ConstantArrayType::getZExtSize(), clang::Expr::IgnoreParenCasts(), clang::Expr::isNullPointerConstant(), clang::Expr::NPC_NeverValueDependent, and clang::Static.

Referenced by GatherArgumentsForCall().

◆ CheckStaticLocalForDllExport()

void Sema::CheckStaticLocalForDllExport ( VarDecl * VD)

Check if VD needs to be dllexport/dllimport due to being in a dllexport/import function.

Definition at line 15122 of file SemaDecl.cpp.

References clang::Decl::addAttr(), clang::cast(), getASTContext(), clang::Decl::getAttr(), clang::getDLLAttr(), clang::Decl::getParentFunctionOrMethod(), clang::Decl::hasAttr(), and clang::VarDecl::isStaticLocal().

Referenced by FinalizeDeclaration().

◆ checkStringLiteralArgumentAttr() [1/2]

bool Sema::checkStringLiteralArgumentAttr ( const AttributeCommonInfo & CI,
const Expr * E,
StringRef & Str,
SourceLocation * ArgLocation = nullptr )

◆ checkStringLiteralArgumentAttr() [2/2]

bool Sema::checkStringLiteralArgumentAttr ( const ParsedAttr & Attr,
unsigned ArgNum,
StringRef & Str,
SourceLocation * ArgLocation = nullptr )

Check if the argument ArgNum of Attr is a ASCII string literal.

If not emit an error and return false. If the argument is an identifier it will emit an error with a fixit hint and treat it as if it was a string literal.

Definition at line 134 of file SemaDeclAttr.cpp.

References clang::AANT_ArgumentString, checkStringLiteralArgumentAttr(), clang::FixItHint::CreateInsertion(), clang::SemaBase::Diag(), clang::ParsedAttr::getArgAsExpr(), clang::ParsedAttr::getArgAsIdent(), clang::Stmt::getBeginLoc(), clang::IdentifierLoc::getIdentifierInfo(), clang::IdentifierLoc::getLoc(), getLocForEndOfToken(), clang::IdentifierInfo::getName(), clang::Expr::IgnoreParenCasts(), and clang::ParsedAttr::isArgIdent().

◆ CheckStructuredBindingMemberAccess()

Sema::AccessResult Sema::CheckStructuredBindingMemberAccess ( SourceLocation UseLoc,
CXXRecordDecl * DecomposedClass,
DeclAccessPair Field )

Checks implicit access to a member in a structured binding.

Definition at line 1766 of file SemaAccess.cpp.

References AR_accessible, clang::AS_public, CheckAccess(), Context, and getLangOpts().

Referenced by CheckMemberDecompositionFields().

◆ CheckSubtractionOperands()

QualType Sema::CheckSubtractionOperands ( ExprResult & LHS,
ExprResult & RHS,
SourceLocation Loc,
BinaryOperatorKind Opc,
QualType * CompLHSTy = nullptr )

◆ CheckSwitchCondition()

◆ checkTargetAttr()

◆ CheckTCBEnforcement()

void Sema::CheckTCBEnforcement ( const SourceLocation CallExprLoc,
const NamedDecl * Callee )

Enforce the bounds of a TCB CheckTCBEnforcement - Enforces that every function in a named TCB only directly calls other functions in the same TCB as marked by the enforce_tcb and enforce_tcb_leaf attributes.

Definition at line 16877 of file SemaChecking.cpp.

References clang::SemaBase::Diag(), getCurFunctionOrMethodDecl(), clang::Decl::hasAttr(), isUnevaluatedContext(), and clang::Decl::specific_attrs().

Referenced by CheckFunctionCall().

◆ CheckTemplateArgument() [1/3]

ExprResult Sema::CheckTemplateArgument ( NamedDecl * Param,
QualType ParamType,
Expr * Arg,
TemplateArgument & SugaredConverted,
TemplateArgument & CanonicalConverted,
bool StrictCheck,
CheckTemplateArgumentKind CTAK )

Check a template argument against its corresponding non-type template parameter.

This routine implements the semantics of C++ [temp.arg.nontype]. If an error occurred, it returns ExprError(); otherwise, it returns the converted template argument. ParamType is the type of the non-type template parameter after it has been instantiated.

Definition at line 7113 of file SemaTemplate.cpp.

References ActOnConstantExpression(), ActOnFinishFullExpr(), clang::AlreadyDiagnosed, BuildConvertedConstantExpression(), clang::cast(), clang::Type::castAs(), CheckConvertedConstantExpression(), CheckNonTypeTemplateParameterType(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentPointerToMember(), ConstantEvaluated, Context, clang::CPlusPlus11, clang::CPlusPlus17, clang::CPlusPlus20, clang::InitializationKind::CreateForInit(), CTAK_Deduced, DeduceAutoType(), DeduceTemplateSpecializationFromInitializer(), DefaultLvalueConversion(), clang::SemaBase::Diag(), DiagnoseUseOfDecl(), EvaluateConvertedConstantExpression(), clang::ExprError(), FixOverloadedFunctionReference(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Type::getAsEnumDecl(), clang::Stmt::getBeginLoc(), clang::Decl::getCanonicalDecl(), clang::QualType::getCanonicalType(), clang::Type::getContainedDeducedType(), clang::Expr::getExprLoc(), getLangOpts(), clang::QualType::getNonLValueExprType(), clang::QualType::getNonReferenceType(), clang::MemberPointerType::getPointeeType(), clang::PointerType::getPointeeType(), clang::ReferenceType::getPointeeType(), clang::Type::getPointeeType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::TypeSourceInfo::getType(), clang::ValueDecl::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::QualType::getUnqualifiedType(), clang::QualType::hasQualifiers(), clang::Expr::IgnoreParenImpCasts(), ImpCastExprToType(), InitializationSequence, clang::InitializedEntity::InitializeTemplateParameter(), clang::Inits, clang::isa(), clang::Type::isArrayType(), clang::Type::isBitIntType(), clang::Type::isBooleanType(), clang::Type::isDependentType(), clang::Type::isEnumeralType(), clang::Type::isFunctionType(), clang::Type::isIncompleteOrObjectType(), clang::Type::isIntegralOrEnumerationType(), IsIntegralPromotion(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isLValueReferenceType(), clang::Type::isMemberPointerType(), clang::QualType::isNull(), isNullPointerValueTemplateArgument(), clang::Type::isNullPtrType(), clang::Type::isPointerOrReferenceType(), clang::Type::isPointerType(), clang::Type::isRecordType(), clang::Type::isReferenceType(), clang::Type::isRValueReferenceType(), clang::Type::isSignedIntegerOrEnumerationType(), clang::Expr::isTypeDependent(), clang::ActionResult< PtrTy, Compress >::isUnset(), clang::Type::isUnsignedIntegerOrEnumerationType(), clang::Expr::isValueDependent(), NoteTemplateParameterLocation(), NPV_Error, NPV_NotNullPointer, NPV_NullPointer, clang::InitializationSequence::Perform(), ResolveAddressOfOverloadedFunction(), clang::Result, Sema(), SubstAutoTypeDependent(), clang::Success, clang::T, clang::TempArgStrict, clang::TemplateArg, toString(), VerifyIntegerConstantExpression(), clang::VK_LValue, clang::VK_PRValue, and clang::VK_XValue.

◆ CheckTemplateArgument() [2/3]

bool Sema::CheckTemplateArgument ( NamedDecl * Param,
TemplateArgumentLoc & Arg,
NamedDecl * Template,
SourceLocation TemplateLoc,
SourceLocation RAngleLoc,
unsigned ArgumentPackIndex,
CheckTemplateArgumentInfo & CTAI,
CheckTemplateArgumentKind CTAK )

Check that the given template argument corresponds to the given template parameter.

Parameters
ParamThe template parameter against which the argument will be checked.
ArgThe template argument, which may be updated due to conversions.
TemplateThe template in which the template argument resides.
TemplateLocThe location of the template name for the template whose argument list we're matching.
RAngleLocThe location of the right angle bracket ('>') that closes the template argument list.
ArgumentPackIndexThe index into the argument pack where this argument will be placed. Only valid if the parameter is a parameter pack.
CTAKDescribes how we arrived at this particular template argument: explicitly written, deduced, etc.
Returns
true on error, false otherwise.

Definition at line 5515 of file SemaTemplate.cpp.

References ActOnPackExpansion(), clang::MultiLevelTemplateArgumentList::addOuterRetainedLevels(), clang::CXXScopeSpec::Adopt(), BuildExpressionFromNonTypeTemplateArgument(), clang::Sema::CheckTemplateArgumentInfo::CanonicalConverted, clang::cast(), CheckNonTypeTemplateParameterType(), CheckTemplateArgument(), CheckTemplateTemplateArgument(), CheckTemplateTypeArgument(), Context, convertTypeTemplateArgumentToTemplate(), clang::DependentScopeDeclRefExpr::Create(), CTAK_Specified, CurContext, clang::TemplateArgument::Declaration, clang::SemaBase::Diag(), clang::TemplateArgument::Expression, clang::ActionResult< PtrTy, Compress >::get(), clang::TemplateArgumentLoc::getArgument(), clang::Type::getAs(), clang::TemplateName::getAsDependentTemplateName(), clang::TemplateArgument::getAsExpr(), clang::TemplateArgument::getAsTemplateOrTemplatePattern(), clang::TemplateArgument::getAsType(), clang::SourceRange::getBegin(), clang::TemplateTemplateParmDecl::getExpansionTemplateParameters(), clang::TemplateArgument::getKind(), getLangOpts(), clang::TemplateArgumentLoc::getLocation(), clang::TemplateArgumentLoc::getSourceRange(), clang::TemplateArgumentLoc::getTemplateEllipsisLoc(), clang::TemplateArgumentLoc::getTemplateNameLoc(), clang::TemplateDecl::getTemplateParameters(), clang::TemplateArgumentLoc::getTemplateQualifierLoc(), clang::TypeSourceInfo::getTypeLoc(), clang::TemplateArgumentLoc::getTypeSourceInfo(), clang::CXXScopeSpec::getWithLocInContext(), clang::TemplateArgument::Integral, clang::TemplateTemplateParmDecl::isExpandedParameterPack(), clang::Type::isInstantiationDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::QualType::isNull(), clang::TemplateArgument::isNull(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Sema::CheckTemplateArgumentInfo::MatchingTTP, NoteTemplateParameterLocation(), clang::TemplateArgument::Null, clang::TemplateArgument::NullPtr, clang::TemplateArgument::Pack, clang::Sema::CheckTemplateArgumentInfo::PartialOrdering, clang::Sema::CheckTemplateArgumentInfo::StrictPackMatch, clang::TemplateArgument::StructuralValue, SubstTemplateParams(), SubstType(), clang::Sema::CheckTemplateArgumentInfo::SugaredConverted, clang::T, clang::Template, clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, clang::TemplateTemplateParmDecl::templateParameterKind(), clang::TNK_Concept_template, clang::TNK_Var_template, and clang::TemplateArgument::Type.

Referenced by ActOnTypeParameter(), CheckTemplateArgument(), CheckTemplateArgumentList(), CheckTemplateTypeArgument(), ConvertDeducedTemplateArgument(), ConvertDeducedTemplateArguments(), and LookupLiteralOperator().

◆ CheckTemplateArgument() [3/3]

bool Sema::CheckTemplateArgument ( TypeSourceInfo * Arg)

Check a template argument against its corresponding template type parameter.

This routine implements the semantics of C++ [temp.arg.type]. It returns true if an error occurred, and false otherwise.

Definition at line 6511 of file SemaTemplate.cpp.

References Context, clang::SemaBase::Diag(), clang::SourceRange::getBegin(), clang::TypeLoc::getSourceRange(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::Type::hasUnnamedOrLocalType(), clang::Type::isVariablyModifiedType(), and LangOpts.

◆ CheckTemplateArgumentList() [1/2]

bool Sema::CheckTemplateArgumentList ( TemplateDecl * Template,
SourceLocation TemplateLoc,
TemplateArgumentListInfo & TemplateArgs,
const DefaultArguments & DefaultArgs,
bool PartialTemplateArgs,
CheckTemplateArgumentInfo & CTAI,
bool UpdateArgsWithConversions = true,
bool * ConstraintsNotSatisfied = nullptr )

Check that the given template arguments can be provided to the given template, converting the arguments along the way.

Check that the given template argument list is well-formed for specializing the given template.

Parameters
TemplateThe template to which the template arguments are being provided.
TemplateLocThe location of the template name in the source.
TemplateArgsThe list of template arguments. If the template is a template template parameter, this function may extend the set of template arguments to also include substituted, defaulted template arguments.
PartialTemplateArgsTrue if the list of template arguments is intentionally partial, e.g., because we're checking just the initial set of template arguments.
ConvertedWill receive the converted, canonicalized template arguments.
UpdateArgsWithConversionsIf true, update TemplateArgs to contain the converted forms of the template arguments as written. Otherwise, TemplateArgs will not be modified.
ConstraintsNotSatisfiedIf provided, and an error occurred, will receive true if the cause for the error is the associated constraints of the template not being satisfied by the template arguments.
DefaultArgsany default arguments from template specialization deduction.
Returns
true if an error occurred, false otherwise.

Definition at line 5828 of file SemaTemplate.cpp.

References CheckTemplateArgumentList(), clang::ConstraintsNotSatisfied, GetTemplateParameterList(), and clang::Template.

Referenced by ActOnClassTemplateSpecialization(), ActOnExplicitInstantiation(), ActOnVarTemplateSpecialization(), CheckConceptTemplateId(), CheckDeducedPlaceholderConstraints(), CheckTemplateArgumentList(), CheckTemplateIdType(), CheckVarOrConceptTemplateTemplateId(), CheckVarTemplateId(), FinishTemplateArgumentDeduction(), isTemplateTemplateParameterAtLeastAsSpecializedAs(), and SubstituteExplicitTemplateArguments().

◆ CheckTemplateArgumentList() [2/2]

bool Sema::CheckTemplateArgumentList ( TemplateDecl * Template,
TemplateParameterList * Params,
SourceLocation TemplateLoc,
TemplateArgumentListInfo & TemplateArgs,
const DefaultArguments & DefaultArgs,
bool PartialTemplateArgs,
CheckTemplateArgumentInfo & CTAI,
bool UpdateArgsWithConversions = true,
bool * ConstraintsNotSatisfied = nullptr )

Check that the given template argument list is well-formed for specializing the given template.

Definition at line 5841 of file SemaTemplate.cpp.

References _2, clang::TemplateArgumentListInfo::addArgument(), clang::DefaultArguments::Args, clang::TemplateParameterList::begin(), clang::Sema::CheckTemplateArgumentInfo::CanonicalConverted, clang::cast(), clang::TypeLoc::castAs(), clang::Decl::castToDeclContext(), CheckTemplateArgument(), collectUnexpandedParameterPacks(), clang::ConstraintsNotSatisfied, Context, clang::TemplateArgument::CreatePackCopy(), CTAK_Specified, CurrentInstantiationScope, clang::SemaBase::Diag(), diagnoseMissingArgument(), clang::TemplateParameterList::end(), EnsureTemplateArgumentListConstraints(), clang::First, clang::TemplateArgumentLoc::getArgument(), getArgument(), clang::TemplateParameterList::getDepth(), clang::getExpandedPackSize(), clang::TemplateArgumentLoc::getLocation(), clang::TemplateArgumentLoc::getLocInfo(), clang::TemplateArgument::getPackExpansionPattern(), clang::TemplateArgumentListInfo::getRAngleLoc(), clang::TemplateArgumentLoc::getSourceRange(), clang::TemplateParameterList::getSourceRange(), getTemplateInstantiationArgs(), getTemplateNameKindForDiagnostics(), clang::isa(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::TemplateArgument::isNull(), clang::NonTypeTemplateParmDecl::isPackExpansion(), clang::TemplateArgument::isPackExpansion(), clang::isPackProducingBuiltinTemplateName(), clang::Sema::CheckTemplateArgumentInfo::MatchingTTP, clang::Method, NoteTemplateLocation(), NoteTemplateParameterLocation(), clang::Sema::CheckTemplateArgumentInfo::PartialOrdering, clang::TemplateArgumentListInfo::size(), clang::DefaultArguments::StartPos, clang::Sema::CheckTemplateArgumentInfo::StrictPackMatch, SubstDefaultTemplateArgumentIfAvailable(), clang::Sema::CheckTemplateArgumentInfo::SugaredConverted, clang::Template, and clang::TemplateName.

◆ CheckTemplateDeclScope()

◆ CheckTemplateIdType()

QualType Sema::CheckTemplateIdType ( ElaboratedTypeKeyword Keyword,
TemplateName Template,
SourceLocation TemplateLoc,
TemplateArgumentListInfo & TemplateArgs,
Scope * Scope,
bool ForNestedNameSpecifier )

Definition at line 3735 of file SemaTemplate.cpp.

References clang::MultiLevelTemplateArgumentList::addOuterRetainedLevels(), clang::MultiLevelTemplateArgumentList::addOuterTemplateArguments(), clang::sema::TemplateDeductionInfo::addSFINAEDiagnostic(), AliasTemplate, clang::TemplateArgumentListInfo::arguments(), clang::Sema::CheckTemplateArgumentInfo::CanonicalConverted, checkBuiltinTemplateIdType(), CheckTemplateArgumentList(), ClassTemplate, Context, clang::ClassTemplateSpecializationDecl::Create(), CurContext, clang::SemaBase::Diag(), DiagnoseUseOfDecl(), clang::TemplateArgument::Expression, findFailedBooleanCondition(), clang::TemplateName::getAsTemplateDecl(), clang::TemplateArgumentListInfo::getRAngleLoc(), getSFINAEContext(), clang::Stmt::getSourceRange(), clang::KeywordHelpers::getTagTypeKindForKeyword(), clang::TemplateName::getTemplateDeclAndDefaultArgs(), clang::TypedefNameDecl::getUnderlyingType(), clang::sema::TemplateDeductionInfo::hasSFINAEDiagnostic(), InstantiateAttrsForDecl(), clang::isa(), clang::Type::isCanonicalUnqualified(), clang::TemplateName::isDependent(), isEnableIfAliasTemplate(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::Decl::isInvalidDecl(), clang::QualType::isNull(), clang::Keyword, clang::None, NoteAllFoundTemplates(), clang::SemaBase::PDiag(), clang::sema::TemplateDeductionInfo::peekSFINAEDiagnostic(), resolveAssumedTemplateNameAsType(), clang::SemaBase::SemaRef, clang::Decl::setLexicalDeclContext(), clang::Sema::CheckTemplateArgumentInfo::StrictPackMatch, SubstType(), clang::Sema::CheckTemplateArgumentInfo::SugaredConverted, clang::sema::TemplateDeductionInfo::takeSFINAEDiagnostic(), clang::Template, clang::TSK_Undeclared, clang::TypeAliasTemplate, and clang::Typename.

Referenced by ActOnCXXNestedNameSpecifier(), ActOnTagTemplateIdType(), ActOnTemplateIdType(), ActOnTypenameType(), BuildStdClassTemplate(), builtinCommonTypeImpl(), checkBuiltinTemplateIdType(), CheckPlaceholderExpr(), FindInstantiatedDecl(), getStdTrait(), lookupCoroutineHandleType(), and lookupPromiseType().

◆ CheckTemplateParameterList()

bool Sema::CheckTemplateParameterList ( TemplateParameterList * NewParams,
TemplateParameterList * OldParams,
TemplateParamListContext TPC,
SkipBodyInfo * SkipBody = nullptr )

Checks the validity of a template parameter list, possibly considering the template parameter list from a previous declaration.

If an "old" template parameter list is provided, it must be equivalent (per TemplateParameterListsAreEqual) to the "new" template parameter list.

Parameters
NewParamsTemplate parameter list for a new template declaration. This template parameter list will be updated with any default arguments that are carried through from the previous template parameter list.
OldParamsIf provided, template parameter list from a previous declaration of the same template. Default template arguments will be merged from the old template parameter list to the new template parameter list.
TPCDescribes the context in which we are checking the given template parameter list.
SkipBodyIf we might have already made a prior merged definition of this template visible, the corresponding body-skipping information. Default argument redefinition is not an error when skipping such a body, because (under the ODR) we can assume the default arguments are the same as the prior merged definition.
Returns
true if an error occurred, false otherwise.

Definition at line 2410 of file SemaTemplate.cpp.

References clang::TemplateParameterList::begin(), clang::cast(), Context, clang::SemaBase::Diag(), DiagnoseDefaultTemplateArgument(), DiagnoseUnexpandedParameterPack(), DiagnoseUnexpandedParameterPacks(), clang::TemplateParameterList::end(), getASTContext(), clang::TemplateTemplateParmDecl::getDefaultArgument(), clang::NonTypeTemplateParmDecl::getDefaultArgumentLoc(), clang::TemplateTypeParmDecl::getDefaultArgumentLoc(), clang::Module::getFullModuleName(), clang::Decl::getImportedOwningModule(), clang::Decl::getLocation(), clang::TemplateArgumentLoc::getLocation(), clang::Decl::getOwningModule(), clang::TemplateArgumentLoc::getSourceRange(), clang::NonTypeTemplateParmDecl::hasDefaultArgument(), clang::TemplateTemplateParmDecl::hasDefaultArgument(), clang::TemplateTypeParmDecl::hasDefaultArgument(), hasVisibleDefaultArgument(), clang::Invalid, clang::TemplateTemplateParmDecl::isPackExpansion(), clang::TemplateTemplateParmDecl::isParameterPack(), clang::TemplateTemplateParmDecl::removeDefaultArgument(), clang::TemplateTemplateParmDecl::setInheritedDefaultArgument(), clang::SkipBodyInfo::ShouldSkip, TPC_FriendClassTemplate, TPC_Other, TPC_TemplateTemplateParameterPack, and UPPC_NonTypeTemplateParameterType.

Referenced by ActOnAliasDeclaration(), ActOnFunctionDeclarator(), ActOnTemplateTemplateParameter(), ActOnVariableDeclarator(), CheckClassTemplate(), and MatchTemplateParametersToScopeSpecifier().

◆ CheckTemplatePartialSpecialization() [1/2]

void Sema::CheckTemplatePartialSpecialization ( ClassTemplatePartialSpecializationDecl * Partial)

◆ CheckTemplatePartialSpecialization() [2/2]

void Sema::CheckTemplatePartialSpecialization ( VarTemplatePartialSpecializationDecl * Partial)

Definition at line 4304 of file SemaTemplate.cpp.

References checkTemplatePartialSpecialization().

◆ CheckTemplatePartialSpecializationArgs()

bool Sema::CheckTemplatePartialSpecializationArgs ( SourceLocation Loc,
TemplateDecl * PrimaryTemplate,
unsigned NumExplicitArgs,
ArrayRef< TemplateArgument > Args )

Check the non-type template arguments of a class template partial specialization according to C++ [temp.class.spec]p9.

Parameters
TemplateNameLocthe location of the template name.
PrimaryTemplatethe template parameters of the primary class template.
NumExplicitthe number of explicitly-specified template arguments.
TemplateArgsthe template arguments of the class template partial specialization.
Returns
true if there was an error, false otherwise.

Definition at line 8705 of file SemaTemplate.cpp.

References CheckNonTypeTemplatePartialSpecializationArgs(), clang::Decl::getDeclContext(), clang::TemplateParameterList::getParam(), clang::TemplateDecl::getTemplateParameters(), clang::DeclContext::isDependentContext(), and clang::TemplateParameterList::size().

Referenced by ActOnClassTemplateSpecialization(), and ActOnVarTemplateSpecialization().

◆ CheckTemplateTemplateArgument()

◆ CheckTemplateTypeArgument()

bool Sema::CheckTemplateTypeArgument ( TemplateTypeParmDecl * Param,
TemplateArgumentLoc & Arg,
SmallVectorImpl< TemplateArgument > & SugaredConverted,
SmallVectorImpl< TemplateArgument > & CanonicalConverted )

Definition at line 5154 of file SemaTemplate.cpp.

References clang::CXXScopeSpec::Adopt(), clang::Sema::CodeSynthesisContext::BuildingDeductionGuides, CheckTemplateArgument(), CodeSynthesisContexts, Context, clang::FixItHint::CreateInsertion(), clang::SemaBase::Diag(), diagnoseMissingTemplateArguments(), clang::TemplateArgument::Expression, clang::TemplateArgumentLoc::getArgument(), clang::TemplateArgument::getAsExpr(), clang::DeclarationName::getAsIdentifierInfo(), clang::TemplateArgument::getAsTemplateOrTemplatePattern(), clang::TemplateArgument::getAsType(), clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::TemplateArgument::getKind(), getLangOpts(), clang::DeclarationNameInfo::getLoc(), clang::DeclarationNameInfo::getName(), clang::CXXScopeSpec::getScopeRep(), clang::TemplateArgumentLoc::getSourceRange(), clang::TemplateArgumentLoc::getTypeSourceInfo(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::CXXScopeSpec::getWithLocInContext(), inParameterMappingSubstitution(), LookupOrdinaryName, LookupParsedName(), clang::None, NoteTemplateParameterLocation(), clang::Qualifiers::OCL_Strong, clang::TemplateArgument::Pack, clang::TypeLocBuilder::push(), clang::Result, clang::DependentNameTypeLoc::setElaboratedKeywordLoc(), clang::DependentNameTypeLoc::setNameLoc(), clang::Qualifiers::setObjCLifetime(), clang::DependentNameTypeLoc::setQualifierLoc(), clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, and clang::TemplateArgument::Type.

Referenced by CheckTemplateArgument().

◆ checkThisInStaticMemberFunctionAttributes()

bool Sema::checkThisInStaticMemberFunctionAttributes ( CXXMethodDecl * Method)

Check whether 'this' shows up in the attributes of the given static member function.

Returns
true if an error occurred.

Definition at line 19370 of file SemaDeclCXX.cpp.

References clang::Method.

Referenced by ActOnFinishDelayedAttribute(), and checkThisInStaticMemberFunctionType().

◆ checkThisInStaticMemberFunctionExceptionSpec()

◆ checkThisInStaticMemberFunctionType()

bool Sema::checkThisInStaticMemberFunctionType ( CXXMethodDecl * Method)

◆ CheckThreadLocalForLargeAlignment()

◆ CheckTransparentUnionArgumentConstraints()

◆ CheckTypeConstraint()

◆ checkTypeDeclType()

void Sema::checkTypeDeclType ( DeclContext * LookupCtx,
DiagCtorKind DCK,
TypeDecl * TD,
SourceLocation NameLoc )

Returns the TypeDeclType for the given type declaration, as ASTContext::getTypeDeclType would, but performs the required semantic checks for name lookup of said entity.

Definition at line 147 of file SemaDecl.cpp.

References clang::cast(), clang::declaresSameEntity(), clang::SemaBase::Diag(), DiagnoseUseOfDecl(), clang::NamedDecl::getIdentifier(), clang::Decl::getLocation(), MarkAnyDeclReferenced(), None, and Typename.

Referenced by CheckTypenameType(), and getTypeName().

◆ CheckTypedefForVariablyModifiedType()

◆ CheckTypenameType() [1/2]

◆ CheckTypenameType() [2/2]

◆ checkTypeSupport()

◆ CheckTypeTraitArity()

bool Sema::CheckTypeTraitArity ( unsigned Arity,
SourceLocation Loc,
size_t N )

Definition at line 1424 of file SemaTypeTraits.cpp.

References clang::SemaBase::Diag().

Referenced by BuildTypeTrait().

◆ checkUInt32Argument()

◆ CheckUnaryExprOrTypeTraitOperand() [1/2]

◆ CheckUnaryExprOrTypeTraitOperand() [2/2]

bool Sema::CheckUnaryExprOrTypeTraitOperand ( QualType ExprType,
SourceLocation OpLoc,
SourceRange ExprRange,
UnaryExprOrTypeTrait ExprKind,
StringRef KWName )

Check the constraints on operands to unary expression and type traits.

This will complete any types necessary, and validate the various constraints on those operands.

The UsualUnaryConversions() function is not called by this routine. C99 6.3.2.1p[2-4] all state: Except when it is the operand of the sizeof operator ...

C++ [expr.sizeof]p4 The lvalue-to-rvalue, array-to-pointer, and function-to-pointer standard conversions are not applied to the operand of sizeof.

This policy is followed for all of the unary trait expressions.

Definition at line 4591 of file SemaExpr.cpp.

References clang::C2y, captureVariablyModifiedType(), CheckExtensionTraitOperandType(), CheckObjCTraitOperandConstraints(), checkPtrAuthTypeDiscriminatorOperandType(), CheckVecStepTraitOperandType(), CheckVectorElementsTraitOperandType(), clang::DeclContext::containsDecl(), Context, clang::CPlusPlus, clang::SemaBase::Diag(), FunctionScopes, clang::Type::getAs(), getLangOpts(), clang::Type::getPointeeType(), clang::getTraitSpelling(), clang::Type::isArrayType(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::Type::isIncompleteArrayType(), clang::Type::isVariablyModifiedType(), clang::Type::isWebAssemblyTableType(), and RequireCompleteSizedType().

◆ CheckUnevaluatedOperand()

ExprResult Sema::CheckUnevaluatedOperand ( Expr * E)

◆ checkUnknownAnyArg()

◆ checkUnknownAnyCast()

ExprResult Sema::checkUnknownAnyCast ( SourceRange TypeRange,
QualType CastType,
Expr * CastExpr,
CastKind & CastKind,
ExprValueKind & VK,
CXXCastPath & Path )

Check a cast of an unknown-any type.

We intentionally only trigger this for C-style casts.

Definition at line 21419 of file SemaExpr.cpp.

References clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::SourceRange::getBegin(), clang::Expr::getValueKind(), clang::ActionResult< PtrTy, Compress >::isUsable(), and RequireCompleteType().

◆ CheckUnresolvedLookupAccess()

◆ CheckUnresolvedMemberAccess()

◆ checkUnsafeAssigns()

bool Sema::checkUnsafeAssigns ( SourceLocation Loc,
QualType LHS,
Expr * RHS )

checkUnsafeAssigns - Check whether +1 expr is being assigned to weak/__unsafe_unretained type.

Definition at line 15512 of file SemaChecking.cpp.

References checkUnsafeAssignObject(), clang::QualType::getObjCLifetime(), clang::Qualifiers::OCL_ExplicitNone, and clang::Qualifiers::OCL_Weak.

Referenced by AddInitializerToDecl(), and checkUnsafeExprAssigns().

◆ checkUnsafeExprAssigns()

◆ checkUnusedDeclAttributes()

void Sema::checkUnusedDeclAttributes ( Declarator & D)

checkUnusedDeclAttributes - Given a declarator which is not being used to build a declaration, complain about any decl attributes which might be lying around on it.

Definition at line 8304 of file SemaDeclAttr.cpp.

References checkUnusedDeclAttributes(), clang::Declarator::getAttributes(), clang::DeclSpec::getAttributes(), clang::DeclaratorChunk::getAttrs(), clang::Declarator::getDeclarationAttributes(), clang::Declarator::getDeclSpec(), clang::Declarator::getNumTypeObjects(), and clang::Declarator::getTypeObject().

Referenced by ActOnCastExpr(), ActOnTypeName(), and checkUnusedDeclAttributes().

◆ CheckUnusedVolatileAssignment()

void Sema::CheckUnusedVolatileAssignment ( Expr * E)

Check whether E, which is either a discarded-value expression or an unevaluated operand, is a simple-assignment to a volatlie-qualified lvalue, and if so, remove it from the list of volatile-qualified assignments that we are going to warn are deprecated.

Definition at line 17970 of file SemaExpr.cpp.

References clang::CPlusPlus20, ExprEvalContexts, getLangOpts(), clang::Expr::getType(), clang::Expr::IgnoreParenImpCasts(), and clang::QualType::isVolatileQualified().

Referenced by CheckUnevaluatedOperand(), and IgnoredValueConversions().

◆ CheckUseOfCXXMethodAsAddressOfOperand()

◆ CheckUsingDeclQualifier()

bool Sema::CheckUsingDeclQualifier ( SourceLocation UsingLoc,
bool HasTypename,
const CXXScopeSpec & SS,
const DeclarationNameInfo & NameInfo,
SourceLocation NameLoc,
const LookupResult * R = nullptr,
const UsingDecl * UD = nullptr )

Checks that the given nested-name qualifier used in a using decl in the current context is appropriately related to the current scope.

If an error is found, diagnoses it and returns true. R is nullptr, if the caller has not (yet) done a lookup, otherwise it's the result of that lookup. UD is likewise nullptr, except when we have an already-populated UsingDecl whose shadow decls contain the same information (i.e. we're instantiating a UsingDecl with non-dependent scope).

Definition at line 13529 of file SemaDeclCXX.cpp.

References clang::cast(), computeDeclContext(), clang::CPlusPlus11, clang::CPlusPlus20, clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateReplacement(), CurContext, Diag(), clang::LookupResult::getAsSingle(), clang::DeclarationName::getAsString(), clang::CXXScopeSpec::getBeginLoc(), clang::DeclarationNameInfo::getEndLoc(), getLangOpts(), getLocForEndOfToken(), clang::DeclarationNameInfo::getName(), clang::CXXScopeSpec::getRange(), clang::DeclContext::getRedeclContext(), clang::CXXScopeSpec::getScopeRep(), clang::UsingShadowDecl::getTargetDecl(), clang::DeclContext::isDependentContext(), isProvablyNotDerivedFrom(), clang::DeclContext::isRecord(), RequireCompleteDeclContext(), clang::BaseUsingDecl::shadow_begin(), and clang::BaseUsingDecl::shadow_size().

Referenced by BuildUsingDeclaration().

◆ CheckUsingDeclRedeclaration()

bool Sema::CheckUsingDeclRedeclaration ( SourceLocation UsingLoc,
bool HasTypenameKeyword,
const CXXScopeSpec & SS,
SourceLocation NameLoc,
const LookupResult & Previous )

Checks that the given using declaration is not an invalid redeclaration.

Note that this is checking only for the using decl itself, not for any ill-formedness among the UsingShadowDecls.

Definition at line 13458 of file SemaDeclCXX.cpp.

References CurContext, Diag(), clang::NestedNameSpecifier::getCanonical(), clang::Decl::getLocation(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::isa(), and clang::NestedNameSpecifier::isDependent().

Referenced by BuildUsingDeclaration().

◆ CheckUsingShadowDecl()

◆ checkVarDeclRedefinition()

bool Sema::checkVarDeclRedefinition ( VarDecl * OldDefn,
VarDecl * NewDefn )

We've just determined that Old and New both appear to be definitions of the same variable.

Either diagnose or fix the problem.

Definition at line 4972 of file SemaDecl.cpp.

References clang::SemaBase::Diag(), clang::VarDecl::getDescribedVarTemplate(), hasVisibleDefinition(), clang::Internal, clang::isa(), makeMergedDefinitionVisible(), New, and notePreviousDefinition().

Referenced by AddInitializerToDecl(), and MergeVarDecl().

◆ CheckVariableDeclaration()

bool Sema::CheckVariableDeclaration ( VarDecl * NewVD,
LookupResult & Previous )

Perform semantic checking on a newly-created variable declaration.

This routine performs all of the type-checking required for a variable declaration once it has been built. It is used both to check variables after they have been parsed and their declarators have been translated into a declaration, and to check variables that have been instantiated from a template.

Sets NewVD->isInvalidDecl() if an error was encountered.

Returns true if the variable declaration is a redeclaration.

Definition at line 9199 of file SemaDecl.cpp.

References checkForConflictWithNonVisibleExternC(), CheckVariableDeclarationType(), clang::Decl::isInvalidDecl(), MergeVarDecl(), and Previous.

Referenced by ActOnVariableDeclarator(), and BuildVariableInstantiation().

◆ CheckVariableDeclarationType()

void Sema::CheckVariableDeclarationType ( VarDecl * NewVD)

Definition at line 8884 of file SemaDecl.cpp.

References ARM(), clang::C23, clang::cast(), CheckAlignasUnderalignment(), CheckC23ConstexprVarType(), clang::SemaRISCV::checkRVVTypeSupport(), Context, clang::CPlusPlus, clang::FixItHint::CreateInsertion(), CurContext, clang::Default, clang::SemaBase::Diag(), diagnoseOpenCLTypes(), getASTContext(), getCurFunctionDecl(), getCurScope(), getLangOpts(), clang::Decl::getLocation(), getOpenCLOptions(), clang::VariableArrayType::getSizeExpr(), clang::Stmt::getSourceRange(), clang::VarDecl::getStorageClass(), clang::TypeSourceInfo::getType(), clang::ValueDecl::getType(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::Decl::hasAttr(), clang::Decl::hasAttrs(), clang::VarDecl::hasExternalStorage(), clang::VarDecl::hasGlobalStorage(), clang::NamedDecl::hasLinkage(), clang::VarDecl::hasLocalStorage(), clang::HIP, clang::isa(), clang::OpenCLOptions::isAvailableOption(), clang::VarDecl::isConstexpr(), clang::VarDecl::isFileVarDecl(), clang::Decl::isInvalidDecl(), clang::VarDecl::isLocalVarDecl(), clang::QualType::isNull(), clang::VarDecl::isStaticLocal(), clang::VarDecl::isThisDeclarationADefinition(), LangOpts, clang::LangOptionsBase::NonGC, OpenCL(), clang::opencl_constant, clang::opencl_global, clang::opencl_local, clang::opencl_private, PPC(), RequireLiteralType(), RISCV(), clang::SC_Static, setFunctionHasBranchProtectedScope(), clang::Decl::setInvalidDecl(), clang::ValueDecl::setType(), clang::DeclaratorDecl::setTypeSourceInfo(), clang::T, TryToFixInvalidVariablyModifiedType(), and TryToFixInvalidVariablyModifiedTypeSourceInfo().

Referenced by buildCoroutinePromise(), CheckVariableDeclaration(), and DeduceVariableDeclarationType().

◆ checkVariadicArgument()

◆ CheckVarOrConceptTemplateTemplateId()

◆ CheckVarTemplateId() [1/2]

ExprResult Sema::CheckVarTemplateId ( const CXXScopeSpec & SS,
const DeclarationNameInfo & NameInfo,
VarTemplateDecl * Template,
NamedDecl * FoundD,
SourceLocation TemplateLoc,
const TemplateArgumentListInfo * TemplateArgs )

Form a reference to the specialization of the given variable template corresponding to the specified argument list, or a null-but-valid result if the arguments are dependent.

Definition at line 4780 of file SemaTemplate.cpp.

References BuildDeclarationNameExpr(), clang::cast(), CheckVarTemplateId(), clang::ExprError(), clang::DeclarationNameInfo::getLoc(), clang::VarDecl::getTemplateSpecializationKind(), clang::VarDecl::setTemplateSpecializationKind(), clang::Template, and clang::TSK_ImplicitInstantiation.

◆ CheckVarTemplateId() [2/2]

◆ CheckVecStepExpr()

bool Sema::CheckVecStepExpr ( Expr * E)

◆ CheckVectorCast()

◆ CheckVectorCompareOperands()

QualType Sema::CheckVectorCompareOperands ( ExprResult & LHS,
ExprResult & RHS,
SourceLocation Loc,
BinaryOperatorKind Opc )

CheckVectorCompareOperands - vector comparisons are a clang extension that operates on extended vector types.

Instead of producing an IntTy result, like a scalar comparison, a vector comparison produces a vector of integer types.

Definition at line 13189 of file SemaExpr.cpp.

References clang::AltiVecVector, clang::Type::castAs(), CheckFloatComparison(), CheckVectorOperands(), Context, clang::SemaBase::Diag(), diagnoseTautologicalComparison(), clang::LangOptionsBase::GCC, clang::ActionResult< PtrTy, Compress >::get(), getLangOpts(), GetSignedVectorType(), clang::Expr::getType(), clang::VectorType::getVectorKind(), clang::Type::hasFloatingRepresentation(), clang::QualType::isNull(), clang::LangOptionsBase::Mixed, and clang::LangOptionsBase::XL.

Referenced by CheckCompareOperands().

◆ CheckVectorConditionalTypes()

◆ CheckVectorLogicalOperands()

◆ CheckVectorOperands()

QualType Sema::CheckVectorOperands ( ExprResult & LHS,
ExprResult & RHS,
SourceLocation Loc,
bool IsCompAssign,
bool AllowBothBool,
bool AllowBoolConversion,
bool AllowBoolOperation,
bool ReportInvalid )

type checking for vector binary operators.

Definition at line 10457 of file SemaExpr.cpp.

References clang::AltiVecBool, clang::AltiVecVector, anyAltivecTypes(), Context, DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), clang::Generic, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::VectorType::getElementType(), getLangOpts(), clang::VectorType::getNumElements(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::VectorType::getVectorKind(), clang::SemaHLSL::handleVectorBinOpConversion(), HLSL(), ImpCastExprToType(), InvalidOperands(), clang::isa(), clang::Type::isExtVectorBoolType(), clang::Type::isExtVectorType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), isLaxVectorConversion(), clang::Expr::isLValue(), clang::Type::isMFloat8Type(), clang::Type::isRealType(), clang::Type::isRVVSizelessBuiltinType(), clang::Type::isScalarType(), clang::Type::isSizelessBuiltinType(), clang::Type::isSVESizelessBuiltinType(), clang::Type::isVectorType(), OpenCL(), clang::RVVFixedLengthData, clang::RVVFixedLengthMask, clang::RVVFixedLengthMask_1, clang::RVVFixedLengthMask_2, clang::RVVFixedLengthMask_4, clang::SveFixedLengthData, clang::SveFixedLengthPredicate, tryGCCVectorConvertAndSplat(), tryVectorConvertAndSplat(), and clang::Vector.

Referenced by CheckAdditionOperands(), CheckBitwiseOperands(), CheckConditionalOperands(), CheckMultiplyDivideOperands(), CheckRemainderOperands(), CheckSubtractionOperands(), CheckVectorCompareOperands(), CheckVectorConditionalTypes(), CheckVectorLogicalOperands(), CXXCheckConditionalOperands(), and OpenCLCheckVectorConditional().

◆ CheckVirtualDtorCall()

◆ ClassifyName()

Sema::NameClassification Sema::ClassifyName ( Scope * S,
CXXScopeSpec & SS,
IdentifierInfo *& Name,
SourceLocation NameLoc,
const Token & NextToken,
CorrectionCandidateCallback * CCC = nullptr )

Perform name lookup on the given name, classifying it based on the results of name lookup and the following token.

This routine is used by the parser to resolve identifiers and help direct parsing. When the identifier cannot be found, this routine will attempt to correct the typo and classify based on the resulting name.

Parameters
SThe scope in which we're performing name lookup.
SSThe nested-name-specifier that precedes the name.
NameThe identifier. If typo correction finds an alternative name, this pointer parameter will be updated accordingly.
NameLocThe location of the identifier.
NextTokenThe token following the identifier. Used to help disambiguate the name.
CCCThe correction callback, if typo correction is desired.

Definition at line 898 of file SemaDecl.cpp.

References clang::Ambiguous, clang::cast(), clang::Class, computeDeclContext(), clang::Sema::NameClassification::Concept(), Context, CorrectTypo(), clang::CPlusPlus, clang::CPlusPlus20, clang::UnresolvedLookupExpr::Create(), CreateParsedType(), clang::Sema::NameClassification::DependentNonType(), diagnoseTypo(), DiagnoseUseOfDecl(), clang::Sema::NameClassification::Error(), clang::ErrorRecovery, FilterAcceptableTemplateNames(), FirstDecl, clang::Found, clang::FoundOverloaded, clang::FoundUnresolvedValue, clang::Sema::NameClassification::FunctionTemplate(), clang::ActionResult< PtrTy, Compress >::get(), getAsTemplateNameDecl(), getCurMethodDecl(), getLangOpts(), clang::DeclarationNameInfo::getName(), clang::IdentifierInfo::getName(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::UsingShadowDecl::getTargetDecl(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::CXXScopeSpec::getWithLocInContext(), hasAnyAcceptableTemplateNames(), ImplicitlyDefineFunction(), clang::Token::is(), clang::isa(), isCurrentClassName(), clang::CXXScopeSpec::isEmpty(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::CXXScopeSpec::isInvalid(), clang::Token::isNot(), clang::Token::isOneOf(), isResultTypeOrTemplate(), clang::CXXScopeSpec::isSet(), isTagTypeWithMissingTag(), clang::ActionResult< PtrTy, Compress >::isUsable(), LookupBuiltin(), clang::SemaObjC::LookupIvarInObjCMethod(), LookupOrdinaryName, LookupParsedName(), clang::OpaquePtr< QualType >::make(), MarkAnyDeclReferenced(), clang::None, clang::Sema::NameClassification::NonType(), clang::NotFound, clang::NotFoundInCurrentInstantiation, ObjC(), clang::Sema::NameClassification::OverloadSet(), clang::SemaBase::PDiag(), clang::TypeLocBuilder::push(), clang::TypeLocBuilder::pushTypeSpec(), recoverFromTypeInKnownDependentBase(), clang::Result, clang::TagTypeLoc::setElaboratedKeywordLoc(), clang::TypeSpecTypeLoc::setNameLoc(), clang::T, clang::Template, clang::TemplateName, clang::Sema::NameClassification::TypeTemplate(), clang::Sema::NameClassification::UndeclaredNonType(), clang::Sema::NameClassification::UndeclaredTemplate(), clang::Sema::NameClassification::Unknown(), UseArgumentDependentLookup(), and clang::Sema::NameClassification::VarTemplate().

◆ CleanupMergedEnum()

void Sema::CleanupMergedEnum ( Scope * S,
Decl * New )

CleanupMergedEnum - We have just merged the decl 'New' by making another definition visible.

This method performs any necessary cleanup on the parser state to discard child nodes from newly parsed decl we are retiring.

Definition at line 2711 of file SemaDecl.cpp.

References getNonFieldDeclScope(), IdResolver, clang::Scope::isDeclScope(), New, and clang::Scope::RemoveDecl().

Referenced by ActOnDuplicateDefinition(), and MergeTypedefNameDecl().

◆ CleanupVarDeclMarking()

◆ CodeCompletion()

SemaCodeCompletion & clang::Sema::CodeCompletion ( )
inline

Definition at line 1443 of file Sema.h.

Referenced by AddRecordMembersCompletionResults(), and ProduceSignatureHelp().

◆ collectUnexpandedParameterPacks() [1/7]

void Sema::collectUnexpandedParameterPacks ( const DeclarationNameInfo & NameInfo,
SmallVectorImpl< UnexpandedParameterPack > & Unexpanded )

Collect the set of unexpanded parameter packs within the given name.

Parameters
NameInfoThe name that will be traversed to find unexpanded parameter packs.

Definition at line 696 of file SemaTemplateVariadic.cpp.

◆ collectUnexpandedParameterPacks() [2/7]

void Sema::collectUnexpandedParameterPacks ( Expr * E,
SmallVectorImpl< UnexpandedParameterPack > & Unexpanded )
static

Collect the set of unexpanded parameter packs within the given expression.

Definition at line 703 of file SemaTemplateVariadic.cpp.

◆ collectUnexpandedParameterPacks() [3/7]

void Sema::collectUnexpandedParameterPacks ( NestedNameSpecifierLoc NNS,
SmallVectorImpl< UnexpandedParameterPack > & Unexpanded )

Collect the set of unexpanded parameter packs within the given nested-name-specifier.

Parameters
NNSThe nested-name-specifier that will be traversed to find unexpanded parameter packs.

Definition at line 689 of file SemaTemplateVariadic.cpp.

◆ collectUnexpandedParameterPacks() [4/7]

void Sema::collectUnexpandedParameterPacks ( QualType T,
SmallVectorImpl< UnexpandedParameterPack > & Unexpanded )

Collect the set of unexpanded parameter packs within the given type.

Parameters
TThe type that will be traversed to find unexpanded parameter packs.

Definition at line 679 of file SemaTemplateVariadic.cpp.

References clang::T.

◆ collectUnexpandedParameterPacks() [5/7]

void Sema::collectUnexpandedParameterPacks ( TemplateArgument Arg,
SmallVectorImpl< UnexpandedParameterPack > & Unexpanded )

Collect the set of unexpanded parameter packs within the given template argument.

Parameters
ArgThe template argument that will be traversed to find unexpanded parameter packs.

Definition at line 667 of file SemaTemplateVariadic.cpp.

Referenced by clang::FoldExpandedConstraint::AreCompatibleForSubsumption(), CheckTemplateArgumentList(), collectUnexpandedParameterPacks(), instantiateDependentAlignedAttr(), InstantiateMemInitializers(), and PreparePackForExpansion().

◆ collectUnexpandedParameterPacks() [6/7]

void Sema::collectUnexpandedParameterPacks ( TemplateArgumentLoc Arg,
SmallVectorImpl< UnexpandedParameterPack > & Unexpanded )

Collect the set of unexpanded parameter packs within the given template argument.

Parameters
ArgThe template argument that will be traversed to find unexpanded parameter packs.

Definition at line 673 of file SemaTemplateVariadic.cpp.

◆ collectUnexpandedParameterPacks() [7/7]

void Sema::collectUnexpandedParameterPacks ( TypeLoc TL,
SmallVectorImpl< UnexpandedParameterPack > & Unexpanded )

Collect the set of unexpanded parameter packs within the given type.

Parameters
TLThe type that will be traversed to find unexpanded parameter packs.

Definition at line 684 of file SemaTemplateVariadic.cpp.

◆ CompareReferenceRelationship()

Sema::ReferenceCompareResult Sema::CompareReferenceRelationship ( SourceLocation Loc,
QualType T1,
QualType T2,
ReferenceConversions * Conv = nullptr )

CompareReferenceRelationship - Compare the two types T1 and T2 to determine whether they are reference-compatible, reference-related, or incompatible, for use in C++ initialization by reference (C++ [dcl.ref.init]p4).

Neither type can be a reference type, and the first type (T1) is the pointee type of the reference type being initialized.

Definition at line 5131 of file SemaOverload.cpp.

References Context, getASTContext(), isCompleteType(), IsDerivedFrom(), IsFunctionConversion(), clang::Type::isFunctionType(), clang::Type::isObjCObjectOrInterfaceType(), isQualificationConversionStep(), clang::Type::isReferenceType(), Ref_Compatible, Ref_Incompatible, Ref_Related, and withoutUnaligned().

Referenced by CXXCheckConditionalOperands(), FindConversionForRefInit(), TryListConversion(), TryReferenceInit(), TryReferenceInitializationCore(), TryReferenceListInitialization(), and TryRefInitWithConversionFunction().

◆ CompleteConstructorCall()

bool Sema::CompleteConstructorCall ( CXXConstructorDecl * Constructor,
QualType DeclInitType,
MultiExprArg ArgsPtr,
SourceLocation Loc,
SmallVectorImpl< Expr * > & ConvertedArgs,
bool AllowExplicit = false,
bool IsListInitialization = false )

Given a constructor and the set of arguments provided for the constructor, convert the arguments and add any required default arguments to form a proper call to this constructor.

Returns
true if an error occurred, false otherwise.

Definition at line 16413 of file SemaDeclCXX.cpp.

References clang::Constructor, DiagnoseSentinelCalls(), clang::DoesNotApply, GatherArgumentsForCall(), clang::FunctionProtoType::getNumParams(), and clang::Invalid.

Referenced by BuildCXXCastArgument(), CopyObject(), clang::InitializationSequence::Perform(), PerformConstructorInitialization(), and PerformImplicitConversion().

◆ completeExprArrayBound()

◆ CompleteLambdaCallOperator()

◆ CompleteMemberSpecialization()

void Sema::CompleteMemberSpecialization ( NamedDecl * Member,
LookupResult & Previous )

◆ CompleteVarTemplateSpecializationDecl()

◆ computeDeclContext() [1/2]

DeclContext * Sema::computeDeclContext ( const CXXScopeSpec & SS,
bool EnteringContext = false )

Compute the DeclContext that is associated with the given scope specifier.

Parameters
SSthe C++ scope specifier as it appears in the source
EnteringContextwhen true, we will be entering the context of this scope specifier, so we can retrieve the declaration context of a class template or class template partial specialization even if it is not the current instantiation.
Returns
the declaration context represented by the scope specifier SS, or NULL if the declaration context cannot be computed (e.g., because it is dependent and not the current instantiation).

Definition at line 48 of file SemaCXXScopeSpec.cpp.

References clang::Type::castAsTagDecl(), ClassTemplate, Context, diagnoseMissingImport(), clang::NestedNameSpecifier::getAsMicrosoftSuper(), clang::NestedNameSpecifier::getAsNamespaceAndPrefix(), clang::NestedNameSpecifier::getAsType(), getCurrentInstantiationOf(), clang::TemplateParameterList::getDepth(), clang::NestedNameSpecifier::getKind(), clang::CXXScopeSpec::getLastQualifierNameLoc(), clang::CXXScopeSpec::getScopeRep(), clang::CXXScopeSpec::getTemplateParamLists(), clang::NestedNameSpecifier::Global, clang::CXXRecordDecl::hasDefinition(), hasReachableDefinition(), clang::NestedNameSpecifier::isDependent(), clang::CXXScopeSpec::isInvalid(), clang::CXXScopeSpec::isSet(), isSFINAEContext(), clang::NestedNameSpecifier::MicrosoftSuper, clang::NestedNameSpecifier::Namespace, clang::NestedNameSpecifier::Null, PartialSpecialization, and clang::NestedNameSpecifier::Type.

◆ computeDeclContext() [2/2]

◆ computeNRVO()

void Sema::computeNRVO ( Stmt * Body,
sema::FunctionScopeInfo * Scope )

Given the set of return statements within a function body, compute the variables that are subject to the named return value optimization.

Each of the variables that is subject to the named return value optimization will be marked as NRVO variables in the AST, and any return statement that has a marked NRVO variable as its NRVO candidate can use the named return value optimization.

This function applies a very simplistic algorithm for NRVO: if every return statement in the scope of a variable has the same NRVO candidate, that candidate is an NRVO variable.

Definition at line 16366 of file SemaDecl.cpp.

References clang::SemaBase::Diag(), and clang::ReturnStmt::setNRVOCandidate().

Referenced by ActOnBlockStmtExpr(), and ActOnFinishFunctionBody().

◆ ConditionError()

ConditionResult clang::Sema::ConditionError ( )
inlinestatic

◆ ConstantFoldAttrArgs()

bool Sema::ConstantFoldAttrArgs ( const AttributeCommonInfo & CI,
MutableArrayRef< Expr * > Args )

ConstantFoldAttrArgs - Folds attribute arguments into ConstantExprs (unless they are value dependent or type dependent).

Returns false and emits a diagnostic if one or more of the arguments could not be folded into a constant.

Result means the expression can be folded to a constant. Note.empty() means the expression is a valid constant expression in the current language mode.

Definition at line 503 of file SemaAttr.cpp.

References clang::AANT_ArgumentConstantExpr, Context, clang::ConstantExpr::Create(), clang::ImplicitCastExpr::Create(), clang::Expr::EvalStatus::Diag, clang::SemaBase::Diag(), clang::Expr::EvaluateAsConstantExpr(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::QualType::getNonReferenceType(), clang::Expr::getType(), ImpCastExprToType(), clang::Type::isArrayType(), clang::Type::isFunctionType(), clang::Expr::isLValue(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), clang::Note, clang::Result, clang::Expr::EvalResult::Val, and clang::VK_PRValue.

Referenced by CreateAnnotationAttr(), and HandleAnnotateTypeAttr().

◆ ConstraintExpressionDependsOnEnclosingTemplate()

bool Sema::ConstraintExpressionDependsOnEnclosingTemplate ( const FunctionDecl * Friend,
unsigned TemplateDepth,
const Expr * Constraint )

Definition at line 1849 of file SemaTemplate.cpp.

References clang::Friend.

Referenced by FriendConstraintsDependOnEnclosingTemplate().

◆ containsUnexpandedParameterPacks()

bool Sema::containsUnexpandedParameterPacks ( Declarator & D)

Determine whether the given declarator contains any unexpanded parameter packs.

This routine is used by the parser to disambiguate function declarators with an ellipsis prior to the ')', e.g.,

void f(T...);

To determine whether we have an (unnamed) function parameter pack or a variadic function.

Returns
true if the declarator contains any unexpanded parameter packs, false otherwise.

Definition at line 1136 of file SemaTemplateVariadic.cpp.

References clang::DeclaratorChunk::Arr, clang::DeclaratorChunk::Array, clang::DeclaratorChunk::BlockPointer, clang::cast(), clang::Expr::containsUnexpandedParameterPack(), clang::NestedNameSpecifier::containsUnexpandedParameterPack(), clang::Type::containsUnexpandedParameterPack(), clang::EST_Dynamic, clang::DeclaratorChunk::FunctionTypeInfo::Exceptions, clang::DeclaratorChunk::Fun, clang::DeclaratorChunk::Function, clang::OpaquePtr< PtrTy >::get(), clang::Declarator::getDeclSpec(), clang::DeclaratorChunk::FunctionTypeInfo::getExceptionSpecType(), clang::DeclaratorChunk::FunctionTypeInfo::getNumExceptions(), clang::Declarator::getNumTypeObjects(), clang::DeclSpec::getRepAsExpr(), clang::DeclSpec::getRepAsType(), clang::CXXScopeSpec::getScopeRep(), clang::Declarator::getTrailingRequiresClause(), clang::DeclaratorChunk::FunctionTypeInfo::getTrailingReturnType(), clang::Declarator::getTypeObject(), clang::DeclSpec::getTypeSpecType(), clang::DeclaratorChunk::FunctionTypeInfo::hasTrailingReturnType(), clang::isComputedNoexcept(), clang::QualType::isNull(), clang::DeclaratorChunk::Kind, clang::DeclaratorChunk::Mem, clang::DeclaratorChunk::MemberPointer, clang::DeclaratorChunk::FunctionTypeInfo::NoexceptExpr, clang::DeclaratorChunk::ArrayTypeInfo::NumElts, clang::DeclaratorChunk::FunctionTypeInfo::NumParams, clang::DeclaratorChunk::ParamInfo::Param, clang::DeclaratorChunk::FunctionTypeInfo::Params, clang::DeclaratorChunk::Paren, clang::DeclaratorChunk::Pipe, clang::DeclaratorChunk::Pointer, clang::DeclaratorChunk::Reference, clang::DeclaratorChunk::MemberPointerTypeInfo::Scope(), clang::T, clang::TST_Accum, clang::TST_atomic, clang::TST_auto, clang::TST_auto_type, clang::TST_BFloat16, clang::TST_bitint, clang::TST_bool, clang::TST_char, clang::TST_char16, clang::TST_char32, clang::TST_char8, clang::TST_class, clang::TST_decimal128, clang::TST_decimal32, clang::TST_decimal64, clang::TST_decltype, clang::TST_decltype_auto, clang::TST_double, clang::TST_enum, clang::TST_error, clang::TST_float, clang::TST_float128, clang::TST_Float16, clang::TST_Fract, clang::TST_half, clang::TST_ibm128, clang::TST_int, clang::TST_int128, clang::TST_interface, clang::TST_struct, clang::TST_typename, clang::TST_typename_pack_indexing, clang::TST_typeof_unqualExpr, clang::TST_typeof_unqualType, clang::TST_typeofExpr, clang::TST_typeofType, clang::TST_union, clang::TST_unknown_anytype, clang::TST_unspecified, clang::TST_void, clang::TST_wchar, and clang::DeclaratorChunk::TypeAndRange::Ty.

◆ ConvertArgumentsForCall()

bool Sema::ConvertArgumentsForCall ( CallExpr * Call,
Expr * Fn,
FunctionDecl * FDecl,
const FunctionProtoType * Proto,
ArrayRef< Expr * > Args,
SourceLocation RParenLoc,
bool ExecConfig = false )

ConvertArgumentsForCall - Converts the arguments specified in Args/NumArgs to the parameter types of the function FDecl with function prototype Proto.

Call is the call expression itself, and Fn is the function expression. For a C++ member function, this routine does not attempt to convert the object argument. Returns true if the call is ill-formed.

Definition at line 5957 of file SemaExpr.cpp.

References clang::Call, Context, clang::SemaBase::Diag(), diagnoseTypo(), GatherArgumentsForCall(), clang::FunctionDecl::getBuiltinID(), clang::TypoCorrection::getCorrectionRange(), clang::NamedDecl::getDeclName(), clang::Decl::getLocation(), clang::FunctionDecl::getMinRequiredArguments(), clang::FunctionProtoType::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::FunctionDecl::getParametersSourceRange(), getVariadicCallType(), clang::FunctionDecl::hasCXXExplicitFunctionObjectParameter(), clang::Invalid, isParenthetizedAndQualifiedAddressOfExpr(), clang::FunctionProtoType::isVariadic(), clang::SemaBase::PDiag(), and TryTypoCorrectionForCall().

Referenced by BuildCallToMemberFunction(), and BuildResolvedCallExpr().

◆ ConvertDeclToDeclGroup()

◆ ConvertMemberDefaultInitExpression()

◆ ConvertParamDefaultArgument()

◆ ConvertVectorExpr()

◆ CorrectTypo()

TypoCorrection Sema::CorrectTypo ( const DeclarationNameInfo & Typo,
Sema::LookupNameKind LookupKind,
Scope * S,
CXXScopeSpec * SS,
CorrectionCandidateCallback & CCC,
CorrectTypoKind Mode,
DeclContext * MemberContext = nullptr,
bool EnteringContext = false,
const ObjCObjectPointerType * OPT = nullptr,
bool RecordFailure = true )

Try to "correct" a typo in the source code by finding visible declarations whose names are similar to the name that was present in the source code.

Parameters
TypoNamethe DeclarationNameInfo structure that contains the name that was present in the source code along with its location.
LookupKindthe name-lookup criteria used to search for the name.
Sthe scope in which name lookup occurs.
SSthe nested-name-specifier that precedes the name we're looking for, if present.
CCCA CorrectionCandidateCallback object that provides further validation of typo correction candidates. It also provides flags for determining the set of keywords permitted.
MemberContextif non-NULL, the context in which to look for a member access expression.
EnteringContextwhether we're entering the context described by the nested-name-specifier SS.
OPTwhen non-NULL, the search for visible declarations will also walk the protocols in the qualified interfaces of OPT.
Returns
a TypoCorrection containing the corrected name if the typo along with information such as the NamedDecl where the corrected name was declared, and any additional NestedNameSpecifier needed to access it (C++ only). The TypoCorrection is empty if there is no correction.

Definition at line 5411 of file SemaLookup.cpp.

References checkCorrectionVisibility(), Consumer, clang::ErrorRecovery, ExternalSource, clang::DeclarationName::getAsIdentifierInfo(), clang::DeclarationName::getAsString(), clang::TypoCorrection::getCorrection(), clang::TypoCorrection::getEditDistance(), clang::DeclarationNameInfo::getLoc(), clang::DeclarationNameInfo::getName(), clang::IdentifierInfo::getName(), clang::Result, clang::TypoCorrection::setCorrectionRange(), clang::CorrectionCandidateCallback::WantObjCSuper, and clang::CorrectionCandidateCallback::WantRemainingKeywords.

Referenced by ActOnSizeofParameterPackExpr(), BuildCXXNestedNameSpecifier(), BuildMemInitializer(), BuildUsingDeclaration(), ClassifyName(), DiagnoseEmptyLookup(), diagnoseExprIntendedAsTemplateName(), DiagnoseInvalidRedeclaration(), DiagnoseUnknownTypeName(), getTypeName(), ImplicitlyDefineFunction(), LookupMemberExpr(), LookupTemplateName(), resolveAssumedTemplateNameAsType(), TryNamespaceTypoCorrection(), and TryTypoCorrectionForCall().

◆ CreateAnnotationAttr() [1/2]

Attr * Sema::CreateAnnotationAttr ( const AttributeCommonInfo & CI,
StringRef Annot,
MutableArrayRef< Expr * > Args )

CreateAnnotationAttr - Creates an annotation Annot with Args arguments.

Definition at line 2940 of file Sema.cpp.

References ConstantFoldAttrArgs(), and Context.

Referenced by CreateAnnotationAttr(), handleAnnotateAttr(), instantiateDependentAnnotationAttr(), and ProcessStmtAttribute().

◆ CreateAnnotationAttr() [2/2]

◆ CreateBuiltin()

◆ CreateBuiltinArraySubscriptExpr()

ExprResult Sema::CreateBuiltinArraySubscriptExpr ( Expr * Base,
SourceLocation LLoc,
Expr * Idx,
SourceLocation RLoc )

Definition at line 5264 of file SemaExpr.cpp.

References clang::SemaObjC::BuildObjCSubscriptExpression(), captureVariablyModifiedType(), clang::Type::castAs(), clang::DeclContext::containsDecl(), Context, clang::CPlusPlus, clang::CPlusPlus11, DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), clang::ExprError(), FunctionScopes, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), getASTContext(), clang::Stmt::getBeginLoc(), getDependentArraySubscriptType(), clang::VectorType::getElementType(), clang::Expr::getIntegerConstantExpr(), getLangOpts(), clang::Type::getPointeeType(), getPointeeType(), clang::QualType::getQualifiers(), clang::Stmt::getSourceRange(), clang::Type::getSveEltType(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::QualType::hasQualifiers(), clang::Expr::IgnoreParenImpCasts(), ImpCastExprToType(), clang::Type::isArrayType(), clang::Type::isBuiltinType(), clang::QualType::isCForbiddenLValueType(), clang::Type::isDependentType(), clang::Type::isFunctionType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isPRValue(), clang::Type::isSpecificBuiltinType(), clang::Type::isSubscriptableVectorType(), clang::BuiltinType::isSVEBool(), clang::Type::isSveVLSBuiltinType(), clang::Expr::isTypeDependent(), clang::Type::isVariablyModifiedType(), clang::Type::isVoidType(), clang::QualType::isWebAssemblyReferenceType(), LangOpts, ObjC(), clang::OK_Ordinary, clang::OK_VectorComponent, RequireCompleteSizedType(), clang::Result, TemporaryMaterializationConversion(), clang::VK_LValue, clang::VK_PRValue, and clang::VK_XValue.

Referenced by ActOnArraySubscriptExpr(), actOnOMPReductionKindClause(), checkArrayLikeDecomposition(), CreateOverloadedArraySubscriptExpr(), and clang::InitializationSequence::Perform().

◆ CreateBuiltinBinOp()

ExprResult Sema::CreateBuiltinBinOp ( SourceLocation OpLoc,
BinaryOperatorKind Opc,
Expr * LHSExpr,
Expr * RHSExpr,
bool ForFoldExpression = false )

CreateBuiltinBinOp - Creates a new built-in binary operation with operator Opc at location TokLoc.

This routine only supports built-in operations; ActOnBinOp handles overloaded operators.

Definition at line 15238 of file SemaExpr.cpp.

References clang::Assignment, CheckAdditionOperands(), CheckAssignmentOperands(), CheckBitwiseOperands(), CheckCommaOperands(), CheckCompareOperands(), CheckLogicalOperands(), CheckMultiplyDivideOperands(), checkNonTrivialCUnion(), checkObjCPointerIntrospection(), CheckPointerToMemberOperands(), CheckRemainderOperands(), CheckShiftOperands(), CheckSubtractionOperands(), checkTypeSupport(), Context, convertHalfVecBinOp(), clang::CPlusPlus, clang::CPlusPlus11, clang::BinaryOperator::Create(), clang::CompoundAssignOperator::Create(), clang::InitializationKind::CreateDirectList(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateReplacement(), CurFPFeatureOverrides(), clang::SemaBase::Diag(), DiagnoseDirectIsaAccess(), DiagnoseSelfAssignment(), DiagnoseSelfMove(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAsCXXRecordDecl(), clang::Stmt::getBeginLoc(), getCurScope(), clang::Stmt::getEndLoc(), clang::Expr::getExprLoc(), getLangOpts(), getLocForEndOfToken(), clang::Expr::getObjectKind(), clang::BinaryOperator::getOpcodeStr(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::QualType::hasNonTrivialToPrimitiveCopyCUnion(), clang::Expr::IgnoreParenCasts(), clang::Expr::IgnoreParens(), clang::Init, InitializationSequence, clang::InitializedEntity::InitializeTemporary(), InvalidOperands(), clang::isa(), clang::Type::isAtomicType(), clang::Type::isBlockPointerType(), clang::Type::isFixedPointType(), clang::Type::isImageType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Type::isPipeType(), clang::Type::isSamplerT(), clang::ActionResult< PtrTy, Compress >::isUsable(), isVector(), LookupOrdinaryName, LookupSingleName(), needsConversionOfHalfVec(), NTCUK_Copy, clang::OK_ObjCProperty, clang::OK_Ordinary, OpenCL(), clang::InitializationSequence::Perform(), RecordModifiableNonNullParam(), TUScope, UsualUnaryConversions(), clang::VK_LValue, and clang::VK_PRValue.

Referenced by actOnOMPReductionKindClause(), BuildBinOp(), buildCounterUpdate(), buildPostUpdate(), buildSingleCopyAssignRecursively(), and CreateOverloadedBinOp().

◆ CreateBuiltinMatrixSingleSubscriptExpr()

◆ CreateBuiltinMatrixSubscriptExpr()

◆ CreateBuiltinUnaryOp()

ExprResult Sema::CreateBuiltinUnaryOp ( SourceLocation OpLoc,
UnaryOperatorKind Opc,
Expr * InputExpr,
bool IsAfterAmp = false )

Definition at line 15934 of file SemaExpr.cpp.

References clang::AltiVecBool, clang::Type::castAs(), CheckAddressOfOperand(), CheckIncrementDecrementOperand(), CheckIndirectionOperand(), CheckRealImagOperand(), Context, convertVector(), clang::CPlusPlus, clang::UnaryOperator::Create(), CurFPFeatureOverrides(), DefaultFunctionArrayLvalueConversion(), DefaultLvalueConversion(), clang::SemaBase::Diag(), clang::ExprError(), ExprEvalContexts, clang::Generic, clang::ActionResult< PtrTy, Compress >::get(), clang::VectorType::getElementType(), getLangOpts(), clang::VectorType::getNumElements(), clang::Expr::getObjectKind(), clang::Type::getPointeeType(), GetSignedVectorType(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::VectorType::getVectorKind(), clang::Type::hasBooleanRepresentation(), clang::Type::hasIntegerRepresentation(), HLSL(), ImpCastExprToType(), clang::isa(), clang::Type::isAnyComplexType(), clang::Type::isArithmeticType(), clang::Type::isAtomicType(), clang::Type::isBlockPointerType(), clang::Type::isComplexIntegerType(), clang::Type::isComplexType(), clang::Type::isDependentType(), clang::Type::isExtVectorType(), clang::Expr::isGLValue(), clang::Type::isHalfType(), clang::Type::isImageType(), clang::Type::isIntegerType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), isOverflowingIntegerType(), clang::Type::isPipeType(), clang::Type::isPointerType(), clang::Type::isSamplerT(), clang::Type::isScalarType(), isScopedEnumerationType(), clang::Type::isSpecificBuiltinType(), clang::Type::isSveVLSBuiltinType(), clang::Expr::isTypeDependent(), isUnevaluatedContext(), clang::SourceLocation::isValid(), clang::Type::isVectorType(), clang::QualType::isWebAssemblyReferenceType(), needsConversionOfHalfVec(), clang::OK_Ordinary, OpenCL(), RecordModifiableNonNullParam(), ScalarTypeToBooleanCastKind(), clang::T, UsualUnaryConversions(), and clang::VK_PRValue.

Referenced by actOnOMPReductionKindClause(), buildCapture(), buildCaptureDecl(), BuildCaptureInit(), buildCoroutinePromise(), BuildExpressionFromDeclTemplateArgument(), BuildUnaryOp(), collectPlacementArgs(), CreateOverloadedBinOp(), CreateOverloadedUnaryOp(), DefineImplicitLambdaToBlockPointerConversion(), and FixOverloadedFunctionReference().

◆ CreateCapturedStmtRecordDecl()

◆ createClusterDimsAttr()

CUDAClusterDimsAttr * Sema::createClusterDimsAttr ( const AttributeCommonInfo & CI,
Expr * X,
Expr * Y,
Expr * Z )

Add a cluster_dims attribute to a particular declaration.

Definition at line 5901 of file SemaDeclAttr.cpp.

References Context, clang::SemaBase::Diag(), clang::AttributeCommonInfo::getLoc(), makeClusterDimsArgExpr(), and X.

Referenced by addClusterDimsAttr().

◆ CreateGenericSelectionExpr()

ExprResult Sema::CreateGenericSelectionExpr ( SourceLocation KeyLoc,
SourceLocation DefaultLoc,
SourceLocation RParenLoc,
bool PredicateIsExpr,
void * ControllingExprOrType,
ArrayRef< TypeSourceInfo * > Types,
ArrayRef< Expr * > Exprs )

◆ createImplicitModuleImportForErrorRecovery()

void Sema::createImplicitModuleImportForErrorRecovery ( SourceLocation Loc,
Module * Mod )

Create an implicit import of the given module at the given source location, for error recovery, if possible.

This routine is typically used when an entity found by name lookup is actually hidden within a module that we know about but the user has forgotten to import.

Definition at line 832 of file SemaModule.cpp.

References clang::DeclContext::addDecl(), clang::Module::AllVisible, Consumer, clang::ImportDecl::CreateImplicit(), getASTContext(), getLangOpts(), getModuleLoader(), clang::ASTContext::getTranslationUnitDecl(), isSFINAEContext(), and clang::ModuleLoader::makeModuleVisible().

Referenced by diagnoseMissingImport().

◆ CreateLambdaCallOperator()

◆ createLambdaClosureType()

CXXRecordDecl * Sema::createLambdaClosureType ( SourceRange IntroducerRange,
TypeSourceInfo * Info,
unsigned LambdaDependencyKind,
LambdaCaptureDefault CaptureDefault )

◆ createLambdaInitCaptureVarDecl()

VarDecl * Sema::createLambdaInitCaptureVarDecl ( SourceLocation Loc,
QualType InitCaptureType,
SourceLocation EllipsisLoc,
IdentifierInfo * Id,
unsigned InitStyle,
Expr * Init,
DeclContext * DeclCtx )

Create a dummy variable within the declcontext of the lambda's call operator, for name lookup purposes for a lambda init capture.

CodeGen handles emission of lambda captures, ignoring these dummy variables appropriately.

Definition at line 871 of file SemaLambda.cpp.

References Context, clang::VarDecl::Create(), clang::TypeLoc::getAs(), getCurLambda(), clang::TypeSourceInfo::getTypeLoc(), clang::Init, clang::ValueDecl::isParameterPack(), clang::sema::CapturingScopeInfo::LocalPacks, clang::Decl::markUsed(), clang::SC_Auto, clang::VarDecl::setInit(), clang::VarDecl::setInitCapture(), clang::VarDecl::setInitStyle(), and clang::Decl::setReferenced().

Referenced by ActOnLambdaExpressionAfterIntroducer().

◆ CreateLaunchBoundsAttr()

CUDALaunchBoundsAttr * Sema::CreateLaunchBoundsAttr ( const AttributeCommonInfo & CI,
Expr * MaxThreads,
Expr * MinBlocks,
Expr * MaxBlocks )

◆ CreateMaterializeTemporaryExpr()

◆ CreateOverloadedArraySubscriptExpr()

ExprResult Sema::CreateOverloadedArraySubscriptExpr ( SourceLocation LLoc,
SourceLocation RLoc,
Expr * Base,
MultiExprArg Args )

Definition at line 15891 of file SemaOverload.cpp.

References AddBuiltinOperatorCandidates(), AddMemberOperatorCandidates(), clang::OverloadCandidateSet::BestViableFunction(), clang::cast(), checkArgPlaceholdersForOverload(), CheckCallReturnType(), CheckForImmediateInvocation(), CheckFunctionCall(), CheckMemberOperatorAccess(), Context, clang::CXXOperatorCallExpr::Create(), CreateBuiltinArraySubscriptExpr(), CreateFunctionRefExpr(), CreateUnresolvedLookupExpr(), clang::OverloadCandidateSet::CSK_Operator, CurFPFeatureOverrides(), clang::OverloadCandidateSet::empty(), clang::ExprError(), clang::ForBuiltinOverloadedOp, clang::ActionResult< PtrTy, Compress >::get(), clang::DeclarationNameInfo::getInfo(), clang::DeclarationNameInfo::getLoc(), clang::QualType::getNonLValueExprType(), clang::FunctionDecl::getReturnType(), clang::StringLiteral::getString(), getType(), clang::Expr::getValueKindForType(), clang::Expr::hasAnyTypeDependentArguments(), InitializeExplicitObjectArgument(), clang::ActionResult< PtrTy, Compress >::isInvalid(), MaybeBindToTemporary(), clang::Method, clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::Passing, clang::SemaBase::PDiag(), PerformImplicitConversion(), PerformImplicitObjectArgumentInitialization(), PrepareArgumentsForCallToObjectOfClassType(), clang::DeclarationNameInfo::setCXXOperatorNameRange(), clang::OverloadCandidateSet::size(), and clang::VK_PRValue.

Referenced by ActOnArraySubscriptExpr().

◆ CreateOverloadedBinOp()

ExprResult Sema::CreateOverloadedBinOp ( SourceLocation OpLoc,
BinaryOperatorKind Opc,
const UnresolvedSetImpl & Fns,
Expr * LHS,
Expr * RHS,
bool RequiresADL = true,
bool AllowRewrittenCandidates = true,
FunctionDecl * DefaultedFn = nullptr )

Create a binary operation that may resolve to an overloaded operator.

Parameters
OpLocThe location of the operator itself (e.g., '+').
OpcThe BinaryOperatorKind that describes this operator.
FnsThe set of non-member functions that will be considered by overload resolution. The caller needs to build this set based on the context using, e.g., LookupOverloadedOperatorName() and ArgumentDependentLookup(). This set should not contain any member functions; those will be added by CreateOverloadedBinOp().
LHSLeft-hand argument.
RHSRight-hand argument.
PerformADLWhether to consider operator candidates found by ADL.
AllowRewrittenCandidatesWhether to consider candidates found by C++20 operator rewrites.
DefaultedFnIf we are synthesizing a defaulted operator function, the function in question. Such a function is never a candidate in our overload resolution. This also enables synthesizing a three-way comparison from < and == as described in C++20 [class.spaceship]p1.

Definition at line 15293 of file SemaOverload.cpp.

References allowAmbiguity(), clang::Sema::DefaultedFunctionKind::asSpecialMember(), clang::OverloadCandidateSet::BestViableFunction(), clang::ImplicitConversionSequence::Better, BuildSynthesizedThreeWayComparison(), clang::cast(), clang::sema::checkAssignmentLifetime(), checkCall(), CheckCallReturnType(), CheckForImmediateInvocation(), CheckMemberOperatorAccess(), CheckPlaceholderExpr(), checkPlaceholderForOverload(), CompareImplicitConversionSequences(), clang::OverloadCandidateSet::CompleteCandidates(), Context, clang::OverloadCandidate::Conversions, clang::CPlusPlus20, clang::BinaryOperator::Create(), clang::CompoundAssignOperator::Create(), clang::CXXOperatorCallExpr::Create(), clang::IntegerLiteral::Create(), CreateBuiltinBinOp(), CreateBuiltinUnaryOp(), CreateFunctionRefExpr(), CreateOverloadedBinOp(), CreateUnresolvedLookupExpr(), clang::CRK_DifferentOperator, clang::CRK_None, clang::OverloadCandidateSet::CSK_Operator, CurFPFeatureOverrides(), clang::declaresSameEntity(), Diag(), diagnoseNullableToNonnullConversion(), DiagnoseSelfMove(), DiagnoseTwoPhaseOperatorLookup(), clang::DoesNotApply, clang::UnresolvedSetImpl::empty(), clang::Sema::CodeSynthesisContext::Entity, clang::OverloadCandidateSet::exclude(), clang::ExprError(), clang::ForBuiltinOverloadedOp, clang::OverloadCandidate::Function, clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::DeclarationName::getCXXOverloadedOperator(), clang::NamedDecl::getDeclName(), getDefaultedFunctionKind(), getLangOpts(), clang::Decl::getLocation(), clang::QualType::getNonLValueExprType(), clang::BinaryOperator::getOpcodeStr(), clang::BinaryOperator::getOpcodeStr(), clang::getOperatorSpelling(), clang::BinaryOperator::getOverloadedOperator(), clang::FunctionDecl::getParamDecl(), clang::FunctionDecl::getReturnType(), clang::OverloadCandidateSet::getRewriteInfo(), clang::Stmt::getSourceRange(), clang::StringLiteral::getString(), clang::Expr::getType(), getType(), clang::Expr::getValueKindForType(), InitializeExplicitObjectArgument(), clang::InitializedEntity::InitializeParameter(), clang::isa(), clang::Type::isBooleanType(), clang::Sema::DefaultedFunctionKind::isComparison(), clang::BinaryOperator::isCompoundAssignmentOp(), isImplicitlyDeleted(), clang::Type::isIntegralOrUnscopedEnumerationType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), isRecordType(), clang::OverloadCandidate::isReversed(), clang::OverloadCandidateSet::OperatorRewriteInfo::isReversible(), clang::Sema::DefaultedFunctionKind::isSpecialMember(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Sema::CodeSynthesisContext::Kind, LookupOverloadedBinOp(), MaybeBindToTemporary(), clang::Method, clang::OverloadCandidateSet::NoteCandidates(), NoteDeletedFunction(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OK_ObjCProperty, clang::OK_Ordinary, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::Passing, clang::SemaBase::PDiag(), PerformCopyInitialization(), PerformImplicitConversion(), PerformImplicitObjectArgumentInitialization(), popCodeSynthesisContext(), pushCodeSynthesisContext(), clang::Result, clang::Sema::CodeSynthesisContext::RewritingOperatorAsSpaceship, clang::OverloadCandidateSet::shouldDeferDiags(), clang::OverloadCandidateSet::size(), clang::OverloadCandidate::Viable, clang::VK_LValue, clang::VK_PRValue, and clang::Zero.

Referenced by BuildOverloadedBinOp(), BuildSynthesizedThreeWayComparison(), CreateOverloadedBinOp(), HasNonDeletedDefaultedEqualityComparison(), and clang::TreeTransform< AdjustConstraints >::RebuildCXXRewrittenBinaryOperator().

◆ CreateOverloadedUnaryOp()

ExprResult Sema::CreateOverloadedUnaryOp ( SourceLocation OpLoc,
UnaryOperatorKind Opc,
const UnresolvedSetImpl & Fns,
Expr * input,
bool RequiresADL = true )

Create a unary operation that may resolve to an overloaded operator.

Parameters
OpLocThe location of the operator itself (e.g., '*').
OpcThe UnaryOperatorKind that describes this operator.
FnsThe set of non-member functions that will be considered by overload resolution. The caller needs to build this set based on the context using, e.g., LookupOverloadedOperatorName() and ArgumentDependentLookup(). This set should not contain any member functions; those will be added by CreateOverloadedUnaryOp().
InputThe input argument.

Definition at line 15028 of file SemaOverload.cpp.

References AddArgumentDependentLookupCandidates(), AddBuiltinOperatorCandidates(), AddMemberOperatorCandidates(), AddNonMemberOperatorCandidates(), clang::OverloadCandidateSet::BestViableFunction(), clang::Type::castAs(), CheckCallReturnType(), CheckForImmediateInvocation(), CheckFunctionCall(), CheckMemberOperatorAccess(), checkPlaceholderForOverload(), Context, clang::CXXOperatorCallExpr::Create(), clang::IntegerLiteral::Create(), clang::UnaryOperator::Create(), CreateBuiltinUnaryOp(), CreateFunctionRefExpr(), CreateUnresolvedLookupExpr(), clang::OverloadCandidateSet::CSK_Operator, CurFPFeatureOverrides(), DiagnoseTwoPhaseOperatorLookup(), clang::UnresolvedSetImpl::empty(), clang::ExprError(), clang::ForBuiltinOverloadedOp, clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getNonLValueExprType(), clang::UnaryOperator::getOpcodeStr(), clang::UnaryOperator::getOverloadedOperator(), clang::FunctionDecl::getParamDecl(), clang::FunctionDecl::getReturnType(), clang::Stmt::getSourceRange(), clang::StringLiteral::getString(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::Expr::getValueKindForType(), InitializeExplicitObjectArgument(), clang::InitializedEntity::InitializeParameter(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isTypeDependent(), MaybeBindToTemporary(), clang::Method, clang::OverloadCandidateSet::NoteCandidates(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OK_Ordinary, clang::OO_None, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::Passing, clang::SemaBase::PDiag(), PerformCopyInitialization(), PerformImplicitConversion(), PerformImplicitObjectArgumentInitialization(), clang::OverloadCandidateSet::size(), clang::VK_LValue, clang::VK_PRValue, and clang::Zero.

Referenced by BuildOperatorCoawaitCall(), and BuildUnaryOp().

◆ CreateParsedType()

◆ CreateRecoveryExpr()

◆ createSubstDiagAt()

concepts::Requirement::SubstitutionDiagnostic * Sema::createSubstDiagAt ( SourceLocation Location,
EntityPrinter Printer )

create a Requirement::SubstitutionDiagnostic with only a SubstitutedEntity and DiagLoc using ASTContext's allocator.

Definition at line 2545 of file SemaTemplateInstantiate.cpp.

References clang::C, Context, and OS.

Referenced by BuildExprRequirement().

◆ CreateUnaryExprOrTypeTraitExpr() [1/2]

◆ CreateUnaryExprOrTypeTraitExpr() [2/2]

◆ CreateUnresolvedLookupExpr()

◆ CUDA()

◆ CurFPFeatureOverrides()

◆ currentEvaluationContext() [1/2]

ExpressionEvaluationContextRecord & clang::Sema::currentEvaluationContext ( )
inline

Definition at line 6956 of file Sema.h.

References ExprEvalContexts.

◆ currentEvaluationContext() [2/2]

◆ currentModuleIsHeaderUnit()

bool clang::Sema::currentModuleIsHeaderUnit ( ) const
inline

Is the module scope we are in a C++ Header Unit?

Definition at line 3595 of file Sema.h.

References false.

Referenced by ActOnStartOfFunctionDef(), and AddInitializerToDecl().

◆ currentModuleIsImplementation()

bool clang::Sema::currentModuleIsImplementation ( ) const
inline

Is the module scope we are an implementation unit?

Definition at line 9884 of file Sema.h.

References false.

Referenced by ActOnModuleImport(), ActOnModuleImport(), and ActOnStartExportDecl().

◆ CXXCheckConditionalOperands()

QualType Sema::CXXCheckConditionalOperands ( ExprResult & cond,
ExprResult & lhs,
ExprResult & rhs,
ExprValueKind & VK,
ExprObjectKind & OK,
SourceLocation questionLoc )

Check the operands of ?

: under C++ semantics.

See C++ [expr.cond]. Note that LHS is never null, even for the GNU x ?: y extension. In this case, LHS == Cond. (But they're not aliases.)

This function also implements GCC's vector extension and the OpenCL/ext_vector_type extension for conditionals. The vector extensions permit the use of a?b:c where the type of a is that of a integer vector with the same number of elements and size as the vectors of b and c. If one of either b or c is a scalar it is implicitly converted to match the type of the vector. Otherwise the expression is ill-formed. If both b and c are scalars, then b and c are checked and converted to the type of a if possible.

The expressions are evaluated differently for GCC's and OpenCL's extensions. For the GCC extension, the ?: operator is evaluated as (a[0] != 0 ? b[0] : c[0], .. , a[n] != 0 ? b[n] : c[n]). For the OpenCL extensions, the ?: operator is evaluated as (most-significant-bit-set(a[0]) ? b[0] : c[0], .. , most-significant-bit-set(a[n]) ? b[n] : c[n]).

Definition at line 5830 of file SemaExprCXX.cpp.

References CheckCXXBooleanCondition(), CheckVectorConditionalTypes(), CheckVectorOperands(), CompareReferenceRelationship(), clang::Cond, clang::Conditional, Context, ConvertForConditional(), DefaultFunctionArrayLvalueConversion(), clang::SemaBase::Diag(), DiagnoseConditionalForNull(), clang::SemaObjC::FindCompositeObjCPointerType(), FindCompositePointerType(), FindConditionalOverload(), clang::ActionResult< PtrTy, Compress >::get(), clang::SourceRange::getBegin(), clang::Expr::getObjectKind(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::Expr::IgnoreParenImpCasts(), ImpCastExprToType(), clang::InitializedEntity::InitializeTemporary(), clang::isa(), clang::Type::isArithmeticType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Expr::isOrdinaryOrBitFieldObject(), clang::Type::isRecordType(), clang::Expr::isTypeDependent(), isValidVectorForConditionalCondition(), clang::Type::isVectorType(), clang::Type::isVoidType(), clang::Type::isWebAssemblyTableType(), ObjC(), clang::OK_BitField, clang::OK_Ordinary, PerformCopyInitialization(), PrepareScalarCast(), Ref_Compatible, clang::Expr::refersToBitField(), clang::Expr::refersToVectorElement(), TryClassUnification(), UsualArithmeticConversions(), and clang::VK_PRValue.

Referenced by CheckConditionalOperands().

◆ DeclApplyPragmaWeak()

void Sema::DeclApplyPragmaWeak ( Scope * S,
NamedDecl * ND,
const WeakInfo & W )

◆ DeclareAggregateDeductionGuideFromInitList()

◆ DeclareGlobalAllocationFunction()

◆ DeclareGlobalNewDelete()

void Sema::DeclareGlobalNewDelete ( )

DeclareGlobalNewDelete - Declare the global forms of operator new and delete.

These are:

// C++03:
void* operator new(std::size_t) throw(std::bad_alloc);
void* operator new[](std::size_t) throw(std::bad_alloc);
void operator delete(void *) throw();
void operator delete[](void *) throw();
// C++11:
void* operator new(std::size_t);
void* operator new[](std::size_t);
void operator delete(void *) noexcept;
void operator delete[](void *) noexcept;
// C++1y:
void* operator new(std::size_t);
void* operator new[](std::size_t);
void operator delete(void *) noexcept;
void operator delete[](void *) noexcept;
void operator delete(void *, std::size_t) noexcept;
void operator delete[](void *, std::size_t) noexcept;

Note that the placement and nothrow forms of new are not implicitly declared. Their use requires including <new>.

Definition at line 3348 of file SemaExprCXX.cpp.

References clang::Class, Context, clang::CPlusPlus11, clang::CXXRecordDecl::Create(), clang::EnumDecl::Create(), DeclareGlobalAllocationFunction(), getCurrentModule(), getLangOpts(), getOrCreateStdNamespace(), getStdAlignValT(), getStdBadAlloc(), GlobalNewDeleteDeclared, PP, clang::Decl::ReachableWhenImported, clang::Decl::setImplicit(), clang::Decl::setLocalOwningModule(), clang::Decl::setModuleOwnershipKind(), SizeT, StdAlignValT, and StdBadAlloc.

Referenced by FindAllocationFunctions(), and FindUsualDeallocationFunction().

◆ DeclareImplicitCopyAssignment()

◆ DeclareImplicitCopyConstructor()

CXXConstructorDecl * Sema::DeclareImplicitCopyConstructor ( CXXRecordDecl * ClassDecl)

◆ DeclareImplicitDeductionGuides()

◆ DeclareImplicitDefaultConstructor()

◆ DeclareImplicitDestructor()

◆ DeclareImplicitEqualityComparison()

◆ DeclareImplicitMoveAssignment()

◆ DeclareImplicitMoveConstructor()

◆ DeclClonePragmaWeak()

◆ DecomposeUnqualifiedId()

void Sema::DecomposeUnqualifiedId ( const UnqualifiedId & Id,
TemplateArgumentListInfo & Buffer,
DeclarationNameInfo & NameInfo,
const TemplateArgumentListInfo *& TemplateArgs )

Decomposes the given name into a DeclarationNameInfo, its location, and possibly a list of template arguments.

If this produces template arguments, it is permitted to call DecomposeTemplateName.

This actually loses a lot of source location information for non-standard name kinds; we should consider preserving that in some way.

Definition at line 2435 of file SemaExpr.cpp.

References Context, clang::OpaquePtr< PtrTy >::get(), clang::UnqualifiedId::getKind(), GetNameFromUnqualifiedId(), clang::TemplateIdAnnotation::getTemplateArgs(), clang::IK_TemplateId, clang::TemplateIdAnnotation::LAngleLoc, clang::TemplateIdAnnotation::NumArgs, clang::TemplateIdAnnotation::RAngleLoc, clang::TemplateArgumentListInfo::setLAngleLoc(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::TemplateIdAnnotation::Template, clang::UnqualifiedId::TemplateId, clang::TemplateIdAnnotation::TemplateNameLoc, and translateTemplateArguments().

Referenced by ActOnIdExpression(), and ActOnMemberAccessExpr().

◆ DeduceAutoType()

TemplateDeductionResult Sema::DeduceAutoType ( TypeLoc AutoTypeLoc,
Expr * Initializer,
QualType & Result,
sema::TemplateDeductionInfo & Info,
bool DependentDeduction = false,
bool IgnoreConstraints = false,
TemplateSpecCandidateSet * FailedTSC = nullptr )

Deduce the type for an auto type-specifier (C++11 [dcl.spec.auto]p6)

Note that this is done even if the initializer is dependent. (This is necessary to support partial ordering of templates using 'auto'.) A dependent type will be produced when deducing from a dependent type.

Parameters
Typethe type pattern using the auto type-specifier.
Initthe initializer for the variable whose type is to be deduced.
Resultif type deduction was successful, this will be set to the deduced type.
Infothe argument will be updated to provide additional information about template argument deduction.
DependentDeductionSet if we should permit deduction in dependent cases. This is necessary for template partial ordering with 'auto' template parameters. The template parameter depth to be used should be specified in the 'Info' parameter.
IgnoreConstraintsSet if we should not fail if the deduced type does not satisfy the type-constraint in the auto type.

Definition at line 5202 of file SemaTemplateDeduction.cpp.

References clang::AlreadyDiagnosed, BuildStdInitializerList(), clang::C23, CheckDeducedPlaceholderConstraints(), CheckOriginalCallArgDeduction(), CheckPlaceholderExpr(), Context, clang::CPlusPlus, clang::TemplateTypeParmDecl::Create(), DeduceTemplateArgumentsFromCallArgument(), clang::SemaBase::Diag(), clang::sema::TemplateDeductionInfo::FirstArg, clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), getASTContext(), clang::Type::getContainedAutoType(), getDecltypeForExpr(), clang::sema::TemplateDeductionInfo::getDeducedDepth(), getKind(), getLangOpts(), clang::sema::TemplateDeductionInfo::getLocation(), clang::TypeDecl::getTypeForDecl(), clang::Incomplete, clang::Inconsistent, clang::Init, clang::Invalid, clang::isa(), clang::Type::isArrayType(), clang::Type::isDependentType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::SourceRange::isInvalid(), clang::QualType::isNull(), clang::Type::isPointerType(), clang::TemplateArgument::Null, clang::Result, clang::sema::TemplateDeductionInfo::SecondArg, clang::Success, and clang::TemplateArgument::Type.

Referenced by BuildCXXNew(), BuildCXXTypeConstructExpr(), CheckTemplateArgument(), DeduceFunctionTypeFromReturnExpr(), deduceVarTypeFromInitializer(), and FinishForRangeVarDecl().

◆ deduceClosureReturnType()

◆ DeduceFunctionTypeFromReturnExpr()

◆ deduceHLSLAddressSpace()

void clang::Sema::deduceHLSLAddressSpace ( VarDecl * decl)

◆ deduceOpenCLAddressSpace()

◆ DeduceReturnType()

◆ DeduceTemplateArguments() [1/7]

◆ DeduceTemplateArguments() [2/7]

◆ DeduceTemplateArguments() [3/7]

TemplateDeductionResult Sema::DeduceTemplateArguments ( FunctionTemplateDecl * FunctionTemplate,
TemplateArgumentListInfo * ExplicitTemplateArgs,
ArrayRef< Expr * > Args,
FunctionDecl *& Specialization,
sema::TemplateDeductionInfo & Info,
bool PartialOverloading,
bool AggregateDeductionCandidate,
bool PartialOrdering,
QualType ObjectType,
Expr::Classification ObjectClassification,
bool ForOverloadSetAddressResolution,
llvm::function_ref< bool(ArrayRef< QualType >, bool)> CheckNonDependent )

Perform template argument deduction from a function call (C++ [temp.deduct.call]).

Parameters
FunctionTemplatethe function template for which we are performing template argument deduction.
ExplicitTemplateArgsthe explicit template arguments provided for this call.
Argsthe function call arguments
Specializationif template argument deduction was successful, this will be set to the function template specialization produced by template argument deduction.
Infothe argument will be updated to provide additional information about template argument deduction.
CheckNonDependentA callback to invoke to check conversions for non-dependent parameters, between deduction and substitution, per DR1391. If this returns true, substitution will be skipped and we return TemplateDeductionResult::NonDependentConversionFailure. The callback is passed the parameter types (after substituting explicit template arguments).
Returns
the result of template argument deduction.

Definition at line 4486 of file SemaTemplateDeduction.cpp.

References CurContext, DeduceTemplateArgumentsFromCallArgument(), clang::Function, FunctionTemplate, getASTContext(), getFirstInnerIndex(), clang::sema::TemplateDeductionInfo::getLocation(), getType(), hasDeducibleTemplateParameters(), clang::Sema::SFINAETrap::hasErrorOccurred(), clang::Invalid, clang::InvalidExplicitArguments, clang::QualType::isNull(), clang::PartialOrdering, clang::Result, runWithSufficientStackSpace(), clang::TemplateParameterList::size(), clang::Specialization, clang::SubstitutionFailure, clang::Success, clang::TooFewArguments, clang::TooManyArguments, and Unevaluated.

◆ DeduceTemplateArguments() [4/7]

TemplateDeductionResult Sema::DeduceTemplateArguments ( FunctionTemplateDecl * FunctionTemplate,
TemplateArgumentListInfo * ExplicitTemplateArgs,
FunctionDecl *& Specialization,
sema::TemplateDeductionInfo & Info,
bool IsAddressOfFunction = false )

Deduce template arguments for a function template when there is nothing to deduce against (C++0x [temp.arg.explicit]p3).

Parameters
FunctionTemplatethe function template for which we are performing template argument deduction.
ExplicitTemplateArgsthe explicitly-specified template arguments.
Specializationif template argument deduction was successful, this will be set to the function template specialization produced by template argument deduction.
Infothe argument will be updated to provide additional information about template argument deduction.
IsAddressOfFunctionIf true, we are deducing as part of taking the address of a function template in a context where we do not have a target type, per [over.over]. If false, we are looking up a function template specialization based on its signature, which only happens when deducing a function parameter type from an argument that is a template-id naming a function template specialization.
Returns
the result of template argument deduction.

Definition at line 5038 of file SemaTemplateDeduction.cpp.

References DeduceTemplateArguments(), FunctionTemplate, and clang::Specialization.

◆ DeduceTemplateArguments() [5/7]

TemplateDeductionResult Sema::DeduceTemplateArguments ( FunctionTemplateDecl * FunctionTemplate,
TemplateArgumentListInfo * ExplicitTemplateArgs,
QualType ArgFunctionType,
FunctionDecl *& Specialization,
sema::TemplateDeductionInfo & Info,
bool IsAddressOfFunction = false )

Deduce template arguments when taking the address of a function template (C++ [temp.deduct.funcaddr]) or matching a specialization to a template.

Parameters
FunctionTemplatethe function template for which we are performing template argument deduction.
ExplicitTemplateArgsthe explicitly-specified template arguments.
ArgFunctionTypethe function type that will be used as the "argument" type (A) when performing template argument deduction from the function template's function type. This type may be NULL, if there is no argument type to compare against, in C++0x [temp.arg.explicit]p3.
Specializationif template argument deduction was successful, this will be set to the function template specialization produced by template argument deduction.
Infothe argument will be updated to provide additional information about template argument deduction.
IsAddressOfFunctionIf true, we are deducing as part of taking the address of a function template per [temp.deduct.funcaddr] and [over.over]. If false, we are looking up a function template specialization based on its signature, per [temp.deduct.decl].
Returns
the result of template argument deduction.

Definition at line 4773 of file SemaTemplateDeduction.cpp.

References adjustCCAndNoReturn(), CheckIfFunctionSpecializationIsImmediate(), Context, clang::CPlusPlus14, clang::CPlusPlus20, currentEvaluationContext(), DeduceReturnType(), DeduceTemplateArgumentsByTypeMatch(), clang::sema::TemplateDeductionInfo::FirstArg, clang::Function, FunctionTemplate, getLangOpts(), clang::sema::TemplateDeductionInfo::getLocation(), clang::Sema::SFINAETrap::hasErrorOccurred(), clang::Invalid, clang::QualType::isNull(), clang::Sema::ExpressionEvaluationContextRecord::isPotentiallyEvaluated(), isSameOrCompatibleFunctionType(), clang::MiscellaneousDeductionFailure, clang::NonDeducedMismatch, None, PotentiallyEvaluated, clang::Result, runWithSufficientStackSpace(), clang::sema::TemplateDeductionInfo::SecondArg, clang::TemplateParameterList::size(), clang::Specialization, SubstAutoType(), SubstAutoTypeDependent(), clang::SubstitutionFailure, clang::Success, clang::TDF_AllowCompatibleFunctionType, clang::TDF_TopLevelParameterTypeList, and Unevaluated.

◆ DeduceTemplateArguments() [6/7]

TemplateDeductionResult Sema::DeduceTemplateArguments ( TemplateParameterList * TemplateParams,
ArrayRef< TemplateArgument > Ps,
ArrayRef< TemplateArgument > As,
sema::TemplateDeductionInfo & Info,
SmallVectorImpl< DeducedTemplateArgument > & Deduced,
bool NumberOfArgumentsMustMatch )

Definition at line 2857 of file SemaTemplateDeduction.cpp.

References ParameterToArgument.

◆ DeduceTemplateArguments() [7/7]

TemplateDeductionResult Sema::DeduceTemplateArguments ( VarTemplatePartialSpecializationDecl * Partial,
ArrayRef< TemplateArgument > TemplateArgs,
sema::TemplateDeductionInfo & Info )

Definition at line 3466 of file SemaTemplateDeduction.cpp.

◆ DeduceTemplateArgumentsFromType()

TemplateDeductionResult Sema::DeduceTemplateArgumentsFromType ( TemplateDecl * TD,
QualType FromType,
sema::TemplateDeductionInfo & Info )

◆ DeduceTemplateSpecializationFromInitializer()

QualType Sema::DeduceTemplateSpecializationFromInitializer ( TypeSourceInfo * TInfo,
const InitializedEntity & Entity,
const InitializationKind & Kind,
MultiExprArg Init )

Definition at line 10065 of file SemaInit.cpp.

References AddOverloadCandidate(), AddTemplateOverloadCandidate(), clang::Aggregate, AliasTemplate, clang::AS_public, clang::LookupResult::begin(), clang::OverloadCandidateSet::BestViableFunction(), clang::cast(), clang::OverloadCandidateSet::clear(), clang::Complete, Context, clang::CPlusPlus20, clang::OverloadCandidateSet::CSK_Normal, DeclareAggregateDeductionGuideFromInitList(), clang::SemaBase::Diag(), clang::SemaBase::DiagCompat(), DiagnoseUseOfDecl(), clang::LookupResult::empty(), clang::LookupResult::end(), clang::Type::getAsCXXRecordDecl(), getASTContext(), clang::TemplateName::getAsTemplateDecl(), clang::TypeLoc::getBeginLoc(), clang::Type::getContainedDeducedType(), clang::Decl::getDeclContext(), clang::RecordDecl::getDefinition(), clang::TypeLoc::getEndLoc(), getLangOpts(), clang::OverloadCandidateSet::getPersistentArgsArray(), clang::TypeLoc::getSourceRange(), clang::FunctionTemplateDecl::getTemplatedDecl(), getTemplateNameKindForDiagnostics(), clang::Expr::getType(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::Expr::hasAnyTypeDependentArguments(), clang::InitializationKind::IK_Direct, clang::Inits, clang::isa(), isCompleteType(), clang::TemplateName::isDependent(), isInitListConstructor(), clang::Decl::isInvalidDecl(), isOrIsDerivedFromSpecializationOf(), clang::ListInit, LookupOrdinaryName, LookupQualifiedName(), clang::DeclAccessPair::make(), MarkFunctionReferenced(), clang::OverloadCandidateSet::NoteCandidates(), NoteDeletedFunction(), NoteTemplateLocation(), clang::OCD_AllCandidates, clang::OCD_AmbiguousCandidates, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::SemaBase::PDiag(), clang::Result, SubstAutoTypeSourceInfo(), SubstAutoTypeSourceInfoDependent(), clang::LookupResult::suppressDiagnostics(), and clang::Template.

Referenced by BuildCXXNew(), BuildCXXTypeConstructExpr(), CheckTemplateArgument(), and deduceVarTypeFromInitializer().

◆ DeduceVariableDeclarationType()

◆ deduceVarTypeFromInitializer()

◆ DefaultArgumentPromotion()

◆ DefaultFunctionArrayConversion()

◆ DefaultFunctionArrayLvalueConversion()

◆ DefaultLvalueConversion()

ExprResult Sema::DefaultLvalueConversion ( Expr * E)

Definition at line 640 of file SemaExpr.cpp.

References clang::Atomic, BoundsSafetyCheckUseOfCountAttrPtr(), CheckForNullPointerDereference(), CheckLValueToRValueConversionOperand(), CheckPlaceholderExpr(), Cleanup, Context, clang::CPlusPlus, clang::ImplicitCastExpr::Create(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateReplacement(), CurFPFeatureOverrides(), clang::SemaBase::Diag(), DiagnoseDirectIsaAccess(), clang::QualType::DK_nontrivial_c_struct, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getExprLoc(), getLangOpts(), clang::QualType::getObjCLifetime(), getOpenCLOptions(), clang::Expr::getType(), clang::Expr::hasPlaceholderType(), clang::Expr::IgnoreParenCasts(), isCompleteType(), clang::QualType::isDestructedType(), clang::Expr::isGLValue(), clang::ActionResult< PtrTy, Compress >::isInvalid(), LookupOrdinaryName, LookupSingleName(), clang::Qualifiers::OCL_Weak, OpenCL(), clang::T, TUScope, and clang::VK_PRValue.

Referenced by ActOnCaseExpr(), ActOnCXXDelete(), actOnOMPReductionKindClause(), BuildArrayType(), BuildBuiltinOffsetOf(), buildCapture(), BuildVectorLiteral(), BuiltinBswapg(), BuiltinCountZeroBitsGeneric(), BuiltinDumpStruct(), BuiltinPopcountg(), BuiltinTriviallyRelocate(), CallExprUnaryConversions(), CheckCompareOperands(), CheckEnumConstant(), CheckObjCCollectionLiteralElement(), checkOpenMPIterationSpace(), CheckPointerToMemberOperands(), CheckRealImagOperand(), CheckTemplateArgument(), CreateBuiltinUnaryOp(), createTransparentClause(), DefaultFunctionArrayLvalueConversion(), finishContextualImplicitConversion(), FinishOpenMPLinearClause(), IgnoredValueConversions(), LookupMemberExpr(), PerformContextualImplicitConversion(), PerformImplicitConversion(), processImplicitMapsWithDefaultMappers(), and VerifyIntegerConstantExpression().

◆ DefaultVariadicArgumentPromotion()

◆ DefineDefaultedComparison()

◆ DefineImplicitCopyAssignment()

void Sema::DefineImplicitCopyAssignment ( SourceLocation CurrentLocation,
CXXMethodDecl * MethodDecl )

Defines an implicitly-declared copy assignment operator.

Definition at line 15221 of file SemaDeclCXX.cpp.

References ActOnCompoundStmt(), clang::LookupResult::addDecl(), clang::CXXRecordDecl::bases(), BuildReturnStmt(), buildSingleCopyAssign(), clang::Type::castAs(), Context, clang::Copy, clang::CPlusPlus11, Diag(), diagnoseDeprecatedCopyOperation(), clang::FunctionDecl::doesThisDeclarationHaveABody(), clang::RecordDecl::fields(), clang::ActionResult< PtrTy, Compress >::getAs(), getASTMutationListener(), getCurrentThisType(), clang::Decl::getEndLoc(), getLangOpts(), clang::Decl::getLocation(), clang::FunctionDecl::getNonObjectParameter(), clang::FunctionDecl::getOverloadedOperator(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::Type::getPointeeType(), clang::QualType::getQualifiers(), clang::ValueDecl::getType(), clang::RecordDecl::hasFlexibleArrayMember(), clang::Invalid, clang::FunctionDecl::isDefaulted(), clang::FunctionDecl::isDeleted(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::Decl::isImplicit(), clang::Type::isIncompleteArrayType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::Type::isLValueReferenceType(), clang::FunctionDecl::isOverloadedOperator(), clang::Type::isReferenceType(), clang::SourceLocation::isValid(), LangOpts, LookupMemberName, clang::Decl::markUsed(), Other, ResolveExceptionSpec(), clang::LookupResult::resolveKind(), clang::FunctionDecl::setBody(), clang::Decl::setInvalidDecl(), clang::VK_LValue, and clang::FunctionDecl::willHaveBody().

Referenced by DefineDefaultedFunction(), and MarkFunctionReferenced().

◆ DefineImplicitCopyConstructor()

void Sema::DefineImplicitCopyConstructor ( SourceLocation CurrentLocation,
CXXConstructorDecl * Constructor )

DefineImplicitCopyConstructor - Checks for feasibility of defining this constructor as the copy constructor.

Definition at line 15941 of file SemaDeclCXX.cpp.

References ActOnCompoundStmt(), Context, clang::CopyConstructor, clang::CPlusPlus11, diagnoseDeprecatedCopyOperation(), getASTMutationListener(), getLangOpts(), MarkVTableUsed(), ResolveExceptionSpec(), and SetCtorInitializers().

Referenced by DefineDefaultedFunction(), and MarkFunctionReferenced().

◆ DefineImplicitDefaultConstructor()

void Sema::DefineImplicitDefaultConstructor ( SourceLocation CurrentLocation,
CXXConstructorDecl * Constructor )

DefineImplicitDefaultConstructor - Checks for feasibility of defining this constructor as the default constructor.

Definition at line 14240 of file SemaDeclCXX.cpp.

References clang::CompoundStmt, clang::Constructor, Context, getASTMutationListener(), clang::Decl::isInvalidDecl(), MarkVTableUsed(), ResolveExceptionSpec(), and SetCtorInitializers().

Referenced by DefineDefaultedFunction(), MarkFunctionReferenced(), and PerformConstructorInitialization().

◆ DefineImplicitDestructor()

void Sema::DefineImplicitDestructor ( SourceLocation CurrentLocation,
CXXDestructorDecl * Destructor )

DefineImplicitDestructor - Checks for feasibility of defining this destructor as the default destructor.

Definition at line 14531 of file SemaDeclCXX.cpp.

References CheckDestructor(), clang::CompoundStmt, Context, clang::Destructor, getASTMutationListener(), MarkBaseAndMemberDestructorsReferenced(), MarkVTableUsed(), and ResolveExceptionSpec().

Referenced by DefineDefaultedFunction(), and MarkFunctionReferenced().

◆ DefineImplicitLambdaToBlockPointerConversion()

void Sema::DefineImplicitLambdaToBlockPointerConversion ( SourceLocation CurrentLoc,
CXXConversionDecl * Conv )

Define the "body" of the conversion from a lambda object to a block pointer.

This routine doesn't actually define a sensible body; rather, it fills in the initialization expression needed to copy the lambda object into the block, and IR generation actually generates the real body of the block pointer conversion.

Definition at line 16193 of file SemaDeclCXX.cpp.

References ActOnCXXThis(), BuildBlockForLambdaConversion(), BuildReturnStmt(), Context, clang::CompoundStmt::Create(), clang::ImplicitCastExpr::Create(), CreateBuiltinUnaryOp(), Diag(), clang::ActionResult< PtrTy, Compress >::get(), getASTMutationListener(), getLangOpts(), clang::Decl::getLocation(), clang::CXXMethodDecl::getParent(), clang::Expr::getType(), clang::CXXRecordDecl::isGenericLambda(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::markUsed(), clang::FunctionDecl::setBody(), clang::Decl::setInvalidDecl(), and clang::VK_PRValue.

Referenced by MarkFunctionReferenced().

◆ DefineImplicitLambdaToFunctionPointerConversion()

◆ DefineImplicitMoveAssignment()

void Sema::DefineImplicitMoveAssignment ( SourceLocation CurrentLocation,
CXXMethodDecl * MethodDecl )

Defines an implicitly-declared move assignment operator.

Definition at line 15608 of file SemaDeclCXX.cpp.

References ActOnCompoundStmt(), clang::LookupResult::addDecl(), clang::CXXRecordDecl::bases(), BuildReturnStmt(), buildSingleCopyAssign(), clang::Type::castAs(), checkMoveAssignmentForRepeatedMove(), Context, Diag(), clang::FunctionDecl::doesThisDeclarationHaveABody(), clang::RecordDecl::fields(), clang::ActionResult< PtrTy, Compress >::getAs(), getASTMutationListener(), getCurrentThisType(), clang::Decl::getEndLoc(), getLangOpts(), clang::Decl::getLocation(), clang::FunctionDecl::getNonObjectParameter(), clang::FunctionDecl::getOverloadedOperator(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::Type::getPointeeType(), getPointeeType(), clang::QualType::getQualifiers(), clang::ValueDecl::getType(), clang::RecordDecl::hasFlexibleArrayMember(), clang::Invalid, clang::FunctionDecl::isDefaulted(), clang::FunctionDecl::isDeleted(), clang::CXXMethodDecl::isExplicitObjectMemberFunction(), clang::Type::isIncompleteArrayType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Decl::isInvalidDecl(), clang::FunctionDecl::isOverloadedOperator(), clang::Type::isReferenceType(), clang::SourceLocation::isValid(), LangOpts, LookupMemberName, clang::Decl::markUsed(), Other, ResolveExceptionSpec(), clang::LookupResult::resolveKind(), clang::FunctionDecl::setBody(), clang::Decl::setInvalidDecl(), clang::VK_LValue, clang::VK_XValue, and clang::FunctionDecl::willHaveBody().

Referenced by DefineDefaultedFunction(), and MarkFunctionReferenced().

◆ DefineImplicitMoveConstructor()

void Sema::DefineImplicitMoveConstructor ( SourceLocation CurrentLocation,
CXXConstructorDecl * Constructor )

DefineImplicitMoveConstructor - Checks for feasibility of defining this constructor as the move constructor.

Definition at line 16079 of file SemaDeclCXX.cpp.

References ActOnCompoundStmt(), Context, getASTMutationListener(), MarkVTableUsed(), clang::MoveConstructor, ResolveExceptionSpec(), and SetCtorInitializers().

Referenced by DefineDefaultedFunction(), and MarkFunctionReferenced().

◆ DefineInheritingConstructor()

◆ DefineUsedVTables()

bool Sema::DefineUsedVTables ( )

◆ DiagIfReachable()

bool Sema::DiagIfReachable ( SourceLocation Loc,
ArrayRef< const Stmt * > Stmts,
const PartialDiagnostic & PD )

Conditionally issue a diagnostic based on the statements's reachability analysis.

Emit a diagnostic when statements are reachable.

Parameters
StmtsIf Stmts is non-empty, delay reporting the diagnostic until the function body is parsed, and then do a basic reachability analysis to determine if the statement is reachable. If it is unreachable, the diagnostic will not be emitted.

Definition at line 20709 of file SemaExpr.cpp.

References AnalysisWarnings, clang::SemaBase::Diag(), ExprEvalContexts, FunctionScopes, getCurFunction(), and clang::Decl::isFirstDecl().

Referenced by DiagRuntimeBehavior().

◆ DiagnoseAbsenceOfOverrideControl()

void Sema::DiagnoseAbsenceOfOverrideControl ( NamedDecl * D,
bool Inconsistent )

◆ DiagnoseAbstractType()

◆ DiagnoseAlwaysNonNullPointer()

void Sema::DiagnoseAlwaysNonNullPointer ( Expr * E,
Expr::NullPointerConstantKind NullType,
bool IsEqual,
SourceRange Range )

Diagnose pointers that are always non-null.

Parameters
Ethe expression containing the pointer
NullKindNPCK_NotNull if E is a cast to bool, otherwise, E is compared to a null pointer
IsEqualTrue when the comparison is equal to a null pointer
RangeExtra SourceRange to highlight in the diagnostic

Definition at line 13650 of file SemaChecking.cpp.

References clang::Call, CheckForReference(), clang::FixItHint::CreateInsertion(), clang::SemaBase::Diag(), clang::Stmt::getBeginLoc(), getCurFunction(), clang::Stmt::getEndLoc(), clang::Expr::getExprLoc(), getLocForEndOfToken(), getPrintingPolicy(), getSourceManager(), clang::Stmt::getSourceRange(), clang::FunctionDecl::getTemplatedKind(), clang::ValueDecl::getType(), clang::Expr::IgnoreImpCasts(), clang::Expr::IgnoreParenImpCasts(), clang::Expr::IgnoreParens(), inTemplateInstantiation(), clang::isa(), IsInAnyMacroBody(), clang::Type::isIntegerType(), clang::SourceLocation::isMacroID(), clang::QualType::isNull(), clang::Type::isPointerType(), clang::Type::isSpecificBuiltinType(), clang::ValueDecl::isWeak(), clang::NonNull, clang::Expr::NPCK_NotNull, clang::Expr::NPCK_ZeroExpression, clang::Expr::NPCK_ZeroLiteral, clang::FunctionDecl::param_begin(), clang::FunctionDecl::param_end(), clang::FunctionDecl::parameters(), clang::SemaBase::PDiag(), clang::Stmt::printPretty(), SM, clang::Decl::specific_attrs(), clang::T, clang::FunctionDecl::TK_FunctionTemplate, and tryExprAsCall().

Referenced by CheckCompareOperands(), and CheckImplicitConversion().

◆ DiagnoseAmbiguousLookup()

◆ diagnoseArgDependentDiagnoseIfAttrs()

bool Sema::diagnoseArgDependentDiagnoseIfAttrs ( const FunctionDecl * Function,
const Expr * ThisArg,
ArrayRef< const Expr * > Args,
SourceLocation Loc )

Emit diagnostics for the diagnose_if attributes on Function, ignoring any non-ArgDependent DiagnoseIfAttrs.

Argument-dependent diagnose_if attributes should be checked each time a function is used as a direct callee of a function call.

Returns true if any errors were emitted.

Definition at line 7646 of file SemaOverload.cpp.

References clang::cast(), Context, diagnoseDiagnoseIfAttrsWith(), clang::Function, and clang::Result.

Referenced by checkCall().

◆ diagnoseArgIndependentDiagnoseIfAttrs()

bool Sema::diagnoseArgIndependentDiagnoseIfAttrs ( const NamedDecl * ND,
SourceLocation Loc )

Emit diagnostics for the diagnose_if attributes on Function, ignoring any ArgDependent DiagnoseIfAttrs.

Argument-independent diagnose_if attributes should be checked on every use of a function.

Returns true if any errors were emitted.

Definition at line 7664 of file SemaOverload.cpp.

References Context, diagnoseDiagnoseIfAttrsWith(), and clang::Result.

Referenced by DiagnoseUseOfDecl().

◆ DiagnoseAssignmentAsCondition()

◆ DiagnoseAssignmentEnum()

◆ DiagnoseAssignmentResult()

bool Sema::DiagnoseAssignmentResult ( AssignConvertType ConvTy,
SourceLocation Loc,
QualType DstType,
QualType SrcType,
Expr * SrcExpr,
AssignmentAction Action,
bool * Complained = nullptr )

DiagnoseAssignmentResult - Emit a diagnostic, if required, for the assignment conversion type specified by ConvTy.

This returns true if the conversion was invalid or false if the conversion was accepted.

Definition at line 17267 of file SemaExpr.cpp.

References clang::Assigning, clang::Type::castAs(), clang::Casting, clang::Compatible, clang::CompatiblePointerDiscardsQualifiers, clang::CompatibleVoidPtrToNonVoidPtr, Context, clang::Converting, clang::CPlusPlus, clang::SemaBase::Diag(), DiagnoseAssignmentEnum(), clang::SemaObjC::EmitRelatedResultTypeNote(), clang::SemaObjC::EmitRelatedResultTypeNoteForReturn(), clang::OverloadExpr::find(), clang::FunctionVoidPointer, clang::Qualifiers::getAddressSpace(), clang::ObjCObjectPointerType::getInterfaceType(), getLangOpts(), clang::Decl::getLocation(), clang::Qualifiers::getObjCLifetime(), clang::Type::getPointeeOrArrayElementType(), clang::Type::getPointeeType(), clang::Qualifiers::getPointerAuth(), clang::QualType::getQualifiers(), clang::Stmt::getSourceRange(), clang::QualType::getUnqualifiedType(), HandleFunctionTypeMismatch(), clang::ObjCInterfaceDecl::hasDefinition(), clang::ConversionFixItGenerator::Hints, clang::Incompatible, clang::IncompatibleBlockPointer, clang::IncompatibleFunctionPointer, clang::IncompatibleFunctionPointerStrict, clang::IncompatibleNestedPointerAddressSpaceMismatch, clang::IncompatibleNestedPointerQualifiers, clang::IncompatibleObjCQualifiedId, clang::IncompatibleObjCWeakRef, clang::IncompatiblePointer, clang::IncompatiblePointerDiscardsQualifiers, clang::IncompatiblePointerSign, clang::IncompatibleVectors, clang::Initializing, clang::IntToBlockPointer, clang::IntToPointer, clang::Type::isArrayType(), clang::PointerAuthQualifier::isEquivalent(), isInvalid(), clang::ConversionFixItGenerator::isNull(), clang::Type::isObjCObjectPointerType(), clang::Type::isObjCQualifiedIdType(), clang::Type::isSpecificBuiltinType(), IsStringLiteralToNonConstPointerConversion(), clang::ConversionFixItGenerator::Kind, maybeDiagnoseAssignmentToFunction(), NoteAllOverloadCandidates(), ObjC(), clang::Passing, clang::Passing_CFAudited, clang::SemaBase::PDiag(), clang::PointerToInt, clang::ObjCObjectPointerType::quals(), clang::Returning, clang::Sending, and clang::ConversionFixItGenerator::tryToFixConversion().

Referenced by ActOnIndirectGotoStmt(), CheckAssignmentOperands(), clang::InitializationSequence::Perform(), and PerformImplicitConversion().

◆ DiagnoseAutoDeductionFailure()

◆ DiagnoseAvailabilityOfDecl() [1/2]

void Sema::DiagnoseAvailabilityOfDecl ( NamedDecl * D,
ArrayRef< SourceLocation > Locs )

Definition at line 1162 of file SemaAvailability.cpp.

References DiagnoseAvailabilityOfDecl().

◆ DiagnoseAvailabilityOfDecl() [2/2]

◆ DiagnoseClassNameShadow()

bool Sema::DiagnoseClassNameShadow ( DeclContext * DC,
DeclarationNameInfo Info )

DiagnoseClassNameShadow - Implement C++ [class.mem]p13: If T is the name of a class, then each of the following shall have a name different from T:

  • every static data member of class T;
  • every member function of class T
  • every member of class T that is itself a type;
    Returns
    true if the declaration name violates these rules.

Definition at line 6285 of file SemaDecl.cpp.

References clang::SemaBase::Diag(), clang::DeclarationNameInfo::getLoc(), and clang::DeclarationNameInfo::getName().

Referenced by ActOnAliasDeclaration(), ActOnEnumConstant(), ActOnTag(), CheckClassTemplate(), CheckUsingShadowDecl(), and HandleDeclarator().

◆ DiagnoseCommaOperator()

void Sema::DiagnoseCommaOperator ( const Expr * LHS,
SourceLocation Loc )

Look for instances where it is likely the comma operator is confused with another operator.

There is an explicit list of acceptable expressions for the left hand side of the comma operator, otherwise emit a warning.

Definition at line 14384 of file SemaExpr.cpp.

References clang::Scope::BreakScope, Context, clang::Scope::ContinueScope, clang::Scope::ControlScope, clang::FixItHint::CreateInsertion(), clang::Scope::DeclScope, clang::SemaBase::Diag(), clang::Stmt::getBeginLoc(), getCurScope(), clang::Stmt::getEndLoc(), clang::Scope::getFlags(), getLangOpts(), clang::Stmt::getSourceRange(), IgnoreCommaOperand(), inTemplateInstantiation(), clang::SourceLocation::isMacroID(), LangOpts, and PP.

Referenced by CheckCommaOperands().

◆ DiagnoseConditionalForNull()

bool Sema::DiagnoseConditionalForNull ( const Expr * LHSExpr,
const Expr * RHSExpr,
SourceLocation QuestionLoc )

◆ diagnoseConflictingFunctionEffect()

◆ DiagnoseDeletedDefaultedFunction()

◆ DiagnoseDependentMemberLookup()

bool Sema::DiagnoseDependentMemberLookup ( const LookupResult & R)

Diagnose a lookup that found results in an enclosing class during error recovery.

This usually indicates that the results were found in a dependent base class that could not be searched as part of a template definition. Always issues a diagnostic (though this may be only a warning in MS compatibility mode).

Return true if the error is unrecoverable, or false if the caller should attempt to recover using these lookup results.

Definition at line 2457 of file SemaExpr.cpp.

References clang::LookupResult::begin(), CheckCXXThisCapture(), CodeSynthesisContexts, clang::FixItHint::CreateInsertion(), CurContext, clang::Sema::CodeSynthesisContext::DefaultFunctionArgumentInstantiation, clang::SemaBase::Diag(), clang::DeclContext::Equals(), clang::Decl::getDeclContext(), getLangOpts(), clang::LookupResult::getLookupName(), clang::LookupResult::getNameLoc(), clang::LookupResult::getNamingClass(), clang::DeclContext::getParent(), and clang::LookupResult::getRepresentativeDecl().

Referenced by BuildRecoveryCallExpr(), and DiagnoseEmptyLookup().

◆ DiagnoseEmptyLookup()

bool Sema::DiagnoseEmptyLookup ( Scope * S,
CXXScopeSpec & SS,
LookupResult & R,
CorrectionCandidateCallback & CCC,
TemplateArgumentListInfo * ExplicitTemplateArgs = nullptr,
ArrayRef< Expr * > Args = {},
DeclContext * LookupCtx = nullptr )

Diagnose an empty lookup.

Returns
false if new lookup candidates were found

Definition at line 2516 of file SemaExpr.cpp.

References clang::LookupResult::addDecl(), AddOverloadCandidate(), AddOverloadedCallCandidates(), AddTemplateOverloadCandidate(), clang::AS_none, clang::OverloadCandidateSet::BestViableFunction(), clang::cast(), clang::LookupResult::clear(), computeDeclContext(), Context, CorrectTypo(), clang::CPlusPlus, clang::OverloadCandidateSet::CSK_Normal, CurContext, clang::DeclarationName::CXXConversionFunctionName, clang::DeclarationName::CXXLiteralOperatorName, clang::DeclarationName::CXXOperatorName, clang::SemaBase::Diag(), DiagnoseDependentMemberLookup(), diagnoseTypo(), clang::LookupResult::empty(), clang::ErrorRecovery, clang::NestedNameSpecifier::getAsRecordDecl(), clang::DeclarationName::getAsString(), clang::TypoCorrection::getAsString(), clang::getAsTypeTemplateDecl(), clang::TypoCorrection::getCorrection(), clang::TypoCorrection::getCorrectionDeclAs(), clang::TypoCorrection::getCorrectionSpecifier(), clang::Decl::getDeclContext(), clang::TypoCorrection::getFoundDecl(), getLangOpts(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupName(), clang::LookupResult::getLookupNameInfo(), clang::DeclContext::getLookupParent(), clang::DeclarationName::getNameKind(), clang::LookupResult::getNameLoc(), clang::DeclContext::getRedeclContext(), clang::DeclarationNameInfo::getSourceRange(), clang::NamedDecl::getUnderlyingDecl(), clang::isa(), clang::NamedDecl::isCXXClassMember(), clang::CXXScopeSpec::isEmpty(), clang::TypoCorrection::isOverloaded(), LookupQualifiedName(), LookupTemplateName(), clang::DeclAccessPair::make(), clang::OR_Success, clang::SemaBase::PDiag(), clang::LookupResult::resolveKind(), clang::LookupResult::setLookupName(), clang::LookupResult::setNamingClass(), clang::TemplateArgumentListInfo::size(), clang::LookupResult::suppressDiagnostics(), TemplateNameIsRequired, and clang::TypoCorrection::WillReplaceSpecifier().

Referenced by ActOnIdExpression(), ActOnLambdaExpressionAfterIntroducer(), and BuildRecoveryCallExpr().

◆ DiagnoseEmptyLoopBody()

void Sema::DiagnoseEmptyLoopBody ( const Stmt * S,
const Stmt * PossibleBody )

Warn if a for/while loop statement S, which is followed by PossibleBody, has a suspicious null statement as a body.

Definition at line 15641 of file SemaChecking.cpp.

References CurrentInstantiationScope, clang::SemaBase::Diag(), Diags, clang::Stmt::getBeginLoc(), clang::NullStmt::getSemiLoc(), clang::isa(), ShouldDiagnoseEmptyStmtBody(), and SourceMgr.

Referenced by ActOnCompoundStmt().

◆ DiagnoseEmptyStmtBody()

void Sema::DiagnoseEmptyStmtBody ( SourceLocation StmtLoc,
const Stmt * Body,
unsigned DiagID )

Emit DiagID if statement located on StmtLoc has a suspicious null statement as a Body, and it is located on the same line.

This helps prevent bugs due to typos, such as: if (condition); do_stuff();

Definition at line 15620 of file SemaChecking.cpp.

References CurrentInstantiationScope, clang::SemaBase::Diag(), clang::NullStmt::getSemiLoc(), ShouldDiagnoseEmptyStmtBody(), and SourceMgr.

Referenced by ActOnEndOfDeferStmt(), ActOnFinishSwitchStmt(), ActOnIfStmt(), and FinishCXXForRangeStmt().

◆ DiagnoseEqualityWithExtraParens()

◆ diagnoseEquivalentInternalLinkageDeclarations()

void Sema::diagnoseEquivalentInternalLinkageDeclarations ( SourceLocation Loc,
const NamedDecl * D,
ArrayRef< const NamedDecl * > Equiv )

◆ DiagnoseExceptionUse()

void Sema::DiagnoseExceptionUse ( SourceLocation Loc,
bool IsTry )

Definition at line 4500 of file SemaStmt.cpp.

References Context, CUDA(), CurContext, getLangOpts(), getSourceManager(), clang::T, and targetDiag().

Referenced by ActOnCXXTryBlock(), and BuildCXXThrow().

◆ diagnoseExprIntendedAsTemplateName()

◆ diagnoseFunctionEffectConversion()

void Sema::diagnoseFunctionEffectConversion ( QualType DstType,
QualType SrcType,
SourceLocation Loc )

Warn when implicitly changing function effects.

Definition at line 696 of file Sema.cpp.

References clang::SemaBase::Diag(), and clang::FunctionEffectsRef::get().

Referenced by ImpCastExprToType().

◆ diagnoseFunctionEffectMergeConflicts()

void clang::Sema::diagnoseFunctionEffectMergeConflicts ( const FunctionEffectSet::Conflicts & Errs,
SourceLocation NewLoc,
SourceLocation OldLoc )

Definition at line 1462 of file SemaFunctionEffects.cpp.

References Diag().

Referenced by CheckOverridingFunctionAttributes(), and MergeFunctionDecl().

◆ DiagnoseFunctionSpecifiers()

◆ DiagnoseHiddenVirtualMethods()

void Sema::DiagnoseHiddenVirtualMethods ( CXXMethodDecl * MD)

Diagnose methods which overload virtual methods in a base class without overriding any.

Definition at line 10566 of file SemaDeclCXX.cpp.

References Diag(), Diags, FindHiddenVirtualMethods(), clang::Decl::getLocation(), clang::Decl::isInvalidDecl(), and NoteHiddenVirtualMethods().

Referenced by CheckCompletedCXXClass().

◆ diagnoseIgnoredQualifiers()

◆ DiagnoseImmediateEscalatingReason()

◆ DiagnoseInvalidExplicitObjectParameterInLambda()

◆ DiagnoseInvalidJumps()

void Sema::DiagnoseInvalidJumps ( Stmt * Body)

Definition at line 1094 of file JumpDiagnostics.cpp.

Referenced by ActOnBlockStmtExpr(), and ActOnFinishFunctionBody().

◆ DiagnoseMisalignedMembers()

void Sema::DiagnoseMisalignedMembers ( )

Diagnoses the current set of gathered accesses.

This happens at the end of each expression evaluation context. Diagnostics are emitted only for accesses gathered in the current evaluation context.

Definition at line 16240 of file SemaChecking.cpp.

References currentEvaluationContext(), clang::SemaBase::Diag(), clang::NamedDecl::getName(), clang::Decl::getSourceRange(), and clang::Sema::ExpressionEvaluationContextRecord::MisalignedMembers.

Referenced by PopExpressionEvaluationContext().

◆ diagnoseMissingImport() [1/2]

void Sema::diagnoseMissingImport ( SourceLocation Loc,
const NamedDecl * Decl,
MissingImportKind MIK,
bool Recover = true )

Diagnose that the specified declaration needs to be visible but isn't, and suggest a module import that would resolve the problem.

Definition at line 5662 of file SemaLookup.cpp.

References Context, diagnoseMissingImport(), getDefinitionToImport(), clang::Decl::getLocation(), and getOwningModule().

Referenced by computeDeclContext(), diagnoseMissingArgument(), diagnoseMissingImport(), diagnoseTypo(), DiagnoseUninstantiableTemplate(), and RequireCompleteEnumDecl().

◆ diagnoseMissingImport() [2/2]

◆ diagnoseMissingTemplateArguments() [1/2]

void Sema::diagnoseMissingTemplateArguments ( const CXXScopeSpec & SS,
bool TemplateKeyword,
TemplateDecl * TD,
SourceLocation Loc )

◆ diagnoseMissingTemplateArguments() [2/2]

◆ DiagnoseMultipleUserDefinedConversion()

◆ DiagnoseNonDefaultPragmaAlignPack()

◆ DiagnoseNontrivial()

void Sema::DiagnoseNontrivial ( const CXXRecordDecl * Record,
CXXSpecialMemberKind CSM )

Diagnose why the specified class does not have a trivial special member of the given kind.

Definition at line 10290 of file SemaDeclCXX.cpp.

References checkTrivialSubobjectCall(), Context, clang::CopyAssignment, clang::CopyConstructor, clang::Decl::getLocation(), clang::IgnoreTrivialABI, and TSK_CompleteObject.

Referenced by CheckNontrivialField().

◆ diagnoseNullableToNonnullConversion()

void Sema::diagnoseNullableToNonnullConversion ( QualType DstType,
QualType SrcType,
SourceLocation Loc )

Warn if we're implicitly casting from a _Nullable pointer type to a _Nonnull one.

Definition at line 680 of file Sema.cpp.

References clang::SemaBase::Diag(), clang::Type::getNullability(), clang::NonNull, clang::Nullable, and clang::NullableResult.

Referenced by CreateOverloadedBinOp(), ImpCastExprToType(), PerformConstructorInitialization(), and PerformImplicitConversion().

◆ DiagnosePrecisionLossInComplexDivision()

void Sema::DiagnosePrecisionLossInComplexDivision ( )

◆ diagnoseQualifiedDeclaration()

bool Sema::diagnoseQualifiedDeclaration ( CXXScopeSpec & SS,
DeclContext * DC,
DeclarationName Name,
SourceLocation Loc,
TemplateIdAnnotation * TemplateId,
bool IsMemberSpecialization )

Diagnose a declaration whose declarator-id has the given nested-name-specifier.

Parameters
SSThe nested-name-specifier of the declarator-id.
DCThe declaration context to which the nested-name-specifier resolves.
NameThe name of the entity being declared.
LocThe location of the name of the entity being declared.
IsMemberSpecializationWhether we are declaring a member specialization.
TemplateIdThe template-id, if any.
Returns
true if we cannot safely recover from this error, false otherwise.

Definition at line 6300 of file SemaDecl.cpp.

References clang::cast(), clang::CXXScopeSpec::clear(), Context, clang::FixItHint::CreateRemoval(), CurContext, clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXDestructorName, clang::SemaBase::Diag(), clang::DeclContext::Encloses(), clang::DeclContext::Equals(), clang::NestedNameSpecifierLoc::getAsTypeLoc(), clang::DeclarationName::getCXXNameType(), clang::DeclarationName::getNameKind(), clang::DeclContext::getParent(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::isa(), clang::DeclContext::isRecord(), clang::CXXScopeSpec::isValid(), clang::SourceLocation::isValid(), LangOpts, clang::CXXScopeSpec::location_data(), clang::T, and clang::TemplateIdAnnotation::TemplateKWLoc.

Referenced by ActOnClassTemplateSpecialization(), ActOnCXXMemberDeclarator(), ActOnTag(), CheckClassTemplate(), and HandleDeclarator().

◆ DiagnoseReturnInConstructorExceptionHandler()

void Sema::DiagnoseReturnInConstructorExceptionHandler ( CXXTryStmt * TryBlock)

◆ DiagnoseSelfMove()

◆ DiagnoseSentinelCalls()

void Sema::DiagnoseSentinelCalls ( const NamedDecl * D,
SourceLocation Loc,
ArrayRef< Expr * > Args )

◆ DiagnoseShadowingLambdaDecls()

void Sema::DiagnoseShadowingLambdaDecls ( const sema::LambdaScopeInfo * LSI)

◆ DiagnoseSizeOfParametersAndReturnValue()

void Sema::DiagnoseSizeOfParametersAndReturnValue ( ArrayRef< ParmVarDecl * > Parameters,
QualType ReturnTy,
NamedDecl * D )

Diagnose whether the size of parameters or return value of a function or obj-c method definition is pass-by-value and larger than a specified threshold.

Definition at line 15736 of file SemaDecl.cpp.

References Context, clang::SemaBase::Diag(), clang::Decl::getLocation(), clang::Type::isDependentType(), clang::QualType::isPODType(), LangOpts, clang::Parameter, and clang::T.

Referenced by ActOnFinishFunctionBody().

◆ DiagnoseStaticAssertDetails()

void Sema::DiagnoseStaticAssertDetails ( const Expr * E)

Try to print more useful information about a failed static_assert with expression \E.

Definition at line 17655 of file SemaDeclCXX.cpp.

References clang::Cond, Context, ConvertAPValueToString(), Diag(), DiagnoseTypeTraitDetails(), clang::Expr::EvaluateAsRValue(), clang::Expr::getType(), clang::isa(), clang::Type::isBooleanType(), clang::Result, and UsefulToPrintExpr().

Referenced by BuildStaticAssertDeclaration().

◆ DiagnoseTemplateParameterShadow()

void Sema::DiagnoseTemplateParameterShadow ( SourceLocation Loc,
Decl * PrevDecl,
bool SupportedForCompatibility = false )

DiagnoseTemplateParameterShadow - Produce a diagnostic complaining that the template parameter 'PrevDecl' is being shadowed by a new declaration at location Loc.

Returns true to indicate that this is an error, and false otherwise.

Parameters
LocThe location of the declaration that shadows a template parameter.
PrevDeclThe template parameter that the declaration shadows.
SupportedForCompatibilityWhether to issue the diagnostic as a warning for compatibility with older versions of clang. Ignored when MSVC compatibility is enabled.

Definition at line 906 of file SemaTemplate.cpp.

References clang::cast(), clang::SemaBase::Diag(), getLangOpts(), clang::Decl::isTemplateParameter(), and NoteTemplateParameterLocation().

Referenced by ActOnAliasDeclaration(), ActOnDecompositionDeclarator(), ActOnEnumConstant(), ActOnExceptionDeclarator(), ActOnNamespaceAliasDef(), ActOnParamDeclarator(), ActOnTag(), BuildUsingDeclaration(), CheckClassTemplate(), HandleDeclarator(), HandleField(), HandleMSProperty(), and maybeDiagnoseTemplateParameterShadow().

◆ DiagnoseTypeTraitDetails()

◆ diagnoseTypo() [1/2]

◆ diagnoseTypo() [2/2]

void Sema::diagnoseTypo ( const TypoCorrection & Correction,
const PartialDiagnostic & TypoDiag,
const PartialDiagnostic & PrevNote,
bool ErrorRecovery = true )

Diagnose a successfully-corrected typo.

Separated from the correction itself to allow external validation of the result, etc.

Parameters
CorrectionThe result of performing typo correction.
TypoDiagThe diagnostic to produce. This will have the corrected string added to it (and usually also a fixit).
PrevNoteA note to use when indicating the location of the entity to which we are correcting. Will have the correction string added to it.
ErrorRecoveryIf true (the default), the caller is going to recover from the typo as if the corrected string had been typed. In this case, PDiag must be an error, and we will attach a fixit to it.

Definition at line 5789 of file SemaLookup.cpp.

References clang::FixItHint::CreateReplacement(), Declaration, clang::SemaBase::Diag(), diagnoseMissingImport(), clang::ErrorRecovery, clang::TypoCorrection::getAsString(), clang::SourceRange::getBegin(), clang::TypoCorrection::getCorrectionRange(), clang::PartialDiagnostic::getDiagID(), clang::TypoCorrection::getExtraDiagnostics(), clang::TypoCorrection::getFoundDecl(), getLangOpts(), clang::TypoCorrection::getQuoted(), clang::TypoCorrection::isKeyword(), clang::nullptr, and clang::TypoCorrection::requiresImport().

◆ diagnoseUnavailableAlignedAllocation()

◆ DiagnoseUnexpandedParameterPack() [1/6]

bool Sema::DiagnoseUnexpandedParameterPack ( const CXXScopeSpec & SS,
UnexpandedParameterPackContext UPPC )

If the given nested-name-specifier contains an unexpanded parameter pack, diagnose the error.

Parameters
SSThe nested-name-specifier that is being checked for unexpanded parameter packs.
Returns
true if an error occurred, false otherwise.

Definition at line 588 of file SemaTemplateVariadic.cpp.

References clang::NestedNameSpecifier::containsUnexpandedParameterPack(), DiagnoseUnexpandedParameterPacks(), clang::SourceRange::getBegin(), clang::CXXScopeSpec::getRange(), and clang::CXXScopeSpec::getScopeRep().

◆ DiagnoseUnexpandedParameterPack() [2/6]

◆ DiagnoseUnexpandedParameterPack() [3/6]

bool Sema::DiagnoseUnexpandedParameterPack ( Expr * E,
UnexpandedParameterPackContext UPPC = UPPC_Expression )

If the given expression contains an unexpanded parameter pack, diagnose the error.

Parameters
EThe expression that is being checked for unexpanded parameter packs.
Returns
true if an error occurred, false otherwise.

Definition at line 540 of file SemaTemplateVariadic.cpp.

References clang::Expr::containsUnexpandedParameterPack(), DiagnoseUnexpandedParameterPacks(), clang::Stmt::getBeginLoc(), and getEnclosingLambdaOrBlock().

◆ DiagnoseUnexpandedParameterPack() [4/6]

bool Sema::DiagnoseUnexpandedParameterPack ( SourceLocation Loc,
TemplateName Template,
UnexpandedParameterPackContext UPPC )

If the given template name contains an unexpanded parameter pack, diagnose the error.

Parameters
LocThe location of the template name.
TemplateThe template name that is being checked for unexpanded parameter packs.
Returns
true if an error occurred, false otherwise.

Definition at line 640 of file SemaTemplateVariadic.cpp.

References DiagnoseUnexpandedParameterPacks(), and clang::Template.

◆ DiagnoseUnexpandedParameterPack() [5/6]

bool Sema::DiagnoseUnexpandedParameterPack ( SourceLocation Loc,
TypeSourceInfo * T,
UnexpandedParameterPackContext UPPC )

If the given type contains an unexpanded parameter pack, diagnose the error.

Parameters
LocThe source location where a diagnostc should be emitted.
TThe type that is being checked for unexpanded parameter packs.
Returns
true if an error occurred, false otherwise.

Definition at line 524 of file SemaTemplateVariadic.cpp.

References DiagnoseUnexpandedParameterPacks(), and clang::T.

Referenced by ActOnAliasDeclaration(), ActOnBaseSpecifier(), ActOnBlockArguments(), ActOnCaseExpr(), ActOnClassTemplateSpecialization(), ActOnCXXAssumeAttr(), ActOnCXXForRangeStmt(), ActOnDecompositionDeclarator(), ActOnExceptionDeclarator(), ActOnFinishConceptDefinition(), ActOnFinishCXXInClassMemberInitializer(), ActOnFinishFullExpr(), ActOnFriendFunctionDecl(), ActOnFriendTypeDecl(), ActOnFunctionDeclarator(), ActOnGCCAsmStmtString(), ActOnLambdaExpressionAfterIntroducer(), ActOnNonTypeTemplateParameter(), ActOnParamDefaultArgument(), ActOnRequiresClause(), ActOnStaticAssertDeclaration(), ActOnTag(), ActOnTemplateTemplateParameter(), ActOnTypeParameter(), ActOnUsingDeclaration(), ActOnVarTemplateSpecialization(), AddInitializerToDecl(), BuildBaseInitializer(), BuildMemberInitializer(), BuildReturnStmt(), BuildTypeConstraint(), clang::checkAMDGPUMaxNumWorkGroupsArguments(), clang::checkAMDGPUWavesPerEUArguments(), CheckEnumConstant(), checkExceptionSpecification(), CheckMicrosoftIfExistsSymbol(), CheckTemplateParameterList(), DiagnoseUnexpandedParameterPack(), DiagnoseUnexpandedParameterPacks(), getLambdaType(), handleAlignedAttr(), HandleDeclarator(), HandleField(), HandleMSProperty(), InventTemplateParameter(), makeAttributeArgExpr(), makeClusterDimsArgExpr(), makeLaunchBoundsArgExpr(), and VerifyBitField().

◆ DiagnoseUnexpandedParameterPack() [6/6]

bool Sema::DiagnoseUnexpandedParameterPack ( TemplateArgumentLoc Arg,
UnexpandedParameterPackContext UPPC )

If the given template argument contains an unexpanded parameter pack, diagnose the error.

Parameters
ArgThe template argument that is being checked for unexpanded parameter packs.
Returns
true if an error occurred, false otherwise.

Definition at line 654 of file SemaTemplateVariadic.cpp.

References clang::TemplateArgument::containsUnexpandedParameterPack(), DiagnoseUnexpandedParameterPacks(), clang::TemplateArgumentLoc::getArgument(), clang::TemplateArgumentLoc::getLocation(), and clang::TemplateArgument::isNull().

◆ DiagnoseUnexpandedParameterPackInRequiresExpr()

bool Sema::DiagnoseUnexpandedParameterPackInRequiresExpr ( RequiresExpr * RE)

If the given requirees-expression contains an unexpanded reference to one of its own parameter packs, diagnose the error.

Parameters
REThe requiress-expression that is being checked for unexpanded parameter packs.
Returns
true if an error occurred, false otherwise.

Definition at line 565 of file SemaTemplateVariadic.cpp.

References clang::Expr::containsUnexpandedParameterPack(), DiagnoseUnexpandedParameterPacks(), clang::RequiresExpr::getBeginLoc(), clang::RequiresExpr::getLocalParameters(), and UPPC_Requirement.

Referenced by ActOnRequiresExpr().

◆ DiagnoseUnexpandedParameterPacks()

bool Sema::DiagnoseUnexpandedParameterPacks ( SourceLocation Loc,
UnexpandedParameterPackContext UPPC,
ArrayRef< UnexpandedParameterPack > Unexpanded )

Diagnose unexpanded parameter packs.

Diagnose all of the unexpanded parameter packs in the given vector.

Parameters
LocThe location at which we should emit the diagnostic.
UPPCThe context in which we are diagnosing unexpanded parameter packs.
Unexpandedthe set of unexpanded parameter packs.
Returns
true if an error occurred, false otherwise.

Definition at line 434 of file SemaTemplateVariadic.cpp.

References clang::cast(), clang::declaresSameEntity(), clang::SemaBase::Diag(), clang::Func, FunctionScopes, getEnclosingLambdaOrBlock(), and clang::NamedDecl::getIdentifier().

Referenced by CheckTemplateParameterList(), DiagnoseUnexpandedParameterPack(), DiagnoseUnexpandedParameterPack(), DiagnoseUnexpandedParameterPack(), DiagnoseUnexpandedParameterPack(), DiagnoseUnexpandedParameterPack(), DiagnoseUnexpandedParameterPack(), and DiagnoseUnexpandedParameterPackInRequiresExpr().

◆ DiagnoseUnguardedAvailabilityViolations()

void Sema::DiagnoseUnguardedAvailabilityViolations ( Decl * FD)

Issue any -Wunguarded-availability warnings in FD.

Definition at line 1089 of file SemaAvailability.cpp.

References clang::Decl::getAsFunction().

Referenced by ActOnBlockStmtExpr(), and ActOnFinishFunctionBody().

◆ DiagnoseUninstantiableTemplate()

bool Sema::DiagnoseUninstantiableTemplate ( SourceLocation PointOfInstantiation,
NamedDecl * Instantiation,
bool InstantiatedFromMember,
const NamedDecl * Pattern,
const NamedDecl * PatternDef,
TemplateSpecializationKind TSK,
bool Complain = true,
bool * Unreachable = nullptr )

◆ DiagnoseUniqueObjectDuplication()

◆ DiagnoseUnknownAttribute()

◆ DiagnoseUnknownTemplateName()

◆ DiagnoseUnknownTypeName()

◆ DiagnoseUnsatisfiedConstraint() [1/2]

void Sema::DiagnoseUnsatisfiedConstraint ( const ConceptSpecializationExpr * ConstraintExpr,
bool First = true )

◆ DiagnoseUnsatisfiedConstraint() [2/2]

void Sema::DiagnoseUnsatisfiedConstraint ( const ConstraintSatisfaction & Satisfaction,
SourceLocation Loc = {},
bool First = true )

◆ DiagnoseUnterminatedPragmaAlignPack()

◆ DiagnoseUnterminatedPragmaAttribute()

void Sema::DiagnoseUnterminatedPragmaAttribute ( )

Definition at line 1245 of file SemaAttr.cpp.

References clang::SemaBase::Diag(), and PragmaAttributeStack.

Referenced by ActOnEndOfTranslationUnit().

◆ DiagnoseUnusedButSetDecl()

◆ DiagnoseUnusedDecl() [1/2]

void Sema::DiagnoseUnusedDecl ( const NamedDecl * ND)

◆ DiagnoseUnusedDecl() [2/2]

void Sema::DiagnoseUnusedDecl ( const NamedDecl * ND,
DiagReceiverTy DiagReceiver )

DiagnoseUnusedDecl - Emit warnings about declarations that are not used unless they are marked attr(unused).

Definition at line 2154 of file SemaDecl.cpp.

References clang::cast(), Context, GenerateFixForUnusedDecl(), getLangOpts(), clang::Decl::getLocation(), clang::isa(), clang::SemaBase::PDiag(), ShouldDiagnoseUnusedDecl(), and UnusedLocalTypedefNameCandidates.

◆ DiagnoseUnusedExprResult()

void Sema::DiagnoseUnusedExprResult ( const Stmt * S,
unsigned DiagID )

DiagnoseUnusedExprResult - If the statement passed in is an expression whose result is unused, warn.

Definition at line 405 of file SemaStmt.cpp.

Referenced by ActOnFinishFullExpr(), and CheckCommaOperands().

◆ DiagnoseUnusedLambdaCapture()

◆ DiagnoseUnusedNestedTypedefs() [1/2]

void Sema::DiagnoseUnusedNestedTypedefs ( const RecordDecl * D)

◆ DiagnoseUnusedNestedTypedefs() [2/2]

void Sema::DiagnoseUnusedNestedTypedefs ( const RecordDecl * D,
DiagReceiverTy DiagReceiver )

◆ DiagnoseUnusedParameters()

void Sema::DiagnoseUnusedParameters ( ArrayRef< ParmVarDecl * > Parameters)

Diagnose any unused parameters in the given sequence of ParmVarDecl pointers.

Definition at line 15720 of file SemaDecl.cpp.

References clang::SemaBase::Diag(), inTemplateInstantiation(), and clang::Parameter.

Referenced by ActOnBlockStmtExpr(), and ActOnFinishFunctionBody().

◆ DiagnoseUseOfDecl()

bool Sema::DiagnoseUseOfDecl ( NamedDecl * D,
ArrayRef< SourceLocation > Locs,
const ObjCInterfaceDecl * UnknownObjCClass = nullptr,
bool ObjCPropertyAccess = false,
bool AvoidPartialAvailabilityChecks = false,
ObjCInterfaceDecl * ClassReceiver = nullptr,
bool SkipTrailingRequiresClause = false )

Determine whether the use of this declaration is valid, and emit any corresponding diagnostics.

This routine diagnoses various problems with referencing declarations that can occur when using a declaration. For example, it might warn if a deprecated or unavailable declaration is being used, or produce an error (and return true) if a C++0x deleted function is being used.

Returns
true if there was an error (this declaration cannot be referenced), false otherwise.

Definition at line 225 of file SemaExpr.cpp.

References clang::cast(), CheckConceptUseInDefinition(), CheckFunctionConstraints(), checkTypeSupport(), Concept, Context, clang::CPlusPlus, clang::CPlusPlus14, CUDA(), CurContext, DeduceReturnType(), clang::SemaBase::Diag(), diagnoseArgIndependentDiagnoseIfAttrs(), DiagnoseAvailabilityOfDecl(), diagnoseUnavailableAlignedAllocation(), DiagnoseUnsatisfiedConstraint(), DiagnoseUnusedOfDecl(), diagnoseUseOfInternalDeclInInlineFunction(), Diags, clang::LangOptionsBase::FEM_UnsetOnCommandLine, clang::Decl::getCanonicalDecl(), getCurFunction(), clang::NamedDecl::getDeclName(), getLangOpts(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::SemaOpenMP::getOpenMPDeclareMapperVarName(), clang::StringLiteral::getString(), clang::Decl::hasAttr(), clang::sema::FunctionScopeInfo::HasOMPDeclareReductionCombiner, clang::isa(), clang::ConstraintSatisfaction::IsSatisfied, LangOpts, NoteDeletedFunction(), OpenMP(), ParsingInitForAutoVars, PP, SuppressedDiagnostics, targetDiag(), and clang::VarDecl::TLS_None.

Referenced by ActOnCXXDelete(), ActOnDecltypeExpression(), ActOnLambdaExpressionAfterIntroducer(), ActOnNamespaceAliasDef(), ActOnUsingDirective(), BuildCallToObjectOfClassType(), BuildCXXCastArgument(), BuildCXXNestedNameSpecifier(), BuildCXXNew(), BuildDeclarationNameExpr(), BuildMemberReferenceExpr(), BuildTypeofExprType(), CheckConceptTemplateId(), CheckConstrainedAuto(), CheckCXXThrowOperand(), CheckDestructor(), checkDestructorReference(), CheckParmsForFunctionDef(), CheckTemplateArgument(), CheckTemplateIdType(), checkTypeDeclType(), ClassifyName(), ConvertDeclSpecToType(), CreateFunctionRefExpr(), DeduceTemplateSpecializationFromInitializer(), DiagnoseUseOfOverloadedDecl(), diagnoseUseOfProtocols(), FinalizeVarWithDestructor(), FinishOverloadedCallExpr(), GetEnumUnderlyingType(), getTypeName(), LookupMemberExpr(), MarkBaseDestructorsReferenced(), MarkFieldDestructorReferenced(), MarkVirtualBaseDestructorsReferenced(), MaybeBindToTemporary(), clang::InitializationSequence::Perform(), PerformConstructorInitialization(), PerformImplicitConversion(), resolveAndFixAddressOfSingleOverloadCandidate(), ResolveAndFixSingleFunctionTemplateSpecialization(), and SetDelegatingInitializer().

◆ DiagnoseUseOfDeletedFunction()

◆ DiagnoseUseOfOverloadedDecl()

bool clang::Sema::DiagnoseUseOfOverloadedDecl ( NamedDecl * D,
SourceLocation Loc )
inline

◆ diagnoseZeroToNullptrConversion()

◆ DiagPlaceholderFieldDeclDefinitions()

void Sema::DiagPlaceholderFieldDeclDefinitions ( RecordDecl * Record)

Emit diagnostic warnings for placeholder members.

We can only do that after the class is fully constructed, as anonymous union/structs can insert placeholders in their parent scope (which might be a Record).

Definition at line 5515 of file SemaDecl.cpp.

References clang::CPlusPlus, DiagPlaceholderVariableDefinition(), clang::First, getLangOpts(), clang::Decl::getLocation(), and clang::NamedDecl::isPlaceholderVar().

Referenced by ActOnDefinedDeclarationSpecifier().

◆ DiagPlaceholderVariableDefinition()

◆ DiagRedefinedPlaceholderFieldDecl()

◆ DiagRuntimeBehavior() [1/2]

bool Sema::DiagRuntimeBehavior ( SourceLocation Loc,
ArrayRef< const Stmt * > Stmts,
const PartialDiagnostic & PD )

Similar, but diagnostic is only produced if all the specified statements are reachable.

Emit a diagnostic that describes an effect on the run-time behavior of the program being compiled.

This routine emits the given diagnostic when the code currently being type-checked is "potentially evaluated", meaning that there is a possibility that the code will actually be executable. Code in sizeof() expressions, code used only during overload resolution, etc., are not potentially evaluated. This routine will suppress such diagnostics or, in the absolutely nutty case of potentially potentially evaluated expressions (C++ typeid), queue the diagnostic to potentially emit it later.

This routine should be used for all diagnostics that describe the run-time behavior of a program, such as passing a non-POD value through an ellipsis. Failure to do so will likely result in spurious diagnostics or failures during overload resolution or within sizeof/alignof/typeof/typeid.

Definition at line 20761 of file SemaExpr.cpp.

References ConstantEvaluated, DiagIfReachable(), DiscardedStatement, ExprEvalContexts, ImmediateFunctionContext, PotentiallyEvaluated, PotentiallyEvaluatedIfUsed, Unevaluated, UnevaluatedAbstract, and UnevaluatedList.

◆ DiagRuntimeBehavior() [2/2]

bool Sema::DiagRuntimeBehavior ( SourceLocation Loc,
const Stmt * Statement,
const PartialDiagnostic & PD )

Conditionally issue a diagnostic based on the current evaluation context.

Parameters
StatementIf Statement is non-null, delay reporting the diagnostic until the function body is parsed, and then do a basic reachability analysis to determine if the statement is reachable. If it is unreachable, the diagnostic will not be emitted.

Definition at line 20788 of file SemaExpr.cpp.

References DiagRuntimeBehavior().

Referenced by AnalyzeComparison(), BuildVAArgExpr(), BuiltinConstantArgRange(), CheckForNullPointerDereference(), CheckForNullPointerDereference(), CheckImplicitConversion(), CheckNonNullArgument(), CheckPointerConversion(), CheckTautologicalComparison(), checkVariadicArgument(), DiagnoseBadDivideOrRemainderValues(), DiagnoseBadShiftValues(), DiagnoseFloatingImpCast(), DiagnoseImpCast(), diagnoseSubtractionOnNullPointer(), diagnoseTautologicalComparison(), DiagRuntimeBehavior(), and LookupMemberExpr().

◆ DirectX()

SemaDirectX & clang::Sema::DirectX ( )
inline

Definition at line 1453 of file Sema.h.

◆ DiscardCleanupsInEvaluationContext()

◆ DiscardingCFIUncheckedCallee()

bool Sema::DiscardingCFIUncheckedCallee ( QualType From,
QualType To ) const

Returns true if From is a function or pointer to a function with the cfi_unchecked_callee attribute but To is a function or pointer to function without this attribute.

Definition at line 12757 of file SemaChecking.cpp.

References Context, clang::Type::getAs(), clang::Type::getPointeeType(), and clang::QualType::isNull().

Referenced by CheckImplicitConversion().

◆ DiscardMisalignedMemberAddress()

void Sema::DiscardMisalignedMemberAddress ( const Type * T,
Expr * E )

This function checks if the expression is in the sef of potentially misaligned members and it is converted to some pointer type T with lower or equal alignment requirements.

If so it removes it. This is used when we do not want to diagnose such misaligned access (e.g. in conversions to void*).

Definition at line 16253 of file SemaChecking.cpp.

References clang::cast(), Context, currentEvaluationContext(), clang::Expr::IgnoreParens(), clang::isa(), clang::Sema::ExpressionEvaluationContextRecord::MisalignedMembers, and clang::T.

Referenced by ActOnCastExpr(), BuildCXXNamedCast(), CheckImplicitConversion(), and clang::InitializationSequence::Perform().

◆ emitAndClearUnusedLocalTypedefWarnings()

void Sema::emitAndClearUnusedLocalTypedefWarnings ( )

◆ emitDeferredDiags()

void Sema::emitDeferredDiags ( )

◆ EmitDiagnostic()

◆ EnsureTemplateArgumentListConstraints()

bool Sema::EnsureTemplateArgumentListConstraints ( TemplateDecl * Template,
const MultiLevelTemplateArgumentList & TemplateArgs,
SourceRange TemplateIDRange )

Ensure that the given template arguments satisfy the constraints associated with the given template, emitting a diagnostic if they do not.

Parameters
TemplateThe template to which the template arguments are being provided.
TemplateArgsThe converted, canonicalized template arguments.
TemplateIDRangeThe source range of the template id that caused the constraints check.
Returns
true if the constrains are not satisfied or could not be checked for satisfaction, false if the constraints are satisfied.

Definition at line 1623 of file SemaConcept.cpp.

References CheckConstraintSatisfaction(), clang::SemaBase::Diag(), DiagnoseUnsatisfiedConstraint(), clang::TemplateDecl::getAssociatedConstraints(), clang::SourceRange::getBegin(), clang::MultiLevelTemplateArgumentList::getInnermost(), getTemplateArgumentBindingsText(), getTemplateNameKindForDiagnostics(), clang::TemplateDecl::getTemplateParameters(), clang::ConstraintSatisfaction::IsSatisfied, and clang::TemplateName.

Referenced by CheckTemplateArgumentList().

◆ EnterDeclaratorContext()

void Sema::EnterDeclaratorContext ( Scope * S,
DeclContext * DC )

EnterDeclaratorContext - Used when we must lookup names in the context of a declarator's nested name specifier.

Definition at line 1402 of file SemaDecl.cpp.

References CurContext, EnterTemplatedContext(), clang::Scope::getEntity(), clang::Scope::getParent(), clang::Scope::isTemplateParamScope(), and clang::Scope::setEntity().

Referenced by ActOnCXXEnterDeclaratorScope(), and ActOnCXXEnterDeclInitializer().

◆ EnterTemplatedContext()

void Sema::EnterTemplatedContext ( Scope * S,
DeclContext * DC )

Enter a template parameter scope, after it's been associated with a particular DeclContext.

Causes lookup within the scope to chain through enclosing contexts in the correct order.

Definition at line 1450 of file SemaDecl.cpp.

References clang::cast(), clang::DeclContext::getLookupParent(), clang::Scope::getParent(), getTemplateDepth(), clang::Scope::isTemplateParamScope(), and clang::Scope::setLookupEntity().

Referenced by ActOnClassTemplateSpecialization(), ActOnReenterTemplateScope(), CheckClassTemplate(), and EnterDeclaratorContext().

◆ EvaluateAsString() [1/2]

bool Sema::EvaluateAsString ( Expr * Message,
APValue & Result,
ASTContext & Ctx,
StringEvaluationContext EvalContext,
bool ErrorOnInvalidMessage )

Definition at line 17821 of file SemaDeclCXX.cpp.

References EvaluateAsStringImpl(), and clang::Result.

Referenced by ActOnGCCAsmStmtString(), and BuildStaticAssertDeclaration().

◆ EvaluateAsString() [2/2]

bool Sema::EvaluateAsString ( Expr * Message,
std::string & Result,
ASTContext & Ctx,
StringEvaluationContext EvalContext,
bool ErrorOnInvalidMessage )

Definition at line 17828 of file SemaDeclCXX.cpp.

References EvaluateAsStringImpl(), and clang::Result.

◆ EvaluateConvertedConstantExpression()

ExprResult Sema::EvaluateConvertedConstantExpression ( Expr * E,
QualType T,
APValue & Value,
CCEKind CCE,
bool RequireInt,
const APValue & PreNarrowingValue )

◆ EvaluateImplicitExceptionSpec()

void Sema::EvaluateImplicitExceptionSpec ( SourceLocation Loc,
FunctionDecl * FD )

Evaluate the implicit exception specification for a defaulted special member function.

Definition at line 7712 of file SemaDeclCXX.cpp.

References clang::Type::castAs(), computeImplicitExceptionSpec(), clang::EST_Unevaluated, clang::FunctionProtoType::getExceptionSpecType(), clang::ValueDecl::getType(), and UpdateExceptionSpec().

Referenced by ResolveExceptionSpec().

◆ ExitDeclaratorContext()

void Sema::ExitDeclaratorContext ( Scope * S)

◆ ExpandFunctionLocalPredefinedMacros()

◆ ExtractUnqualifiedFunctionType()

QualType Sema::ExtractUnqualifiedFunctionType ( QualType PossiblyAFunctionType)

Definition at line 13486 of file SemaOverload.cpp.

References Context, and clang::Type::getAs().

Referenced by IsStandardConversion().

◆ FillInlineAsmIdentifierInfo()

◆ FilterAcceptableTemplateNames()

◆ FilterLookupForScope()

◆ FilterUsingLookup()

void Sema::FilterUsingLookup ( Scope * S,
LookupResult & lookup )

Remove decls we can't actually see from a lookup being used to declare shadow using decls.

Parameters
S- The scope of the potential shadow decl
Previous- The lookup of a potential shadow decl's name.

Definition at line 13086 of file SemaDeclCXX.cpp.

References CurContext, clang::LookupResult::Filter::done(), clang::LookupResult::Filter::erase(), clang::Decl::getIdentifierNamespace(), clang::LookupResult::Filter::hasNext(), clang::Decl::IDNS_Ordinary, isDeclInScope(), clang::Decl::isLocalExternDecl(), clang::LookupResult::Filter::next(), and Previous.

Referenced by BuildUsingDeclaration(), and BuildUsingEnumDeclaration().

◆ FinalizeDeclaration()

void Sema::FinalizeDeclaration ( Decl * D)

FinalizeDeclaration - called by ParseDeclarationAfterDeclarator to perform any semantic actions necessary after any initializer has been attached.

Definition at line 15179 of file SemaDecl.cpp.

References clang::Decl::addAttr(), AddPushedVisibilityAttribute(), AnalysisWarnings, clang::cast(), clang::SemaCUDA::checkAllowedInitializer(), checkAttributesAfterMerging(), CheckStaticLocalForDllExport(), CheckThreadLocalForLargeAlignment(), Context, CUDA(), clang::SemaBase::Diag(), clang::Decl::dropAttr(), FinalizeDeclaration(), clang::Decl::getAttr(), clang::Decl::getDeclContext(), clang::getDLLAttr(), clang::Redeclarable< decl_type >::getFirstDecl(), clang::VarDecl::getInit(), clang::Expr::getIntegerConstantExpr(), getLangOpts(), clang::Attr::getLocation(), clang::Decl::getLocation(), clang::Decl::getParentFunctionOrMethod(), clang::DeclContext::getRedeclContext(), clang::Stmt::getSourceRange(), clang::VarDecl::getTLSKind(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::VarDecl::hasGlobalStorage(), clang::Initializer, inTemplateInstantiation(), clang::isa(), clang::NamedDecl::isExternallyVisible(), clang::DeclContext::isFileContext(), clang::VarDecl::isFileVarDecl(), clang::Attr::isInherited(), clang::Type::isIntegralOrEnumerationType(), clang::VarDecl::isOutOfLine(), clang::VarDecl::isStaticDataMember(), clang::VarDecl::isStaticLocal(), clang::VarDecl::isThisDeclarationADefinition(), LangOpts, MarkUnusedFileScopedDecl(), ParsingInitForAutoVars, PragmaClangBSSSection, PragmaClangDataSection, PragmaClangRelroSection, PragmaClangRodataSection, RegisterTypeTagForDatatype(), clang::Decl::setInvalidDecl(), and clang::Decl::specific_attrs().

Referenced by ActOnCXXForRangeIdentifier(), FinalizeDeclaration(), and FinishForRangeVarDecl().

◆ FinalizeDeclaratorGroup()

◆ FinalizeVarWithDestructor()

◆ FindAllocationFunctions()

bool Sema::FindAllocationFunctions ( SourceLocation StartLoc,
SourceRange Range,
AllocationFunctionScope NewScope,
AllocationFunctionScope DeleteScope,
QualType AllocType,
bool IsArray,
ImplicitAllocationParameters & IAP,
MultiExprArg PlaceArgs,
FunctionDecl *& OperatorNew,
FunctionDecl *& OperatorDelete,
bool Diagnose = true )

Finds the overloads of operator new and delete that are appropriate for the allocation.

Definition at line 2930 of file SemaExprCXX.cpp.

References adjustCCAndNoReturn(), clang::alignedAllocationModeFromBool(), clang::AS_public, clang::LookupResult::begin(), clang::cast(), clang::Type::castAsCXXRecordDecl(), CheckDeleteOperator(), clang::Class, clang::LookupResult::clear(), Context, clang::CPlusPlus11, CUDA(), DeclareGlobalNewDelete(), DeduceTemplateArguments(), clang::SemaBase::Diag(), Diagnose, clang::LookupResult::empty(), clang::LookupResult::end(), clang::SemaCUDA::EraseUnwantedMatches(), clang::Type::getAsCXXRecordDecl(), getCurFunctionDecl(), clang::NamedDecl::getDeclName(), getLangOpts(), clang::LookupResult::getNamingClass(), clang::ImplicitAllocationParameters::getNumImplicitArgs(), getStdAlignValT(), clang::Global, hasNewExtendedAlignment(), clang::isAlignedAllocation(), clang::LookupResult::isAmbiguous(), isNonPlacementDeallocationFunction(), clang::QualType::isNull(), clang::DeclContext::isRecord(), clang::Type::isRecordType(), clang::isSizedDeallocation(), clang::isTypeAwareAllocation(), clang::FunctionDecl::isTypeAwareOperatorNewOrDelete(), LookupGlobalDeallocationFunctions(), LookupOrdinaryName, LookupQualifiedName(), clang::DeclAccessPair::make(), clang::LookupResult::makeFilter(), clang::Match, clang::No, OptionallyTyped, clang::ImplicitAllocationParameters::PassAlignment, clang::ImplicitDeallocationParameters::PassAlignment, clang::ImplicitDeallocationParameters::PassSize, clang::ImplicitAllocationParameters::PassTypeIdentity, clang::ImplicitDeallocationParameters::PassTypeIdentity, RequireCompleteType(), resolveAllocationOverload(), resolveDeallocationOverload(), clang::sizedDeallocationModeFromBool(), clang::Success, clang::LookupResult::suppressDiagnostics(), tryBuildStdTypeIdentity(), clang::ImplicitAllocationParameters::Type, Untyped, and clang::FunctionProtoType::ExtProtoInfo::Variadic.

Referenced by BuildCXXNew().

◆ FindAssociatedClassesAndNamespaces()

void Sema::FindAssociatedClassesAndNamespaces ( SourceLocation InstantiationLoc,
ArrayRef< Expr * > Args,
AssociatedNamespaceSet & AssociatedNamespaces,
AssociatedClassSet & AssociatedClasses )

Find the associated classes and namespaces for argument-dependent lookup for a call with the given set of arguments.

This routine computes the sets of associated classes and associated namespaces searched by argument-dependent lookup (C++ [basic.lookup.argdep]) for a given set of arguments.

Definition at line 3311 of file SemaLookup.cpp.

References addAssociatedClassesAndNamespaces(), Context, clang::OverloadExpr::decls(), clang::OverloadExpr::FindResult::Expression, clang::OverloadExpr::find(), clang::Decl::getAsFunction(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::NamedDecl::getUnderlyingDecl(), and clang::Result.

Referenced by ArgumentDependentLookup(), argumentDependentLookup(), and DiagnoseTwoPhaseLookup().

◆ FindCompositePointerType() [1/2]

QualType Sema::FindCompositePointerType ( SourceLocation Loc,
Expr *& E1,
Expr *& E2,
bool ConvertArgs = true )

Find a merged pointer type and convert the two expressions to it.

This finds the composite pointer type for E1 and E2 according to C++2a [expr.type]p3. It converts both expressions to this type and returns it. It does not emit diagnostics (FIXME: that's not true if ConvertArgs is true).

Parameters
LocThe location of the operator requiring these two expressions to be converted to the composite pointer type.
ConvertArgsIf false, do not convert E1 and E2 to the target type.

The class for a pointer-to-member; a constant array type with a bound (if any) for an array. FIXME: Store Qualifier for pointer-to-member.

Definition at line 6123 of file SemaExprCXX.cpp.

References clang::FunctionProtoType::ExtProtoInfo::CFIUncheckedCallee, Context, clang::CPlusPlus, clang::CPlusPlus17, clang::CPlusPlus20, clang::InitializationKind::CreateCopy(), clang::declaresSameEntity(), clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::FunctionProtoType::ExtProtoInfo::ExtInfo, clang::Qualifiers::fromCVRUMask(), clang::ActionResult< PtrTy, Compress >::get(), clang::Qualifiers::getAddressSpace(), clang::Type::getAs(), clang::Type::getAsCXXRecordDecl(), getASTContext(), clang::ASTContext::getConstantArrayType(), clang::Qualifiers::getCVRUQualifiers(), clang::ArrayType::getElementType(), clang::ASTContext::getIncompleteArrayType(), getLangOpts(), clang::ASTContext::getMemberPointerType(), clang::MemberPointerType::getMostRecentCXXRecordDecl(), clang::FunctionType::ExtInfo::getNoReturn(), clang::Qualifiers::getObjCGCAttr(), clang::Qualifiers::getObjCLifetime(), clang::ASTContext::getObjCObjectPointerType(), clang::MemberPointerType::getPointeeType(), clang::ObjCObjectPointerType::getPointeeType(), clang::PointerType::getPointeeType(), clang::Type::getPointeeType(), clang::Qualifiers::getPointerAuth(), clang::ASTContext::getPointerType(), clang::ASTContext::getQualifiedType(), clang::Expr::getType(), ImpCastExprToType(), InitializationSequence, clang::InitializedEntity::InitializeTemporary(), clang::isa(), clang::Qualifiers::isAddressSpaceSupersetOf(), clang::Type::isAnyPointerType(), IsDerivedFrom(), clang::PointerAuthQualifier::isEquivalent(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isMemberPointerType(), clang::QualType::isNull(), clang::Expr::isNullPointerConstant(), clang::Type::isNullPtrType(), clang::Type::isObjCObjectPointerType(), clang::Type::isObjectType(), clang::isPtrSizeAddressSpace(), clang::Type::isVoidPointerType(), clang::Type::isVoidType(), clang::Normal, clang::Expr::NPC_ValueDependentIsNull, clang::InitializationSequence::Perform(), Pointer, clang::Qualifiers::setAddressSpace(), clang::Qualifiers::setObjCGCAttr(), clang::Qualifiers::setObjCLifetime(), clang::Qualifiers::setPointerAuth(), clang::T, and clang::FunctionType::ExtInfo::withNoReturn().

Referenced by convertPointersToCompositeType(), CXXCheckConditionalOperands(), and FindCompositePointerType().

◆ FindCompositePointerType() [2/2]

QualType clang::Sema::FindCompositePointerType ( SourceLocation Loc,
ExprResult & E1,
ExprResult & E2,
bool ConvertArgs = true )
inline

◆ FindDeallocationFunction()

◆ FindDeallocationFunctionForDestructor()

◆ findFailedBooleanCondition()

std::pair< Expr *, std::string > Sema::findFailedBooleanCondition ( Expr * Cond)

◆ FindFirstQualifierInScope()

NamedDecl * Sema::FindFirstQualifierInScope ( Scope * S,
NestedNameSpecifier NNS )

If the given nested-name-specifier begins with a bare identifier (e.g., Base::), perform name lookup for that identifier as a nested-name-specifier within the given scope, and return the result of that name lookup.

Definition at line 349 of file SemaCXXScopeSpec.cpp.

References clang::Found, clang::NestedNameSpecifier::getAsType(), clang::NestedNameSpecifier::getKind(), isAcceptableNestedNameSpecifier(), LookupName(), LookupNestedNameSpecifierName, clang::Result, clang::T, and clang::NestedNameSpecifier::Type.

Referenced by ActOnMemberAccessExpr().

◆ FindHiddenVirtualMethods()

void Sema::FindHiddenVirtualMethods ( CXXMethodDecl * MD,
SmallVectorImpl< CXXMethodDecl * > & OverloadedMethods )

◆ findInheritingConstructor()

CXXConstructorDecl * Sema::findInheritingConstructor ( SourceLocation Loc,
CXXConstructorDecl * BaseCtor,
ConstructorUsingShadowDecl * DerivedShadow )

Given a derived-class using shadow declaration for a constructor and the correspnding base class constructor, find or create the implicit synthesized derived class constructor to use for this initialization.

Find or create the fake constructor we synthesize to model constructing an object of a derived class via a constructor of a base class.

Definition at line 14292 of file SemaDeclCXX.cpp.

References clang::DeclContext::addDecl(), clang::cast(), clang::Type::castAs(), clang::TypeLoc::castAs(), clang::Constexpr, Context, clang::CXXConstructorDecl::Create(), clang::ParmVarDecl::Create(), clang::declaresSameEntity(), clang::DefaultConstructor, defaultedSpecialMemberIsConstexpr(), clang::EST_Unevaluated, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::Decl::getAccess(), clang::FunctionDecl::getConstexprKind(), getCurFPFeatures(), clang::NamedDecl::getDeclName(), clang::CXXConstructorDecl::getExplicitSpecifier(), clang::FunctionProtoType::getExtProtoInfo(), clang::Decl::getLocation(), clang::FunctionProtoType::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::FunctionProtoType::getParamType(), clang::FunctionProtoType::getParamTypes(), clang::ConstructorUsingShadowDecl::getParent(), clang::FunctionType::getReturnType(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::TypeSourceInfo::getType(), clang::ValueDecl::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::TypeLoc::IgnoreParens(), clang::FunctionDecl::isConstexpr(), clang::FunctionDecl::isDeleted(), clang::Decl::isInvalidDecl(), clang::DeclContext::lookup(), mergeDeclAttributes(), clang::SC_None, clang::Decl::setAccess(), SetDeclDeleted(), clang::Decl::setImplicit(), clang::Decl::setInvalidDecl(), clang::FunctionTypeLoc::setParam(), clang::FunctionDecl::setParams(), clang::ParmVarDecl::setScopeInfo(), clang::ValueDecl::setType(), ShouldDeleteSpecialMember(), clang::FunctionProtoType::ExceptionSpecInfo::Type, and clang::Unspecified.

Referenced by BuildCXXConstructExpr(), and PerformConstructorInitialization().

◆ FindInstantiatedContext()

DeclContext * Sema::FindInstantiatedContext ( SourceLocation Loc,
DeclContext * DC,
const MultiLevelTemplateArgumentList & TemplateArgs )

Finds the instantiation of the given declaration context within the current instantiation.

Returns
NULL if there was an error

Definition at line 6857 of file SemaTemplateInstantiateDecl.cpp.

References FindInstantiatedDecl().

Referenced by FindInstantiatedDecl().

◆ FindInstantiatedDecl()

NamedDecl * Sema::FindInstantiatedDecl ( SourceLocation Loc,
NamedDecl * D,
const MultiLevelTemplateArgumentList & TemplateArgs,
bool FindingInstantiatedContext = false )

Find the instantiation of the given declaration within the current instantiation.

This routine is intended to be used when D is a declaration referenced from within a template, that needs to mapped into the corresponding declaration within an instantiation. For example, given:

template<typename T>
struct X {
enum Kind {
KnownValue = sizeof(T)
};
bool getKind() const { return KnownValue; }
};
template struct X<int>;
static Decl::Kind getKind(const Decl *D)

In the instantiation of X<int>::getKind(), we need to map the EnumConstantDecl for KnownValue (which refers to X<T>::<Kind>::KnownValue) to its instantiation (X<int>::<Kind>::KnownValue). FindInstantiatedDecl performs this mapping from within the instantiation of X<int>.

Definition at line 6879 of file SemaTemplateInstantiateDecl.cpp.

References clang::TemplateArgumentListInfo::addArgument(), ArgPackSubstIndex, clang::Sema::CodeSynthesisContext::BuildingDeductionGuides, clang::cast(), CheckTemplateIdType(), ClassTemplate, CodeSynthesisContexts, Context, CurContext, CurrentInstantiationScope, clang::DeclContext::decls_begin(), clang::DeclContext::decls_end(), clang::SemaBase::Diag(), clang::Enum, clang::DeclContext::Equals(), FindInstantiatedContext(), FindInstantiatedDecl(), findInstantiationOf(), clang::Found, clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::Decl::getFriendObjectKind(), clang::MultiLevelTemplateArgumentList::getInnermost(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::DeclarationNameInfo::getName(), clang::Decl::getNonTransparentDeclContext(), clang::MultiLevelTemplateArgumentList::getNumRetainedOuterLevels(), clang::DeclContext::getParent(), clang::TemplateDecl::getTemplateParameters(), clang::CXXRecordDecl::getTemplateSpecializationKind(), clang::EnumDecl::getTemplateSpecializationKind(), getTrivialTemplateArgumentLoc(), getType(), hasUncompilableErrorOccurred(), clang::isa(), isDependentContextAtLevel(), clang::DeclContext::isFileContext(), clang::DeclContext::isFunctionOrMethod(), isInstantiationOf(), clang::Decl::isInvalidDecl(), clang::DeclContext::lookup(), clang::None, clang::TemplateArgument::Pack, RequireCompleteType(), clang::Result, clang::SemaBase::SemaRef, clang::TemplateParameterList::size(), SubstDecl(), SubstDeclarationNameInfo(), clang::T, clang::TemplateName, clang::TSK_ExplicitSpecialization, and usesPartialOrExplicitSpecialization().

Referenced by BuildVariableInstantiation(), FindInstantiatedContext(), FindInstantiatedDecl(), HandleDependentAccessCheck(), InstantiateMemInitializers(), and SubstParmVarDecl().

◆ findLocallyScopedExternCDecl()

NamedDecl * Sema::findLocallyScopedExternCDecl ( DeclarationName Name)

Look for a locally scoped extern "C" declaration by the given name.

Definition at line 6829 of file SemaDecl.cpp.

References Context, clang::nullptr, and clang::Result.

Referenced by checkForConflictWithNonVisibleExternC(), checkGlobalOrExternCConflict(), and ImplicitlyDefineFunction().

◆ findMacroSpelling()

bool Sema::findMacroSpelling ( SourceLocation & loc,
StringRef name )

Looks through the macro-expansion chain for the given location, looking for a macro expansion with the given name.

If one is found, returns true and sets the location to that expansion loc.

Definition at line 2301 of file Sema.cpp.

References getPreprocessor(), getSourceManager(), and clang::SourceLocation::isMacroID().

Referenced by AnalyzeBitFieldAssignment(), diagnoseBadTypeAttribute(), DiagnoseConditionalForNull(), and diagnoseZeroToNullptrConversion().

◆ FindUsualDeallocationFunction()

◆ FinishCXXForRangeStmt()

StmtResult Sema::FinishCXXForRangeStmt ( Stmt * ForRange,
Stmt * Body )

FinishCXXForRangeStmt - Attach the body to a C++0x for-range statement.

This is a separate step from ActOnCXXForRangeStmt because analysis of the body cannot be performed until after the type of the range variable is determined.

Definition at line 3204 of file SemaStmt.cpp.

References clang::cast(), DiagnoseEmptyStmtBody(), DiagnoseForRangeVariableCopies(), clang::SemaObjC::FinishObjCForCollectionStmt(), clang::ForStmt::getRParenLoc(), clang::isa(), ObjC(), clang::ForStmt::setBody(), and clang::StmtError().

Referenced by clang::TreeTransform< AdjustConstraints >::FinishCXXForRangeStmt().

◆ finishLambdaExplicitCaptures()

void Sema::finishLambdaExplicitCaptures ( sema::LambdaScopeInfo * LSI)

Note that we have finished the explicit captures for the given lambda.

Definition at line 563 of file SemaLambda.cpp.

References clang::sema::LambdaScopeInfo::finishedExplicitCaptures().

Referenced by ActOnLambdaExpressionAfterIntroducer().

◆ FinishTemplateArgumentDeduction()

TemplateDeductionResult Sema::FinishTemplateArgumentDeduction ( FunctionTemplateDecl * FunctionTemplate,
SmallVectorImpl< DeducedTemplateArgument > & Deduced,
unsigned NumExplicitlySpecified,
FunctionDecl *& Specialization,
sema::TemplateDeductionInfo & Info,
SmallVectorImpl< OriginalCallArg > const * OriginalCallArgs,
bool PartialOverloading,
bool PartialOrdering,
bool ForOverloadSetAddressResolution,
llvm::function_ref< bool(bool)> CheckNonDependent = [](bool ) { return false; } )

Finish template argument deduction for a function template, checking the deduced template arguments for completeness and forming the function template specialization.

Parameters
OriginalCallArgsIf non-NULL, the original call arguments against which the deduced argument types should be compared.
CheckNonDependentCallback before substituting into the declaration with the deduced template arguments.
OnlyInitializeNonUserDefinedConversionsis used as a workaround for some breakages introduced by CWG2369, where non-user-defined conversions are checked first before the constraints.

Definition at line 3922 of file SemaTemplateDeduction.cpp.

References clang::Sema::OriginalCallArg::ArgIdx, clang::TemplateArgumentList::asArray(), clang::sema::TemplateDeductionInfo::AssociatedConstraintsSatisfaction, clang::Sema::CheckTemplateArgumentInfo::CanonicalConverted, CheckFunctionTemplateConstraints(), CheckOriginalCallArgDeduction(), clang::ConstraintsNotSatisfied, Context, ConvertDeducedTemplateArguments(), clang::TemplateArgumentList::CreateCopy(), CurrentInstantiationScope, clang::Sema::OriginalCallArg::DecomposedParam, clang::Sema::CodeSynthesisContext::DeducedTemplateArgumentSubstitution, clang::sema::TemplateDeductionInfo::diag_begin(), clang::sema::TemplateDeductionInfo::diag_end(), FunctionTemplate, clang::sema::TemplateDeductionInfo::getLocation(), getPackIndexForParam(), instantiateExplicitSpecifierDeferred(), clang::InstantiationDepth, clang::isa(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::isLambdaCallOperator(), clang::isLambdaConversionOperator(), clang::QualType::isNull(), isSameDeclaration(), clang::ConstraintSatisfaction::IsSatisfied, clang::MiscellaneousDeductionFailure, clang::NonDependentConversionFailure, clang::Sema::OriginalCallArg::OriginalParamType, clang::PartialOrdering, clang::sema::TemplateDeductionInfo::reset(), clang::Result, clang::Specialization, SubstDecl(), clang::SubstitutionFailure, SubstType(), clang::Success, clang::Sema::CheckTemplateArgumentInfo::SugaredConverted, SuppressedDiagnostics, clang::sema::TemplateDeductionInfo::takeCanonical(), and clang::sema::TemplateDeductionInfo::takeSugared().

◆ FixOverloadedFunctionReference() [1/2]

ExprResult Sema::FixOverloadedFunctionReference ( Expr * E,
DeclAccessPair FoundDecl,
FunctionDecl * Fn )

FixOverloadedFunctionReference - E is an expression that refers to a C++ overloaded function (possibly with some parentheses and perhaps a '&' around it).

We have resolved the overloaded function to the function declaration Fn, so patch up the expression E to refer (possibly indirectly) to Fn. Returns the new expr.

Definition at line 16945 of file SemaOverload.cpp.

References clang::AS_none, BuildCXXThisExpr(), BuildDeclRefExpr(), BuildMemberExpr(), clang::cast(), CheckUnresolvedLookupAccess(), CheckUseOfCXXMethodAsAddressOfOperand(), Context, clang::GenericSelectionExpr::Create(), clang::ImplicitCastExpr::Create(), clang::UnaryOperator::Create(), CreateBuiltinUnaryOp(), CurFPFeatureOverrides(), clang::ExprError(), FixOverloadedFunctionReference(), clang::Found, clang::ActionResult< PtrTy, Compress >::get(), getLangOpts(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::isa(), isCompleteType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Method, clang::OK_Ordinary, clang::DeclRefExpr::setHadMultipleCandidates(), clang::ast_matchers::type, clang::VK_LValue, and clang::VK_PRValue.

Referenced by BuildCallToMemberFunction(), CheckSingleAssignmentConstraints(), CheckTemplateArgument(), clang::InitializationSequence::Diagnose(), FinishOverloadedCallExpr(), FixOverloadedFunctionReference(), FixOverloadedFunctionReference(), clang::InitializationSequence::Perform(), PerformImplicitConversion(), resolveAndFixAddressOfSingleOverloadCandidate(), and ResolveAndFixSingleFunctionTemplateSpecialization().

◆ FixOverloadedFunctionReference() [2/2]

ExprResult Sema::FixOverloadedFunctionReference ( ExprResult E,
DeclAccessPair FoundDecl,
FunctionDecl * Fn )

◆ ForceDeclarationOfImplicitMembers()

◆ forceUnknownAnyToType()

ExprResult Sema::forceUnknownAnyToType ( Expr * E,
QualType ToType )

Force an expression with unknown-type to an expression of the given type.

Definition at line 21439 of file SemaExpr.cpp.

Referenced by ActOnFinishFullExpr(), AddInitializerToDecl(), and deduceVarTypeFromInitializer().

◆ FormatStringHasSArg()

◆ forRedeclarationInCurContext()

◆ FreeVisContext()

void Sema::FreeVisContext ( )

FreeVisContext - Deallocate and null out VisContext.

Definition at line 1412 of file SemaAttr.cpp.

References VisContext.

Referenced by PopPragmaVisibility(), and ~Sema().

◆ FriendConstraintsDependOnEnclosingTemplate()

◆ FunctionNonObjectParamTypesAreEqual()

◆ FunctionParamTypesAreEqual() [1/2]

bool Sema::FunctionParamTypesAreEqual ( ArrayRef< QualType > Old,
ArrayRef< QualType > New,
unsigned * ArgPos = nullptr,
bool Reversed = false )

FunctionParamTypesAreEqual - This routine checks two function proto types for equality of their parameter types.

Caller has already checked that they have same number of parameters. If the parameters are different, ArgPos will have the parameter index of the first different parameter. If Reversed is true, the parameters of NewType will be compared in reverse order. That's useful if one of the functions is being used as a C++20 synthesized operator overload with a reversed parameter order.

Definition at line 3512 of file SemaOverload.cpp.

References Context, New, and clang::Reversed.

Referenced by FunctionNonObjectParamTypesAreEqual(), FunctionParamTypesAreEqual(), HandleFunctionTypeMismatch(), and IsOverloadOrOverrideImpl().

◆ FunctionParamTypesAreEqual() [2/2]

bool Sema::FunctionParamTypesAreEqual ( const FunctionProtoType * OldType,
const FunctionProtoType * NewType,
unsigned * ArgPos = nullptr,
bool Reversed = false )

◆ GatherArgumentsForCall()

bool Sema::GatherArgumentsForCall ( SourceLocation CallLoc,
FunctionDecl * FDecl,
const FunctionProtoType * Proto,
unsigned FirstParam,
ArrayRef< Expr * > Args,
SmallVectorImpl< Expr * > & AllArgs,
VariadicCallType CallType = VariadicCallType::DoesNotApply,
bool AllowExplicit = false,
bool IsListInitialization = false )

◆ getAmbiguousPathsDisplayString()

std::string Sema::getAmbiguousPathsDisplayString ( CXXBasePaths & Paths)

Builds a string representing ambiguous paths from a specific derived class to different subobjects of the same base class.

This function builds a string that can be used in error messages to show the different paths that one can take through the inheritance hierarchy to go from the derived class to different subobjects of a base class. The result looks something like this:

struct D -> struct B -> struct A
struct D -> struct C -> struct A

Definition at line 3211 of file SemaDeclCXX.cpp.

References Context, clang::QualType::getAsString(), and clang::CXXBasePaths::getOrigin().

Referenced by AttachBaseSpecifiers(), CheckDerivedToBaseConversion(), CheckMemberPointerConversion(), DiagnoseAmbiguousLookup(), DiagnoseInvalidExplicitObjectParameterInLambda(), and findDecomposableBaseClass().

◆ getASTConsumer()

ASTConsumer & clang::Sema::getASTConsumer ( ) const
inline

Definition at line 928 of file Sema.h.

References Consumer.

Referenced by getASTMutationListener(), clang::hlsl::HandleRootSignatureTarget(), and clang::ParseAST().

◆ getASTContext()

ASTContext & clang::Sema::getASTContext ( ) const
inline

Definition at line 927 of file Sema.h.

References Context.

Referenced by ActOnArraySubscriptExpr(), ActOnCapturedRegionEnd(), ActOnCXXNestedNameSpecifierIndexedPack(), ActOnEndOfTranslationUnit(), ActOnExplicitInstantiation(), ActOnFinishExportDecl(), ActOnGCCAsmStmtString(), ActOnModuleDecl(), ActOnModuleImport(), ActOnPseudoDestructorExpr(), addImplicitBindingAttrToDecl(), AddImplicitlyDeclaredMembersToClass(), AddOverloadCandidate(), AddOverrideResults(), addStaticToLambdaDeclSpecifier(), AnalyzeCompoundAssignment(), assignInheritanceModel(), BuildBitIntType(), BuildCallExpr(), buildCapture(), buildCaptureDecl(), BuildCXXDefaultArgExpr(), BuildCXXDefaultInitExpr(), buildDeclareReductionRef(), buildDeclRefExpr(), buildDistanceFunc(), BuildExpressionFromDeclTemplateArgument(), buildLambdaCaptureFixit(), buildLoopVarFunc(), BuildModuleInclude(), BuildPackIndexingExpr(), BuildPointerType(), BuildReferenceType(), buildUserDefinedMapperRef(), BuiltinFunctionStart(), BuiltinMaskedGather(), BuiltinMaskedScatter(), BuiltinOverflow(), BuiltinTriviallyRelocate(), clang::hlsl::BuiltinTypeMethodBuilder::BuiltinTypeMethodBuilder(), canPassInRegisters(), castVector(), CheckAllArgsHaveSameType(), clang::CheckAllArgsHaveSameType(), CheckArgTypeMatches(), checkArithmeticBinOpPointerOperands(), checkArrayExpressionDoesNotReferToUnitySize(), checkArrayExpressionDoesNotReferToWholeSize(), CheckBuiltinTargetInSupported(), CheckBuiltinTargetNotInUnsupported(), checkBuiltinTemplateIdType(), checkClassLevelDLLAttribute(), CheckCompareOperands(), checkConditionalPointerCompatibility(), CheckConstraintSatisfaction(), CheckCountedByAttrOnField(), CheckDeclarationCausesMultiVersioning(), CheckDeducedPlaceholderConstraints(), CheckExpectedBitWidth(), CheckForImmediateInvocation(), checkFormatStringExpr(), clang::checkGenericCastToPtr(), CheckImplicitConversion(), CheckMissingFormatAttribute(), CheckMultiVersionAdditionalDecl(), CheckMultiVersionAdditionalRules(), CheckMultiVersionFunction(), CheckMultiVersionValue(), checkNoThrow(), CheckObjCDictionaryLiteralDuplicateKeys(), checkObjCMethodX86VectorTypes(), checkObjCPointerTypesForAssignment(), checkOpenMPLoop(), CheckOriginalCallArgDeduction(), CheckOverload(), CheckOverridingFunctionReturnType(), checkPointerTypesForAssignment(), CheckRedeclarationModuleOwnership(), checkSizelessVectorShift(), CheckStaticArrayArgument(), CheckStaticLocalForDllExport(), CheckTemplateParameterList(), CheckUnicodeArithmeticConversions(), CheckVariableDeclarationType(), CheckVarOrConceptTemplateTemplateId(), CheckVectorSelect(), CheckWaveActive(), compareEnableIfAttrs(), CompareReferenceRelationship(), CompareStandardConversionSequences(), clang::ConversionFixItGenerator::compareTypesSimple(), constructBufferConceptDecl(), clang::hlsl::TemplateParameterListBuilder::constructConceptSpecializationExpr(), constructStructuredBufferConstraintExpr(), constructTypedBufferConstraintExpr(), convertHalfVecBinOp(), CreateBuiltinArraySubscriptExpr(), createFieldForHostLayoutStruct(), clang::CreateHLSLAttributedResourceType(), createHostLayoutStruct(), createHostLayoutStructForBuffer(), createImplicitModuleImportForErrorRecovery(), clang::CodeCompleteConsumer::OverloadCandidate::CreateSignatureString(), clang::CStyleCastPtrExpr(), clang::CStyleCastPtrExpr(), DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), DeduceAutoType(), deduceClosureReturnType(), DeduceFromInitializerList(), deduceOpenCLPointeeAddrSpace(), DeduceTemplateArguments(), DeduceTemplateArgumentsByTypeMatch(), DeduceTemplateSpecializationFromInitializer(), DetectPrecisionLossInComplexDivision(), clang::InitializationSequence::Diagnose(), DiagnoseBadConversion(), DiagnoseImpCast(), DiagnoseInvalidExplicitObjectParameterInLambda(), DiagnoseLocalRegisterBinding(), diagnoseMissingImport(), DiagnoseMixedUnicodeImplicitConversion(), DiagnoseNarrowingInInitList(), diagnoseObjCLiteralComparison(), diagnoseRepeatedUseOfWeak(), diagnoseUnavailableAlignedAllocation(), DoEmitAvailabilityWarning(), emitBadConversionNotes(), emitReadOnlyPlacementAttrWarning(), clang::PreferredTypeBuilder::enterCondition(), clang::PreferredTypeBuilder::enterSubscript(), EvaluateAndDiagnoseImmediateInvocation(), EvaluateAsStringImpl(), EvaluateSizeTTypeTrait(), FinalizeVarWithDestructor(), FindCompositePointerType(), findOMPAllocatorHandleT(), FixDependencyOfIdExpressionsInLambdaWithDependentObjectParameter(), getAllocatorKind(), GetDecompositionElementCount(), getDefaultCXXMethodAddrSpace(), getEmissionStatus(), GetExplicitObjectExpr(), getHostLayoutStructName(), getImplicitCodeSegAttrFromClass(), getImplicitCodeSegOrSectionAttrForFunction(), getMoreSpecialized(), getOpenCLKernelParameterType(), getParallelRegionParams(), getPreferredTypeOfBinaryRHS(), getPreferredTypeOfUnaryArg(), getTargetRegionParams(), getTaskloopRegionParams(), getTaskRegionParams(), handleDeviceKernelAttr(), handleFloatVectorBinOpConversion(), handleIntegerVectorBinOpConversion(), handleLoopHintAttr(), handleMIGServerRoutineAttr(), handleNakedAttr(), handlePackedAttr(), handlerCanCatch(), clang::hlsl::HandleRootSignatureTarget(), handleVecTypeHint(), hasNewExtendedAlignment(), hasUserDefinedMapper(), clang::InitializationSequence::InitializeFrom(), instantiateDependentAllocAlignAttr(), instantiateDependentDiagnoseIfAttr(), instantiateDependentEnableIfAttr(), instantiateDependentHLSLParamModifierAttr(), instantiateDependentMallocSpanAttr(), instantiateDependentOpenACCRoutineDeclAttr(), instantiateDependentReqdWorkGroupSizeAttr(), instantiateDependentSYCLKernelAttr(), instantiateOMPDeclareVariantAttr(), InstantiateVariableDefinition(), InstantiateVariableInitializer(), clang::isBetterOverloadCandidate(), isConstNotMutableType(), IsCXXTriviallyRelocatableType(), IsCXXTriviallyRelocatableType(), IsLayoutCompatible(), isMacroDefined(), isObjCPointerConversion(), IsPointerInterconvertibleBaseOf(), IsQualificationConversion(), IsRedefinitionInModule(), IsStandardConversion(), isTriviallyEqualityComparableType(), IsTriviallyRelocatableType(), IsVectorConversion(), LookupSpecialMemberFromXValue(), makeClusterDimsArgExpr(), mapCodeCompletionContext(), MarkFunctionReferenced(), markUsedForAliasOrIfunc(), MarkVarDeclODRUsed(), mergeEnforceTCBAttrImpl(), MergeFunctionDecl(), mergeParamDeclTypes(), clang::ParseAST(), parseOpenMPReductionId(), PerformImplicitConversion(), PerformPendingInstantiations(), ProcessAPINotes(), processCapturedRegions(), clang::processConstant32BitIntArgument(), propagateDLLAttrToBaseClassTemplate(), rejectConstNotMutableType(), repeatForLambdaConversionFunctionCallingConvs(), reportOriginalDsa(), sameFunctionParameterTypeLists(), setPrototype(), ShouldDiagnoseAvailabilityInContext(), ShouldDiagnoseAvailabilityOfDecl(), tryGCCVectorConvertAndSplat(), TryObjectArgumentInitialization(), TryOCLZeroOpaqueTypeInitialization(), TryOrBuildParenListInitialization(), TryReferenceInit(), TryReferenceInitializationCore(), TryReferenceListInitialization(), updateAttrsForLateParsedTemplate(), validatePackoffset(), and VerifyBitField().

◆ getAsTemplateNameDecl()

NamedDecl * Sema::getAsTemplateNameDecl ( NamedDecl * D,
bool AllowFunctionTemplates = true,
bool AllowDependent = true )
static

Try to interpret the lookup result D as a template-name.

Determine whether the declaration found is acceptable as the name of a template and, if so, return that template declaration.

Parameters
DA declaration found by name lookup.
AllowFunctionTemplatesWhether function templates should be considered valid results.
AllowDependentWhether unresolved using declarations (that might name templates) should be considered valid results.

Otherwise, returns null.

Note that this may return an UnresolvedUsingValueDecl if AllowDependent is true. In all other cases it will return a TemplateDecl (or null).

Definition at line 106 of file SemaTemplate.cpp.

References clang::cast(), clang::NamedDecl::getUnderlyingDecl(), and clang::isa().

Referenced by ClassifyName(), diagnoseExprIntendedAsTemplateName(), FilterAcceptableTemplateNames(), hasAnyAcceptableTemplateNames(), isTemplateName(), LookupQualifiedName(), and LookupTemplateName().

◆ getASTMutationListener()

◆ getAttrLoc() [1/2]

SourceLocation Sema::getAttrLoc ( const AttributeCommonInfo & CI)

Definition at line 91 of file SemaDeclAttr.cpp.

References clang::AttributeCommonInfo::getLoc().

◆ getAttrLoc() [2/2]

template<typename AttrInfo>
std::enable_if_t< std::is_base_of_v< Attr, AttrInfo >, SourceLocation > clang::Sema::getAttrLoc ( const AttrInfo & AL)
inlinestatic

A helper function to provide Attribute Location for the Attr types AND the ParsedAttr.

Definition at line 4849 of file Sema.h.

Referenced by checkFunctionOrMethodParameterIndex(), checkUInt32Argument(), and handlePatchableFunctionEntryAttr().

◆ getCallingConvAttributedType()

const AttributedType * Sema::getCallingConvAttributedType ( QualType T) const

Get the outermost AttributedType node that sets a calling convention.

Valid types should not have multiple attributes with different CCs.

Definition at line 3564 of file SemaDecl.cpp.

References clang::T.

Referenced by handleFunctionTypeAttr(), and MergeFunctionDecl().

◆ getCapturedDeclRefType()

QualType Sema::getCapturedDeclRefType ( ValueDecl * Var,
SourceLocation Loc )

Given a variable, determine the type that a reference to that variable will have in the given scope.

Definition at line 19764 of file SemaExpr.cpp.

References clang::Implicit, and tryCaptureVariable().

Referenced by BuildDeclarationNameExpr(), and getDecltypeForExpr().

◆ getCompletedType()

QualType Sema::getCompletedType ( Expr * E)

Get the type of expression E, triggering instantiation to complete the type if necessary – that is, if the expression refers to a templated static data member of incomplete array type.

May still return an incomplete type if instantiation was not possible or if the type is incomplete for a different reason. Use RequireCompleteExprType instead if a diagnostic is expected for an incomplete expression type.

Definition at line 9225 of file SemaType.cpp.

References completeExprArrayBound(), clang::Expr::getType(), and clang::Type::isIncompleteArrayType().

Referenced by AdjustFunctionParmAndArgTypesForDeduction(), DoMarkVarDeclReferenced(), RequireCompleteExprType(), TryReferenceInitialization(), and TryReferenceListInitialization().

◆ getConstructorName()

◆ getCopyElisionCandidate()

const VarDecl * Sema::getCopyElisionCandidate ( NamedReturnInfo & Info,
QualType ReturnType )

Updates given NamedReturnInfo's move-eligible and copy-elidable statuses, considering the function return type criteria as applicable to return statements.

Parameters
InfoThe NamedReturnInfo object to update.
ReturnTypeThis is the return type of the function.
Returns
The copy elision candidate, in case the initial return expression was copy elidable, or nullptr otherwise.

Definition at line 3485 of file SemaStmt.cpp.

References clang::Sema::NamedReturnInfo::Candidate, Context, clang::ValueDecl::getType(), clang::Type::getTypeClass(), clang::Type::isCanonicalUnqualified(), clang::Sema::NamedReturnInfo::isCopyElidable(), clang::Type::isDependentType(), clang::Type::isRecordType(), clang::Type::isSpecificBuiltinType(), clang::Sema::NamedReturnInfo::MoveEligible, and clang::Sema::NamedReturnInfo::S.

Referenced by ActOnCapScopeReturnStmt(), and BuildReturnStmt().

◆ getCurBlock()

◆ getCurCapturedRegion()

CapturedRegionScopeInfo * Sema::getCurCapturedRegion ( )

Retrieve the current captured region, if any.

Definition at line 2893 of file Sema.cpp.

References FunctionScopes.

Referenced by checkDeclInTargetContext(), and processCapturedRegions().

◆ getCurCompoundScope()

sema::CompoundScopeInfo & Sema::getCurCompoundScope ( ) const

◆ getCurFPFeatures()

◆ getCurFunction()

◆ getCurFunctionAvailabilityContext()

FunctionScopeInfo * Sema::getCurFunctionAvailabilityContext ( )

Retrieve the current function, if any, that should be analyzed for potential availability violations.

Definition at line 1109 of file SemaAvailability.cpp.

References FunctionScopes.

Referenced by DiagnoseAvailabilityOfDecl().

◆ getCurFunctionDecl()

FunctionDecl * Sema::getCurFunctionDecl ( bool AllowLambda = false) const

Returns a pointer to the innermost enclosing function, or nullptr if the current context is not inside a function.

getCurFunctionDecl - If inside of a function body, this returns a pointer to the function decl for the function being parsed.

If AllowLambda is true, this can return the call operator of an enclosing lambda, otherwise lambdas are skipped when looking for an enclosing function.

If we're currently in a 'block', this returns the containing context.

Definition at line 1660 of file Sema.cpp.

References getFunctionLevelDeclContext().

Referenced by ActOnFinishFunctionBody(), ActOnStartOfFunctionDef(), ActOnVariableDeclarator(), AddMethodCandidate(), AddOverloadCandidate(), BuildMemberReferenceExpr(), BuildResolvedCallExpr(), BuildReturnStmt(), BuildUnresolvedCoawaitExpr(), CheckVariableDeclarationType(), checkVAStartABI(), DiagnoseBadTarget(), diagnoseUseOfInternalDeclInInlineFunction(), diagnoseZeroToNullptrConversion(), DoEmitAvailabilityWarning(), FindAllocationFunctions(), getSelfAssignmentClassMemberCandidate(), clang::isBetterOverloadCandidate(), isOpenMPCapturedRegionInArmSMEFunction(), IsSimplyAccessible(), isUsualDeallocationFunction(), LookupMemberExpr(), resolveAddressOfSingleOverloadCandidate(), and targetDiag().

◆ getCurFunctionOrMethodDecl()

NamedDecl * Sema::getCurFunctionOrMethodDecl ( ) const

getCurFunctionOrMethodDecl - Return the Decl for the current ObjC method or C function we're in, otherwise return null.

If we're currently in a 'block', this returns the containing context.

Definition at line 1672 of file Sema.cpp.

References clang::cast(), getFunctionLevelDeclContext(), and clang::isa().

Referenced by AddKeywordsToConsumer(), BuildReturnStmt(), CheckTCBEnforcement(), and handleInitPriorityAttr().

◆ getCurGenericLambda()

LambdaScopeInfo * Sema::getCurGenericLambda ( )

Retrieve the current generic lambda info, if any.

Definition at line 2589 of file Sema.cpp.

References getCurLambda().

Referenced by clang::getStackIndexOfNearestEnclosingCaptureCapableLambda().

◆ getCurLambda()

◆ getCurLexicalContext()

DeclContext * clang::Sema::getCurLexicalContext ( ) const
inline

◆ getCurMethodDecl()

ObjCMethodDecl * Sema::getCurMethodDecl ( )

◆ getCurrentClass()

CXXRecordDecl * Sema::getCurrentClass ( Scope * S,
const CXXScopeSpec * SS )

Get the class that is directly named by the current context.

This is the class for which an unqualified-id in this scope could name a constructor or destructor.

If the scope specifier denotes a class, this will be that class. If the scope specifier is empty, this will be the class whose member-specification we are currently within. Otherwise, there is no such class.

Definition at line 2691 of file SemaDeclCXX.cpp.

References computeDeclContext(), clang::CPlusPlus, CurContext, getLangOpts(), clang::CXXScopeSpec::isInvalid(), and clang::CXXScopeSpec::isNotEmpty().

Referenced by getConstructorName(), and isCurrentClassName().

◆ getCurrentInstantiationOf()

CXXRecordDecl * Sema::getCurrentInstantiationOf ( NestedNameSpecifier NNS)

If the given nested name specifier refers to the current instantiation, return the declaration that corresponds to that current instantiation (C++0x [temp.dep.type]p1).

Parameters
NNSa dependent nested name specifier.

Definition at line 158 of file SemaCXXScopeSpec.cpp.

References clang::CPlusPlus, CurContext, clang::NestedNameSpecifier::getAsType(), clang::NestedNameSpecifier::getKind(), getLangOpts(), clang::NestedNameSpecifier::isDependent(), clang::T, and clang::NestedNameSpecifier::Type.

Referenced by computeDeclContext().

◆ getCurrentMangleNumberContext()

std::tuple< MangleNumberingContext *, Decl * > Sema::getCurrentMangleNumberContext ( const DeclContext * DC)

Compute the mangling number context for a lambda expression or block literal.

Also return the extra mangling decl if any.

Parameters
DC- The DeclContext containing the lambda expression or block literal.

Definition at line 279 of file SemaLambda.cpp.

References clang::cast(), Concept, Context, CurContext, DefaultArgument, ExprEvalContexts, clang::DeclContext::getLexicalParent(), clang::DeclContext::getParent(), inTemplateInstantiation(), clang::isa(), isInInlineFunction(), clang::ASTContext::NeedExtraManglingDecl, and Normal.

Referenced by ActOnBlockStart(), ActOnVariableDeclarator(), BuildAnonymousStructOrUnion(), handleLambdaNumbering(), and handleTagNumbering().

◆ getCurrentModule()

◆ getCurrentThisType()

◆ getCurScope()

Scope * clang::Sema::getCurScope ( ) const
inline

◆ getDarwinSDKInfoForAvailabilityChecking() [1/2]

DarwinSDKInfo * Sema::getDarwinSDKInfoForAvailabilityChecking ( )

Definition at line 123 of file Sema.cpp.

References clang::parseDarwinSDKInfo(), and PP.

Referenced by getDarwinSDKInfoForAvailabilityChecking().

◆ getDarwinSDKInfoForAvailabilityChecking() [2/2]

DarwinSDKInfo * Sema::getDarwinSDKInfoForAvailabilityChecking ( SourceLocation Loc,
StringRef Platform )

◆ getDecltypeForExpr()

QualType Sema::getDecltypeForExpr ( Expr * E)

getDecltypeForExpr - Given an expr, will return the decltype for that expression, according to the rules in C++11 [dcl.type.simple]p4 and C++11 [expr.lambda.prim]p18.

Definition at line 9749 of file SemaType.cpp.

References Context, getCapturedDeclRefType(), getCurLambda(), clang::ValueDecl::getType(), clang::Expr::IgnoreParens(), clang::isa(), clang::Expr::isInstantiationDependent(), clang::Expr::isTypeDependent(), and clang::T.

Referenced by BuildDecltypeType(), and DeduceAutoType().

◆ GetDecompositionElementCount()

◆ getDefaultCXXMethodAddrSpace()

◆ getDefaultDiagFunc()

auto clang::Sema::getDefaultDiagFunc ( )
inline

◆ getDefaultedComparisonKind()

DefaultedComparisonKind clang::Sema::getDefaultedComparisonKind ( const FunctionDecl * FD)
inline

◆ getDefaultedFunctionKind()

◆ getDestructorName()

◆ getDestructorTypeForDecltype()

◆ getDiagnostics()

◆ getEmissionStatus()

◆ getEnclosingFunction()

FunctionScopeInfo * Sema::getEnclosingFunction ( ) const

Definition at line 2534 of file Sema.cpp.

References FunctionScopes, and clang::isa().

◆ getEnclosingLambdaOrBlock()

CapturingScopeInfo * Sema::getEnclosingLambdaOrBlock ( ) const

Get the innermost lambda or block enclosing the current location, if any.

This looks through intervening non-lambda, non-block scopes such as local functions.

Definition at line 2546 of file Sema.cpp.

References CodeSynthesisContexts, CurContext, and FunctionScopes.

Referenced by ActOnNonTypeTemplateParameter(), ActOnTemplateTemplateParameter(), ActOnTypeParameter(), CheckParameter(), DiagnoseUnexpandedParameterPack(), and DiagnoseUnexpandedParameterPacks().

◆ getExprRange()

SourceRange Sema::getExprRange ( Expr * E) const

Definition at line 507 of file SemaExpr.cpp.

References clang::Stmt::getSourceRange().

◆ getExternalSource()

ExternalSemaSource * clang::Sema::getExternalSource ( ) const
inline

Definition at line 930 of file Sema.h.

References ExternalSource.

Referenced by AddClassMessageCompletions(), and CheckExtVectorComponent().

◆ getFixItZeroInitializerForType()

std::string Sema::getFixItZeroInitializerForType ( QualType T,
SourceLocation Loc ) const

◆ getFixItZeroLiteralForType()

std::string Sema::getFixItZeroLiteralForType ( QualType T,
SourceLocation Loc ) const

Definition at line 223 of file SemaFixItUtils.cpp.

References getScalarZeroExpressionForType(), and clang::T.

Referenced by DiagnoseNullConversion().

◆ getFormatStringInfo() [1/2]

bool Sema::getFormatStringInfo ( const Decl * Function,
unsigned FormatIdx,
unsigned FirstArg,
FormatStringInfo * FSI )
static

Given a function and its FormatAttr or FormatMatchesAttr info, attempts to populate the FormatStringInfo parameter with the attribute's correct format_idx and firstDataArg.

Returns true when the format fits the function and the FormatStringInfo has been populated.

Definition at line 3769 of file SemaChecking.cpp.

References clang::cast(), getFormatStringInfo(), clang::Decl::getFunctionType(), and clang::hasImplicitObjectParameter().

Referenced by checkFormatStringExpr(), and getFormatStringInfo().

◆ getFormatStringInfo() [2/2]

bool Sema::getFormatStringInfo ( unsigned FormatIdx,
unsigned FirstArg,
bool HasImplicitThisParam,
bool IsVariadic,
FormatStringInfo * FSI )
static

◆ GetFormatStringType() [1/3]

FormatStringType Sema::GetFormatStringType ( const FormatAttr * Format)
static

Definition at line 7207 of file SemaChecking.cpp.

References GetFormatStringType().

◆ GetFormatStringType() [2/3]

FormatStringType Sema::GetFormatStringType ( const FormatMatchesAttr * Format)
static

Definition at line 7211 of file SemaChecking.cpp.

References GetFormatStringType().

◆ GetFormatStringType() [3/3]

◆ GetFormatStringTypeName()

StringRef Sema::GetFormatStringTypeName ( FormatStringType FST)
static

◆ getFullyPackExpandedSize()

◆ getFunctionLevelDeclContext()

◆ getFunctionScopes()

ArrayRef< sema::FunctionScopeInfo * > clang::Sema::getFunctionScopes ( ) const
inline

Definition at line 11380 of file Sema.h.

References FunctionScopes, and FunctionScopesStart.

Referenced by getTemplateDepth().

◆ getIdentityTemplateArgumentLoc()

TemplateArgumentLoc Sema::getIdentityTemplateArgumentLoc ( NamedDecl * Param,
SourceLocation Location )

Get a template argument mapping the given template parameter to itself, e.g.

for X in template<int X>, this would return an expression template argument referencing X.

Definition at line 2927 of file SemaTemplateDeduction.cpp.

References Context, and getTrivialTemplateArgumentLoc().

◆ getImplicitCodeSegOrSectionAttrForFunction()

Attr * Sema::getImplicitCodeSegOrSectionAttrForFunction ( const FunctionDecl * FD,
bool IsDefinition )

Returns an implicit CodeSegAttr if a __declspec(code_seg) is found on a containing class.

Otherwise it will return implicit SectionAttr if the function is a definition and there is an active value on CodeSegStack (from the current #pragma code-seg value).

Parameters
FDFunction being declared.
IsDefinitionWhether it is a definition or just a declaration.
Returns
A CodeSegAttr or SectionAttr to apply to the function or nullptr if no attribute should be added.

Definition at line 11300 of file SemaDecl.cpp.

References CodeSegStack, getASTContext(), getImplicitCodeSegAttrFromClass(), and clang::Decl::hasAttr().

Referenced by ActOnFunctionDeclarator(), ActOnStartOfLambdaDefinition(), and checkClassLevelCodeSegAttribute().

◆ getInheritingConstructorName()

ParsedType Sema::getInheritingConstructorName ( CXXScopeSpec & SS,
SourceLocation NameLoc,
const IdentifierInfo & Name )

Handle the result of the special case name lookup for inheriting constructor declarations.

'NS::X::X' and 'NS::X<...>::X' are treated as constructor names in member using declarations, even if 'X' is not the name of the corresponding type.

Definition at line 57 of file SemaExprCXX.cpp.

References Context, CreateParsedType(), clang::NestedNameSpecifier::getAsType(), clang::CXXScopeSpec::getScopeRep(), and clang::Type.

◆ getInventedParameterInfos()

ArrayRef< InventedTemplateParameterInfo > clang::Sema::getInventedParameterInfos ( ) const
inline

Definition at line 11374 of file Sema.h.

References InventedParameterInfos, and InventedParameterInfosStart.

Referenced by getTemplateDepth().

◆ getLambdaConversionFunctionResultType()

◆ getLangOpts()

const LangOptions & clang::Sema::getLangOpts ( ) const
inline

Definition at line 920 of file Sema.h.

References LangOpts.

Referenced by ActOnAnnotModuleBegin(), ActOnAnnotModuleEnd(), ActOnArraySubscriptExpr(), ActOnBlockArguments(), ActOnBlockStmtExpr(), ActOnCapScopeReturnStmt(), ActOnCaseExpr(), ActOnCastExpr(), ActOnCharacterConstant(), ActOnCompoundStmt(), ActOnConditionalOp(), ActOnCXXAssumeAttr(), ActOnCXXDelete(), ActOnCXXMemberDeclarator(), ActOnCXXNamedCast(), ActOnCXXNestedNameSpecifierDecltype(), ActOnCXXNew(), ActOnCXXTryBlock(), ActOnCXXTypeid(), ActOnDecltypeExpression(), ActOnDecompositionDeclarator(), ActOnDependentMemberExpr(), ActOnDoStmt(), ActOnEndOfTranslationUnit(), ActOnEnumBody(), ActOnEnumConstant(), ActOnExplicitInstantiation(), ActOnFields(), ActOnFinishFullExpr(), ActOnFinishFunctionBody(), ActOnFinishKNRParamDeclarations(), ActOnFinishLinkageSpecification(), ActOnForEachDeclStmt(), ActOnForStmt(), ActOnFriendFunctionDecl(), ActOnFriendTypeDecl(), ActOnFunctionDeclarator(), ActOnIdExpression(), ActOnIfStmt(), ActOnInitList(), ActOnLabelStmt(), ActOnLambdaExpressionAfterIntroducer(), ActOnMemberAccessExpr(), ActOnModuleDecl(), ActOnModuleImport(), ActOnModuleImport(), ActOnMSVCUnknownTypeName(), ActOnNameClassifiedAsUndeclaredNonType(), ActOnNumericConstant(), actOnOMPReductionKindClause(), ActOnPackIndexingExpr(), ActOnPackIndexingType(), ActOnParamDeclarator(), ActOnParamDefaultArgument(), ActOnParenExpr(), ActOnPopScope(), ActOnPragmaCXLimitedRange(), ActOnPragmaFEnvAccess(), ActOnPragmaFEnvRound(), ActOnPragmaFloatControl(), ActOnPragmaFPContract(), ActOnPragmaFPEvalMethod(), ActOnPragmaFPValueChangingOption(), ActOnPragmaMSAllocText(), ActOnPragmaOptionsAlign(), ActOnPragmaPack(), ActOnSEHTryBlock(), ActOnStartCXXMemberReference(), ActOnStartExportDecl(), ActOnStartLinkageSpecification(), ActOnStartOfFunctionDef(), ActOnStartOfLambdaDefinition(), ActOnStartOfTranslationUnit(), ActOnStringLiteral(), ActOnTag(), ActOnTemplateIdType(), ActOnTemplateName(), ActOnTemplateTypeArgument(), ActOnTypedefDeclarator(), ActOnTypeName(), ActOnTypenameType(), ActOnUnevaluatedStringLiteral(), ActOnUninitializedDecl(), ActOnUsingDeclaration(), ActOnVariableDeclarator(), AddAlignmentAttributesForRecord(), AddBuiltinCandidate(), AddConversionCandidate(), addFixitForObjCARCConversion(), addFunctionPointerConversion(), AddImplicitlyDeclaredMembersToClass(), AddInitializerToDecl(), AddKeywordsToConsumer(), AddKnownFunctionAttributes(), AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction(), AddMethodCandidate(), AddMethodTemplateCandidate(), AddModeAttr(), AddMsStructLayoutForRecord(), AddOrdinaryNameResults(), AddOverloadCandidate(), AddRecordMembersCompletionResults(), AddSurrogateCandidate(), AddTemplateConversionCandidate(), AddTemplateOverloadCandidate(), AdjustDestructorExceptionSpec(), AdjustFunctionParmAndArgTypesForDeduction(), AnalyzeBitFieldAssignment(), AnalyzeComparison(), AnalyzeImplicitConversions(), clang::OverloadCandidateSet::BestViableFunction(), BuildAnonymousStructOrUnion(), BuildArrayType(), BuildAtomicType(), BuildBinOp(), BuildBlockPointerType(), BuildCallExpr(), BuildCallToMemberFunction(), buildCapture(), buildCaptureDecl(), buildCapturedStmtCaptureList(), BuildCompoundLiteralExpr(), BuildConvertedConstantExpression(), BuildCStyleCastExpr(), BuildCXXConstructExpr(), BuildCXXForRangeStmt(), BuildCXXNamedCast(), BuildCXXNestedNameSpecifier(), BuildCXXNew(), BuildCXXThrow(), BuildCXXTypeConstructExpr(), BuildDeclarationNameExpr(), buildDeclareReductionRef(), BuildDeclRefExpr(), BuildExceptionDeclaration(), BuildExpressionFromIntegralTemplateArgumentValue(), BuildExtVectorType(), BuildFieldReferenceExpr(), BuildFunctionType(), BuildImplicitMemberExpr(), buildLambdaCaptureFixit(), BuildLambdaExpr(), buildLambdaInitCaptureInitialization(), buildLambdaThisCaptureFixit(), BuildMatrixType(), BuildMemberPointerType(), BuildMemberReferenceExpr(), BuildMemInitializer(), BuildModuleInclude(), buildOverloadedCallSet(), BuildPointerType(), BuildPredefinedExpr(), BuildPseudoDestructorExpr(), BuildQualifiedDeclarationNameExpr(), BuildQualifiedType(), BuildRecoveryCallExpr(), BuildReferenceType(), BuildResolvedCallExpr(), BuildReturnStmt(), buildSingleCopyAssignRecursively(), BuildStaticAssertDeclaration(), BuildTypeofExprType(), BuildUnaryOp(), buildUserDefinedMapperRef(), BuildUsingDeclaration(), BuildVAArgExpr(), BuildVectorLiteral(), BuiltinDumpStruct(), BuiltinOverflow(), canCalleeThrow(), canPassInRegisters(), CanUseDecl(), captureInBlock(), captureInCapturedRegion(), CheckAdditionOperands(), CheckAddressOfMemberAccess(), CheckAddressOfOperand(), checkAllocateClauses(), CheckAllocatedType(), CheckAllocationAccess(), CheckAltivecInitFromScalar(), CheckAnonMemberRedeclaration(), checkARCPropertyImpl(), checkArithmeticBinOpPointerOperands(), checkArithmeticOpPointerOperand(), checkArraySize(), CheckAssignmentConstraints(), CheckAssignmentOperands(), CheckBaseSpecifier(), CheckBitwiseOperands(), checkBlockPointerTypesForAssignment(), CheckBooleanCondition(), CheckBoolLikeConversion(), CheckC23ConstexprInitConversion(), CheckC23ConstexprInitStringLiteral(), checkCall(), checkCancelRegion(), checkCaseValue(), checkClassLevelDLLAttribute(), CheckCommaOperands(), CheckCompareOperands(), CheckComparisonCategoryType(), CheckCompletedCXXClass(), CheckCompleteVariableDeclaration(), checkCondition(), CheckConditionalOperand(), CheckConditionalOperands(), checkConditionalPointerCompatibility(), CheckConstexprCtorInitializer(), CheckConstexprDeclStmt(), CheckConstexprDestructorSubobjects(), CheckConstexprFunctionBody(), CheckConstexprFunctionDefinition(), CheckConstexprFunctionStmt(), CheckConstexprMissingReturn(), CheckConstexprParameterTypes(), CheckConstexprReturnType(), CheckConstraintExpression(), CheckConstructorAccess(), CheckConstructorAccess(), CheckConversionDeclarator(), CheckCountedByAttrOnField(), CheckCXX2CRelocatable(), CheckCXX98CompatAccessibleCopy(), CheckCXXThrowOperand(), CheckDerivedToBaseConversion(), CheckDestructorAccess(), CheckDistantExceptionSpec(), CheckEffectiveAccess(), checkEnumArithmeticConversions(), CheckEnumConstant(), CheckEquivalentExceptionSpec(), CheckEquivalentExceptionSpec(), CheckEquivalentExceptionSpec(), clang::CheckEquivalentExceptionSpecImpl(), checkEscapingByref(), CheckExceptionSpecCompatibility(), CheckExceptionSpecSubset(), CheckExplicitInstantiationScope(), CheckExplicitlyDefaultedComparison(), CheckExplicitlyDefaultedSpecialMember(), CheckExplicitObjectParameter(), checkExportedDecl(), clang::sema::checkExprLifetimeImpl(), CheckExtVectorCast(), CheckExtVectorComponent(), CheckFieldDecl(), checkForConflictWithNonVisibleExternC(), CheckForFunctionRedefinition(), CheckFormatString(), CheckForModifiableLvalue(), CheckFriendAccess(), CheckFunctionCall(), CheckFunctionDeclaration(), CheckFunctionOrTemplateParamDeclarator(), CheckFunctionReturnType(), CheckFunctionTemplateSpecialization(), checkGenericLoopLastprivate(), checkGlobalOrExternCConflict(), checkIfClauses(), CheckImmediateEscalatingFunctionDefinition(), CheckImplicitConversion(), CheckIncrementDecrementOperand(), checkIndirectCopyRestoreSource(), CheckIndirectionOperand(), CheckLiteralOperatorDeclaration(), checkLiteralOperatorTemplateParameterList(), CheckLogicalOperands(), CheckLookupAccess(), CheckMain(), checkMapClauseExpressionBase(), CheckMatrixLogicalOperands(), CheckMemaccessSize(), CheckMemberAccess(), CheckMemberOperatorAccess(), CheckMissingFormatAttribute(), CheckMultiplyDivideOperands(), checkNestingOfRegions(), checkNewAttributesAfterDef(), CheckNonDependentConversions(), CheckNontrivialField(), CheckNonTypeTemplateParameterType(), CheckObjCCollectionLiteralElement(), checkObjCPointerIntrospection(), checkOpenMPIterationSpace(), checkOpenMPLoop(), CheckOperatorNewDeleteTypes(), CheckOriginalCallArgDeduction(), CheckOverridingFunctionExceptionSpec(), CheckParameter(), CheckParmsForFunctionDef(), CheckPlaceholderExpr(), checkPointerAuthEnabled(), CheckPointerConversion(), CheckPointerToMemberOperands(), checkPointerTypesForAssignment(), CheckProtocolMethodDefs(), CheckRemainderOperands(), checkSectionsDirective(), CheckShadow(), CheckShadowingDeclModification(), CheckSimplerImplicitMovesMSVCWorkaround(), CheckSingleAssignmentConstraints(), CheckSpecializationInstantiationRedecl(), checkSpecializationReachability(), checkSpecializationVisibility(), CheckSpecifiedExceptionType(), CheckStaticArrayArgument(), CheckStringInit(), CheckStructuredBindingMemberAccess(), CheckSubtractionOperands(), CheckTautologicalComparison(), CheckTemplateArgument(), CheckTemplateArgument(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateSpecializationScope(), CheckTemplateTypeArgument(), CheckTypenameType(), CheckUnaryExprOrTypeTraitOperand(), checkUndefinedButUsed(), CheckUnicodeArithmeticConversions(), CheckUnresolvedLookupAccess(), CheckUnresolvedMemberAccess(), CheckUnusedVolatileAssignment(), CheckUsingDeclQualifier(), CheckUsingShadowDecl(), CheckVariableDeclarationType(), checkVariadicArgument(), CheckVectorCompareOperands(), CheckVectorLogicalOperands(), CheckVectorOperands(), ClassifyImplicitMemberAccess(), ClassifyName(), compareConversionFunctions(), CompareImplicitConversionSequences(), CompareStandardConversionSequences(), completeFunctionType(), CompleteNonViableCandidate(), CompleteVarTemplateSpecializationDecl(), ConvertDeclSpecToType(), ConvertDeducedTemplateArguments(), CreateBuiltin(), CreateBuiltinArraySubscriptExpr(), CreateBuiltinBinOp(), CreateBuiltinUnaryOp(), CreateCapturedStmtRecordDecl(), createImplicitModuleImportForErrorRecovery(), CreateNewFunctionDecl(), CreateOverloadedBinOp(), DeclareGlobalAllocationFunction(), DeclareGlobalNewDelete(), DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitMemberFunctionsWithName(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), DeduceAutoType(), deduceClosureReturnType(), DeduceFunctionTypeFromReturnExpr(), DeduceNonTypeTemplateArgument(), deduceOpenCLAddressSpace(), deducePropertyOwnershipFromType(), DeduceTemplateArguments(), DeduceTemplateArgumentsByTypeMatch(), DeduceTemplateSpecializationFromInitializer(), DeduceVariableDeclarationType(), deduceVarTypeFromInitializer(), DefaultArgumentPromotion(), defaultedSpecialMemberIsConstexpr(), DefaultFunctionArrayConversion(), DefaultLvalueConversion(), DefaultVariadicArgumentPromotion(), DefineImplicitCopyAssignment(), DefineImplicitCopyConstructor(), DefineImplicitLambdaToBlockPointerConversion(), DefineImplicitMoveAssignment(), DetectPrecisionLossInComplexDivision(), clang::InitializationSequence::Diagnose(), diagnoseArithmeticOnFunctionPointer(), diagnoseArithmeticOnNullPointer(), diagnoseArithmeticOnTwoFunctionPointers(), diagnoseArithmeticOnTwoVoidPointers(), diagnoseArithmeticOnVoidPointer(), DiagnoseAssignmentResult(), DiagnoseBadShiftValues(), DiagnoseBaseOrMemInitializerOrder(), DiagnoseCommaOperator(), DiagnoseDependentMemberLookup(), DiagnoseEmptyLookup(), DiagnoseExceptionUse(), diagnoseExprIntendedAsTemplateName(), clang::ParsedAttr::diagnoseLangOpts(), diagnoseListInit(), DiagnoseMismatchedNewDelete(), diagnoseMissingConstinit(), DiagnoseNarrowingInInitList(), DiagnoseNullConversion(), diagnoseOpenCLTypes(), DiagnoseRetainableFlexibleArrayMember(), DiagnoseSentinelCalls(), diagnoseSubtractionOnNullPointer(), diagnoseTautologicalComparison(), DiagnoseTemplateParameterShadow(), diagnoseTypo(), diagnoseUncapturableValueReferenceOrBinding(), DiagnoseUnknownAttribute(), DiagnoseUnknownTypeName(), DiagnoseUnusedButSetDecl(), DiagnoseUnusedDecl(), DiagnoseUnusedLambdaCapture(), DiagnoseUseOfDecl(), diagnoseUseOfInternalDeclInInlineFunction(), DiagnoseWeakIvars(), diagnoseXorMisusedAsPow(), diagnoseZeroToNullptrConversion(), DiagPlaceholderFieldDeclDefinitions(), DiagPlaceholderVariableDefinition(), DiagRedefinedPlaceholderFieldDecl(), DiagReservedModuleName(), DiagUninitUse(), DoEmitAvailabilityWarning(), EmitDiagForCXXThrowInNonThrowingFunc(), EmitDiagnostic(), emitReplacement(), ExpandFunctionLocalPredefinedMacros(), filterNonConflictingPreviousTypedefDecls(), FinalizeDeclaration(), FinalizeDeclaratorGroup(), FindAllocationFunctions(), FindCompositePointerType(), findDeleteForPromise(), clang::DeclSpec::Finish(), FinishForRangeVarDecl(), FixOverloadedFunctionReference(), ForceDeclarationOfImplicitMembers(), FormatStringHasSArg(), funcHasParameterSizeMangling(), clang::FunctionCallFilterCCC::FunctionCallFilterCCC(), GatherArgumentsForCall(), getCCForDeclaratorChunk(), getCurrentClass(), getCurrentInstantiationOf(), GetDeclSpecTypeForDeclarator(), getDefaultCXXMethodAddrSpace(), getDefaultedFunctionKind(), getDummyLambdaType(), GetFullTypeForDeclarator(), getLambdaType(), getNamedReturnInfo(), getNonFieldDeclScope(), getNonOdrUseReasonInCurrentContext(), getNonTagTypeDeclKind(), getOpenCLKernelParameterType(), getPrivateItem(), getTargetRegionParams(), getTopMostPointOfInstantiation(), GetTypeForDeclarator(), GetTypeForDeclaratorCast(), getTypeName(), GetTypeOfFunction(), getUDSuffixLoc(), GloballyUniqueObjectMightBeAccidentallyDuplicated(), HandleAddressSpaceTypeAttribute(), HandleArmSveVectorBitsTypeAttr(), handleAvailabilityAttr(), handleConstructorAttr(), HandleDeclarator(), handleDelayedForbiddenType(), handleDeprecatedAttr(), handleDeviceKernelAttr(), handleFallThroughAttr(), HandleField(), handleFloatConversion(), handleFunctionTypeAttr(), handleGlobalAttr(), HandleImmediateInvocations(), handleInitPriorityAttr(), handleLambdaNumbering(), handleLikely(), HandleMatrixTypeAttr(), handleMSConstexprAttr(), handleMSConstexprAttr(), HandleMSProperty(), handleNakedAttr(), HandleNeonVectorTypeAttr(), handleNoCfCheckAttr(), handleObjCOwnershipTypeAttr(), HandlePtrAuthQualifier(), HandleRISCVRVVVectorBitsTypeAttr(), handleSharedAttr(), handleStandardNoReturnAttr(), handleTagNumbering(), handleUnlikely(), handleUnusedAttr(), handleVTablePointerAuthentication(), handleWarnUnusedResult(), hasAcceptableDefinition(), HasAccess(), hasNewExtendedAlignment(), hasStructuralCompatLayout(), hasUserDefinedMapper(), IgnoredValueConversions(), ImpCastExprToType(), ImplicitlyDefineFunction(), clang::inferNoReturnAttr(), Initialize(), clang::InitializationSequence::InitializeFrom(), InsertOCLBuiltinDeclarationsFromTable(), InstantiateFunctionDefinition(), InstantiateVariableDefinition(), InstantiateVariableInitializer(), isAbstractType(), isAcceptableTagRedeclContext(), clang::isBetterOverloadCandidate(), IsBlockPointerConversion(), isCapturingReferenceToHostVarInCUDADeviceLambda(), isConstNotMutableType(), IsCppCompatWarning(), isCurrentClassNameTypo(), IsCXX98CompatWarning(), IsDerivedFrom(), IsEnumConstOrFromMacro(), isExternalWithNoLinkageType(), IsFloatingPointPromotion(), isFunctionDefinitionDiscarded(), isIncompleteDeclExternC(), IsIntegralPromotion(), isMainFileLoc(), IsMatrixConversion(), isMemberAccessibleForDeletion(), isNonPlacementDeallocationFunction(), isNullPointerValueTemplateArgument(), isObjCPointerConversion(), isOpenMPCapturedRegionInArmSMEFunction(), IsOverloadOrOverrideImpl(), IsPointerConversion(), isPotentialImplicitMemberAccess(), isReferenceToNonConstCapture(), isResultTypeOrTemplate(), IsSimplyAccessible(), IsStandardConversion(), isStdClassTemplate(), isStdInitializerList(), isStdTypeIdentity(), isTagTypeWithMissingTag(), isTautologicalBoundsCheck(), isTemplateName(), isUnavailableAlignedAllocationFunction(), isUsualDeallocationFunction(), isValidVarArgType(), isVariableCapturable(), IsVectorConversion(), LookupBinOp(), LookupBuiltin(), LookupDirect(), lookupExternCFunctionOrVariable(), LookupInlineAsmField(), LookupMemberExpr(), LookupName(), LookupObjCInterfaceDeclForLiteral(), LookupSpecialMember(), LookupTemplateName(), mapCodeCompletionContext(), MarkDeclRefReferenced(), MarkExpressionAsImmediateEscalating(), MarkExprReferenced(), MarkFunctionReferenced(), MarkMemberReferenced(), MaybeBindToTemporary(), maybeExtendBlockObject(), MaybeProduceObjCObject(), MergeCompatibleFunctionDecls(), MergeCXXFunctionDecl(), mergeDeclAttribute(), MergeFunctionDecl(), mergeInternalLinkageAttr(), mergeInternalLinkageAttr(), MergeTypedefNameDecl(), mergeTypeWithPrevious(), MergeVarDecl(), MergeVarDeclExceptionSpecs(), MergeVarDeclTypes(), mightBeIntendedToBeTemplateName(), NoteFunctionCandidate(), OpenCLCheckVectorConditional(), parseDeclareSimdClauses(), ParsedFreeStandingDeclSpec(), clang::InitializationSequence::Perform(), PerformContextualImplicitConversion(), PerformImplicitConversion(), PerformImplicitConversion(), PerformMoveOrCopyInitialization(), PopExpressionEvaluationContext(), PrintInstantiationStack(), ProcessDeclAttribute(), ProcessDeclAttributeList(), processImplicitMapsWithDefaultMappers(), ProcessPragmaExport(), PushCapturedRegionScope(), PushExpressionEvaluationContextForFunction(), PushOnScopeChains(), RegisterLocallyScopedExternCDecl(), repeatForLambdaConversionFunctionCallingConvs(), reportOriginalDsa(), RequireLiteralType(), RequireStructuralType(), resolveAddressOfSingleOverloadCandidate(), ResolveConstructorOverload(), SelectBestMethod(), Sema(), SetDeclDefaulted(), setExceptionMode(), clang::DeclSpec::SetStorageClassSpec(), setTagNameForLinkagePurposes(), clang::OverloadCandidateSet::shouldDeferDiags(), ShouldDeleteSpecialMember(), ShouldDiagnoseAvailabilityInContext(), shouldIgnoreDueToReservedName(), shouldSkipAnonEnumBody(), ShouldSplatAltivecScalarInCast(), SubstituteExplicitTemplateArguments(), TemporaryMaterializationConversion(), tryCaptureVariable(), TryConstructorInitialization(), TryConstructorOrParenListInitialization(), TryDefaultInitialization(), TryImplicitConversion(), TryListConversion(), TryListInitialization(), tryLookupUnambiguousFieldDecl(), TryNamespaceTypoCorrection(), TryOCLSamplerInitialization(), TryOCLZeroOpaqueTypeInitialization(), TryReferenceInit(), TryReferenceInitializationCore(), TryReferenceListInitialization(), TryUserDefinedConversion(), TryValueInitialization(), tryVectorConvertAndSplat(), UseArgumentDependentLookup(), UsualUnaryFPConversions(), ValidateObjCLiteralInterfaceDecl(), VerifyBitField(), VerifyIntegerConstantExpression(), warnAboutRedundantParens(), warnOnCTypeHiddenInCPlusPlus(), and warnOnReservedIdentifier().

◆ getLocationOfStringLiteralByte()

SourceLocation Sema::getLocationOfStringLiteralByte ( const StringLiteral * SL,
unsigned ByteNo ) const

◆ getLocForEndOfToken()

SourceLocation Sema::getLocForEndOfToken ( SourceLocation Loc,
unsigned Offset = 0 )

Calls Lexer::getLocForEndOfToken()

Definition at line 83 of file Sema.cpp.

References clang::Lexer::getLocForEndOfToken(), LangOpts, and SourceMgr.

Referenced by ActOnCXXDelete(), ActOnFriendTypeDecl(), ActOnFunctionDeclarator(), ActOnLambdaExpressionAfterIntroducer(), addFixitForObjCARCConversion(), BuildLambdaExpr(), BuiltinDumpStruct(), CheckCompletedCXXClass(), CheckConversionDeclarator(), CheckEquivalentExceptionSpec(), CheckExplicitlyDefaultedComparison(), CheckFoldOperand(), CheckFunctionDeclaration(), CheckLogicalOperands(), CheckMain(), CheckMemorySizeofForComparison(), CheckParameter(), checkStringLiteralArgumentAttr(), checkTypeParamListConsistency(), CheckUsingDeclQualifier(), ConstructFixItRangeForUnusedCapture(), CreateBuiltinBinOp(), CreateIfFixit(), clang::InitializationSequence::Diagnose(), DiagnoseAlwaysNonNullPointer(), DiagnoseAssignmentAsCondition(), DiagnoseDirectIsaAccess(), DiagnoseIntInBoolContext(), diagnoseLogicalNotOnLHSofCheck(), DiagnoseMismatchedNewDelete(), DiagnoseNarrowingInInitList(), diagnoseNoViableConversion(), diagnoseObjCARCConversion(), diagnoseObjCLiteralComparison(), DiagnoseSentinelCalls(), diagnoseXorMisusedAsPow(), DoEmitAvailabilityWarning(), clang::DeclSpec::Finish(), fixItNullability(), GetFullTypeForDeclarator(), handleFallThroughAttr(), isNullPointerValueTemplateArgument(), maybeRecoverWithZeroInitialization(), setTagNameForLinkagePurposes(), SuggestInitializationFixit(), clang::ConversionFixItGenerator::tryToFixConversion(), tryToRecoverWithCall(), warnAboutAmbiguousFunction(), and warnAboutRedundantParens().

◆ getLookupModules()

llvm::DenseSet< Module * > & Sema::getLookupModules ( )

Get the set of additional modules that should be checked during name lookup.

A module and its imports become visible when instanting a template defined within it.

Definition at line 1612 of file SemaLookup.cpp.

References CodeSynthesisContextLookupModules, CodeSynthesisContexts, getDefiningModule(), and LookupModulesCache.

Referenced by isModuleVisible().

◆ getMismatchingDeleteExpressions()

const llvm::MapVector< FieldDecl *, Sema::DeleteLocs > & Sema::getMismatchingDeleteExpressions ( ) const

Retrieves list of suspicious delete-expressions that will be checked at the end of translation unit.

Definition at line 2901 of file Sema.cpp.

References DeleteExprs.

◆ getModuleLoader()

ModuleLoader & Sema::getModuleLoader ( ) const

Retrieve the module loader associated with the preprocessor.

Definition at line 109 of file Sema.cpp.

References PP.

Referenced by ActOnModuleDecl(), ActOnModuleImport(), BuildModuleInclude(), and createImplicitModuleImportForErrorRecovery().

◆ getMoreConstrainedFunction()

FunctionDecl * Sema::getMoreConstrainedFunction ( FunctionDecl * FD1,
FunctionDecl * FD2 )

Returns the more constrained function according to the rules of partial ordering by constraints (C++ [temp.constr.order]).

Parameters
FD1the first function
FD2the second function
Returns
the more constrained function. If neither function is more constrained, returns NULL.

Definition at line 6150 of file SemaTemplateDeduction.cpp.

References clang::FunctionDecl::getAssociatedConstraints(), clang::Decl::getDescribedTemplate(), clang::FunctionDecl::getTemplateInstantiationPattern(), clang::isa(), IsAtLeastAsConstrained(), and clang::FunctionDecl::isFunctionTemplateSpecialization().

Referenced by CheckMemberSpecialization(), getMorePartialOrderingConstrained(), and resolveAddressOfSingleOverloadCandidate().

◆ getMoreSpecializedPartialSpecialization() [1/2]

Returns the more specialized class template partial specialization according to the rules of partial ordering of class template partial specializations (C++ [temp.class.order]).

Parameters
PS1the first class template partial specialization
PS2the second class template partial specialization
Returns
the more specialized class template partial specialization. If neither partial specialization is more specialized, returns NULL.

Definition at line 6419 of file SemaTemplateDeduction.cpp.

References Context, clang::ClassTemplatePartialSpecializationDecl::getCanonicalInjectedSpecializationType(), and getMoreSpecialized().

Referenced by CheckVarTemplateId(), and getPatternForClassTemplateSpecialization().

◆ getMoreSpecializedPartialSpecialization() [2/2]

◆ getMoreSpecializedTemplate()

FunctionTemplateDecl * Sema::getMoreSpecializedTemplate ( FunctionTemplateDecl * FT1,
FunctionTemplateDecl * FT2,
SourceLocation Loc,
TemplatePartialOrderingContext TPOC,
unsigned NumCallArguments1,
QualType RawObj1Ty = {},
QualType RawObj2Ty = {},
bool Reversed = false,
bool PartialOverloading = false )

Returns the more specialized function template according to the rules of function template partial ordering (C++ [temp.func.order]).

Parameters
FT1the first function template
FT2the second function template
TPOCthe context in which we are performing partial ordering of function templates.
NumCallArguments1The number of arguments in the call to FT1, used only when TPOC is TPOC_Call. Does not include the object argument when calling a member function.
RawObj1TyThe type of the object parameter of FT1 if a member function only used if TPOC is TPOC_Call and FT1 is a Function template from a member function
RawObj2TyThe type of the object parameter of FT2 if a member function only used if TPOC is TPOC_Call and FT2 is a Function template from a member function
ReversedIf true, exactly one of FT1 and FT2 is an overload candidate with a reversed parameter order. In this case, the corresponding P/A pairs between FT1 and FT2 are reversed.
Returns
the more specialized function template. If neither template is more specialized, returns NULL.

Definition at line 5854 of file SemaTemplateDeduction.cpp.

References clang::Type::castAs(), Context, Equal, clang::TemplateDecl::getAssociatedConstraints(), GetImplicitObjectParameterType(), getMoreSpecializedTrailingPackTieBreaker(), clang::FunctionDecl::getOverloadedOperator(), clang::CXXMethodDecl::getRefQualifier(), clang::FunctionDecl::getReturnType(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::TemplateDecl::getTemplateParameters(), clang::ValueDecl::getType(), clang::FunctionDecl::hasCXXExplicitFunctionObjectParameter(), IsAtLeastAsConstrained(), isAtLeastAsSpecializedAs(), clang::Type::isRValueReferenceType(), clang::CXXMethodDecl::isStatic(), Less, More, clang::OO_None, clang::FunctionDecl::param_size(), clang::FunctionProtoType::param_type_begin(), clang::FunctionProtoType::param_type_end(), clang::FunctionDecl::parameters(), clang::Reversed, clang::RQ_RValue, clang::TemplateParameterList::size(), TemplateParameterListsAreEqual(), TPL_TemplateParamsEquivalent, clang::TPOC_Call, and clang::TPOC_Conversion.

Referenced by getMostSpecialized(), and clang::isBetterOverloadCandidate().

◆ getMostSpecialized()

UnresolvedSetIterator Sema::getMostSpecialized ( UnresolvedSetIterator SBegin,
UnresolvedSetIterator SEnd,
TemplateSpecCandidateSet & FailedCandidates,
SourceLocation Loc,
const PartialDiagnostic & NoneDiag,
const PartialDiagnostic & AmbigDiag,
const PartialDiagnostic & CandidateDiag,
bool Complain = true,
QualType TargetType = QualType() )

Retrieve the most specialized of the given function template specializations.

Parameters
SpecBeginthe start iterator of the function template specializations that we will be comparing.
SpecEndthe end iterator of the function template specializations, paired with SpecBegin.
Locthe location where the ambiguity or no-specializations diagnostic should occur.
NoneDiagpartial diagnostic used to diagnose cases where there are no matching candidates.
AmbigDiagpartial diagnostic used to diagnose an ambiguity, if one occurs.
CandidateDiagpartial diagnostic used for each function template specialization that is a candidate in the ambiguous ordering. One parameter in this diagnostic should be unbound, which will correspond to the string describing the template arguments for the function template specialization.
Returns
the most specialized function template specialization, if found. Otherwise, returns SpecEnd.

Definition at line 6075 of file SemaTemplateDeduction.cpp.

References Ambiguous, clang::cast(), clang::declaresSameEntity(), clang::SemaBase::Diag(), getMoreSpecializedTemplate(), getTemplateArgumentBindingsText(), HandleFunctionTypeMismatch(), clang::QualType::isNull(), clang::TemplateSpecCandidateSet::NoteCandidates(), and clang::TPOC_Other.

Referenced by ActOnExplicitInstantiation(), and CheckFunctionTemplateSpecialization().

◆ getNamedReturnInfo() [1/2]

Sema::NamedReturnInfo Sema::getNamedReturnInfo ( const VarDecl * VD)

Determine whether the given NRVO candidate variable is move-eligible or copy-elidable, without considering function return type.

Parameters
VDThe NRVO candidate variable.
Returns
An aggregate which contains the Candidate and isMoveEligible and isCopyElidable methods. If Candidate is non-null, it means isMoveEligible() would be true under the most permissive language standard.

Definition at line 3433 of file SemaStmt.cpp.

References Context, clang::Decl::getKind(), clang::QualType::getNonReferenceType(), clang::ValueDecl::getType(), clang::Decl::hasAttr(), clang::VarDecl::hasDependentAlignment(), clang::VarDecl::hasLocalStorage(), clang::VarDecl::isExceptionVariable(), clang::Type::isIncompleteType(), clang::Type::isObjectType(), clang::Type::isRValueReferenceType(), clang::QualType::isVolatileQualified(), clang::Sema::NamedReturnInfo::MoveEligible, clang::Sema::NamedReturnInfo::MoveEligibleAndCopyElidable, and clang::Sema::NamedReturnInfo::S.

◆ getNamedReturnInfo() [2/2]

Determine whether the given expression might be move-eligible or copy-elidable in either a (co_)return statement or throw expression, without considering function return type, if applicable.

Parameters
EThe expression being returned from the function or block, being thrown, or being co_returned from a coroutine. This expression might be modified by the implementation.
ModeOverrides detection of current language mode and uses the rules for C++23.
Returns
An aggregate which contains the Candidate and isMoveEligible and isCopyElidable methods. If Candidate is non-null, it means isMoveEligible() would be true under the most permissive language standard.

Definition at line 3407 of file SemaStmt.cpp.

References clang::Sema::NamedReturnInfo::Candidate, clang::Expr::containsErrors(), Context, clang::CPlusPlus23, clang::ImplicitCastExpr::Create(), ForceOff, ForceOn, clang::VarDecl::getInit(), getLangOpts(), getNamedReturnInfo(), clang::QualType::getNonReferenceType(), clang::ValueDecl::getType(), clang::Expr::IgnoreParens(), clang::Expr::isXValue(), and clang::VK_XValue.

Referenced by BuildCoreturnStmt(), BuildCXXThrow(), BuildReturnStmt(), and getNamedReturnInfo().

◆ GetNameForDeclarator()

◆ GetNameFromUnqualifiedId()

DeclarationNameInfo Sema::GetNameFromUnqualifiedId ( const UnqualifiedId & Name)

Retrieves the declaration name from a parsed unqualified-id.

Definition at line 5997 of file SemaDecl.cpp.

References clang::UnqualifiedId::ConstructorName, Context, clang::UnqualifiedId::ConversionFunctionId, CurContext, clang::UnqualifiedId::DestructorName, clang::SemaBase::Diag(), clang::UnqualifiedId::EndLocation, clang::OpaquePtr< PtrTy >::get(), clang::UnionOpaquePtr< T >::get(), clang::TemplateName::getAsTemplateDecl(), clang::NamedDecl::getIdentifier(), clang::UnqualifiedId::getKind(), getTemplateNameKindForDiagnostics(), GetTypeFromParser(), clang::UnqualifiedId::Identifier, clang::IK_ConstructorName, clang::IK_ConstructorTemplateId, clang::IK_ConversionFunctionId, clang::IK_DeductionGuideName, clang::IK_DestructorName, clang::IK_Identifier, clang::IK_ImplicitSelfParam, clang::IK_LiteralOperatorId, clang::IK_OperatorFunctionId, clang::IK_TemplateId, clang::isa(), clang::QualType::isNull(), clang::TemplateIdAnnotation::Name, NoteTemplateLocation(), clang::UnqualifiedId::OFI::Operator, clang::UnqualifiedId::OperatorFunctionId, clang::DeclarationNameInfo::setCXXLiteralOperatorNameLoc(), clang::DeclarationNameInfo::setCXXOperatorNameRange(), clang::DeclarationNameInfo::setLoc(), clang::DeclarationNameInfo::setName(), clang::DeclarationNameInfo::setNamedTypeInfo(), clang::UnqualifiedId::StartLocation, clang::UnqualifiedId::OFI::SymbolLocations, clang::Template, clang::TemplateIdAnnotation::Template, clang::UnqualifiedId::TemplateId, clang::UnqualifiedId::TemplateName, and clang::TemplateIdAnnotation::TemplateNameLoc.

Referenced by ActOnAliasDeclaration(), ActOnMSDependentExistsStmt(), ActOnTemplateName(), ActOnUsingDeclaration(), CheckMicrosoftIfExistsSymbol(), DecomposeUnqualifiedId(), and GetNameForDeclarator().

◆ getNonFieldDeclScope()

Scope * Sema::getNonFieldDeclScope ( Scope * S)

getNonFieldDeclScope - Retrieves the innermost scope, starting from S, where a non-field would be declared.

This routine copes with the difference between C and C++ scoping rules in structs and unions. For example, the following code is well-formed in C but ill-formed in C++:

struct S6 {
enum { BAR } e;
};
void test_S6() {
struct S6 a;
a.e = BAR;
}

For the declaration of BAR, this routine will return a different scope. The scope S will be the scope of the unnamed enumeration within S6. In C++, this routine will return the scope associated with S6, because the enumeration's scope is a transparent context but structures can contain non-field names. In C, this routine will return the translation unit scope, since the enumeration's scope is a transparent context and structures cannot contain non-field names.

Definition at line 2342 of file SemaDecl.cpp.

References clang::CPlusPlus, clang::Scope::DeclScope, clang::Scope::getEntity(), clang::Scope::getFlags(), getLangOpts(), clang::Scope::getParent(), clang::Scope::isClassScope(), and clang::DeclContext::isTransparentContext().

Referenced by ActOnEnumConstant(), ActOnTag(), and CleanupMergedEnum().

◆ getNonOdrUseReasonInCurrentContext()

NonOdrUseReason Sema::getNonOdrUseReasonInCurrentContext ( ValueDecl * D)

If D cannot be odr-used in the current expression evaluation context, return a reason explaining why.

Otherwise, return NOUR_None.

Definition at line 2349 of file SemaExpr.cpp.

References Context, getLangOpts(), isCapturingReferenceToHostVarInCUDADeviceLambda(), isUnevaluatedContext(), clang::NOUR_Constant, clang::NOUR_None, clang::NOUR_Unevaluated, and OpenMP().

Referenced by BuildDeclRefExpr(), and BuildMemberExpr().

◆ getNonTagTypeDeclKind()

NonTagKind Sema::getNonTagTypeDeclKind ( const Decl * D,
TagTypeKind TTK )

Given a non-tag type declaration, returns an enum useful for indicating what kind of non-tag type this is.

Definition at line 17560 of file SemaDecl.cpp.

References clang::Class, clang::Enum, getLangOpts(), clang::Interface, clang::isa(), clang::NonClass, clang::NonEnum, clang::NonStruct, clang::NonUnion, clang::Struct, clang::Template, clang::TemplateTemplateArgument, clang::TypeAlias, clang::TypeAliasTemplate, clang::Typedef, and clang::Union.

Referenced by ActOnExplicitInstantiation(), and ActOnTag().

◆ getNormalizedAssociatedConstraints()

const NormalizedConstraint * Sema::getNormalizedAssociatedConstraints ( ConstrainedDeclOrNestedRequirement Entity,
ArrayRef< AssociatedConstraint > AssociatedConstraints )

◆ getNullabilityKeyword()

IdentifierInfo * Sema::getNullabilityKeyword ( NullabilityKind nullability)

Retrieve the keyword associated.

Definition at line 3824 of file SemaType.cpp.

References clang::NonNull, clang::Nullable, clang::NullableResult, PP, and clang::Unspecified.

Referenced by GetFullTypeForDeclarator().

◆ getNumArgumentsInExpansion()

UnsignedOrNone Sema::getNumArgumentsInExpansion ( QualType T,
const MultiLevelTemplateArgumentList & TemplateArgs )

Determine the number of arguments in the given pack expansion type.

This routine assumes that the number of arguments in the expansion is consistent across all of the unexpanded parameter packs in its pattern.

Returns an empty Optional if the type can't be expanded.

Definition at line 1128 of file SemaTemplateVariadic.cpp.

References clang::cast(), getNumArgumentsInExpansionFromUnexpanded(), and clang::T.

Referenced by getPackIndexForParam().

◆ getNumArgumentsInExpansionFromUnexpanded()

◆ getOpenCLOptions()

◆ getOptimizeOffPragmaLocation()

SourceLocation clang::Sema::getOptimizeOffPragmaLocation ( ) const
inline

Get the location for the currently active "\#pragma clang optimize off". If this location is invalid, then the state of the pragma is "on".

Definition at line 2125 of file Sema.h.

References OptimizeOffPragmaLocation.

◆ GetOrCreateMSAsmLabel()

◆ getOrCreateStdNamespace()

NamespaceDecl * Sema::getOrCreateStdNamespace ( )

Retrieve the special "std" namespace, which may require us to implicitly define the namespace.

Definition at line 12193 of file SemaDeclCXX.cpp.

References Context, clang::NamespaceDecl::Create(), getStdNamespace(), PP, and StdNamespace.

Referenced by ActOnUsingDirective(), and DeclareGlobalNewDelete().

◆ getOwningModule()

Module * clang::Sema::getOwningModule ( const Decl * Entity)
inline

◆ getPackIndex()

UnsignedOrNone clang::Sema::getPackIndex ( TemplateArgument Pack) const
inline

Definition at line 11787 of file Sema.h.

References ArgPackSubstIndex, and clang::TemplateArgument::pack_size().

◆ getPackSubstitutedTemplateArgument()

◆ getPreprocessor()

◆ getPrintable() [1/13]

bool clang::Sema::getPrintable ( bool B)
inlinestatic

Definition at line 15071 of file Sema.h.

◆ getPrintable() [2/13]

const char * clang::Sema::getPrintable ( const char * S)
inlinestatic

Definition at line 15072 of file Sema.h.

◆ getPrintable() [3/13]

SourceRange clang::Sema::getPrintable ( const Expr * E)
inlinestatic

Definition at line 15082 of file Sema.h.

References clang::Stmt::getSourceRange().

◆ getPrintable() [4/13]

const IdentifierInfo * clang::Sema::getPrintable ( const IdentifierInfo * II)
inlinestatic

Definition at line 15075 of file Sema.h.

◆ getPrintable() [5/13]

const std::string & clang::Sema::getPrintable ( const std::string & S)
inlinestatic

Definition at line 15074 of file Sema.h.

◆ getPrintable() [6/13]

DeclarationName clang::Sema::getPrintable ( DeclarationName N)
inlinestatic

Definition at line 15078 of file Sema.h.

◆ getPrintable() [7/13]

int clang::Sema::getPrintable ( int I)
inlinestatic

Definition at line 15069 of file Sema.h.

◆ getPrintable() [8/13]

QualType clang::Sema::getPrintable ( QualType T)
inlinestatic

Definition at line 15079 of file Sema.h.

References clang::T.

◆ getPrintable() [9/13]

SourceRange clang::Sema::getPrintable ( SourceLocation L)
inlinestatic

Definition at line 15081 of file Sema.h.

◆ getPrintable() [10/13]

SourceRange clang::Sema::getPrintable ( SourceRange R)
inlinestatic

Definition at line 15080 of file Sema.h.

◆ getPrintable() [11/13]

StringRef clang::Sema::getPrintable ( StringRef S)
inlinestatic

Definition at line 15073 of file Sema.h.

◆ getPrintable() [12/13]

SourceRange clang::Sema::getPrintable ( TypeLoc TL)
inlinestatic

Definition at line 15083 of file Sema.h.

References clang::TypeLoc::getSourceRange().

◆ getPrintable() [13/13]

unsigned clang::Sema::getPrintable ( unsigned I)
inlinestatic

Definition at line 15070 of file Sema.h.

◆ getPrintingPolicy() [1/2]

◆ getPrintingPolicy() [2/2]

PrintingPolicy Sema::getPrintingPolicy ( const ASTContext & Ctx,
const Preprocessor & PP )
static

Retrieve a suitable printing policy for diagnostics.

Definition at line 152 of file Sema.cpp.

References clang::PrintingPolicy::Bool, Context, clang::PrintingPolicy::EntireContentsOfLargeArray, and PP.

◆ getRangeForNextToken()

SourceRange Sema::getRangeForNextToken ( SourceLocation Loc,
bool IncludeMacros,
bool IncludeComments,
std::optional< tok::TokenKind > ExpectedToken = std::nullopt )

Calls Lexer::findNextToken() to find the next token, and if the locations of both ends of the token can be resolved it return that range; Otherwise it returns an invalid SourceRange.

Definition at line 88 of file Sema.cpp.

References clang::Lexer::findNextToken(), clang::SourceLocation::isMacroID(), clang::SourceLocation::isValid(), LangOpts, and SourceMgr.

Referenced by ConstructFixItRangeForUnusedCapture().

◆ getReturnTypeLoc()

◆ getScopeForContext()

Scope * Sema::getScopeForContext ( DeclContext * Ctx)

Determines the active Scope associated with the given declaration context.

This routine maps a declaration context to the active Scope object that represents that declaration context in the parser. It is typically used from "scope-less" code (e.g., template instantiation, lazy creation of declarations) that injects a name for name-lookup purposes and, therefore, must update the Scope.

Returns
The scope corresponding to the given declaraion context, or NULL if no such scope is open.

Definition at line 2318 of file Sema.cpp.

References clang::Scope::DeclScope, getCurScope(), clang::DeclContext::getPrimaryContext(), and clang::Scope::TemplateParamScope.

Referenced by buildImplicitMapper(), DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), and TryTypoCorrectionForCall().

◆ getScopeForDeclContext()

Scope * Sema::getScopeForDeclContext ( Scope * S,
DeclContext * DC )
static

Finds the scope corresponding to the given decl context, if it happens to be an enclosing scope.

Otherwise return NULL.

Definition at line 1626 of file SemaDecl.cpp.

References clang::Scope::getEntity(), clang::Scope::getParent(), and clang::DeclContext::getPrimaryContext().

Referenced by ActOnFriendFunctionDecl(), ActOnTag(), and CheckClassTemplate().

◆ getSelfAssignmentClassMemberCandidate()

const FieldDecl * Sema::getSelfAssignmentClassMemberCandidate ( const ValueDecl * SelfAssigned)

Returns a field in a CXXRecordDecl that has the same name as the decl SelfAssigned when inside a CXXMethodDecl.

Definition at line 15059 of file SemaExpr.cpp.

References clang::RecordDecl::field_end(), clang::RecordDecl::fields(), getCurFunctionDecl(), clang::NamedDecl::getDeclName(), clang::isa(), clang::CXXRecordDecl::isLambda(), and clang::Method.

Referenced by DiagnoseSelfAssignment(), and DiagnoseSelfMove().

◆ getSFINAEContext()

SFINAETrap * clang::Sema::getSFINAEContext ( ) const
inlinenodiscard

Returns a pointer to the current SFINAE context, if any.

Definition at line 13693 of file Sema.h.

References CurrentSFINAEContext.

Referenced by CheckTemplateIdType(), EmitDiagnostic(), and PrintStats().

◆ getShadowedDeclaration() [1/3]

NamedDecl * Sema::getShadowedDeclaration ( const BindingDecl * D,
const LookupResult & R )

Return the declaration shadowed by the given variable D, or null if it doesn't shadow any declaration or shadowing warnings are disabled.

Definition at line 8526 of file SemaDecl.cpp.

References Diags, clang::LookupResult::getFoundDecl(), clang::isa(), and shouldWarnIfShadowedDecl().

◆ getShadowedDeclaration() [2/3]

NamedDecl * Sema::getShadowedDeclaration ( const TypedefNameDecl * D,
const LookupResult & R )

Return the declaration shadowed by the given typedef D, or null if it doesn't shadow any declaration or shadowing warnings are disabled.

Definition at line 8513 of file SemaDecl.cpp.

References Diags, clang::Decl::getDeclContext(), clang::LookupResult::getFoundDecl(), clang::isa(), clang::DeclContext::isRecord(), and shouldWarnIfShadowedDecl().

Referenced by ActOnDecompositionDeclarator(), ActOnTypedefNameDecl(), ActOnVariableDeclarator(), and CheckShadow().

◆ getShadowedDeclaration() [3/3]

NamedDecl * Sema::getShadowedDeclaration ( const VarDecl * D,
const LookupResult & R )

Return the declaration shadowed by the given variable D, or null if it doesn't shadow any declaration or shadowing warnings are disabled.

Definition at line 8499 of file SemaDecl.cpp.

References Diags, clang::LookupResult::getFoundDecl(), clang::VarDecl::hasGlobalStorage(), clang::isa(), clang::VarDecl::isStaticLocal(), and shouldWarnIfShadowedDecl().

◆ GetSignedSizelessVectorType()

QualType Sema::GetSignedSizelessVectorType ( QualType V)

Definition at line 13177 of file SemaExpr.cpp.

References Context, clang::Type::isSizelessBuiltinType(), and V.

Referenced by CheckSizelessVectorCompareOperands().

◆ GetSignedVectorType()

QualType Sema::GetSignedVectorType ( QualType V)

Return a signed ext_vector_type that is of identical size and number of elements.

For floating point vectors, return an integer type of identical size and number of elements. In the non ext_vector_type case, search from the largest type to the smallest type to avoid cases where long long == long, where long gets picked over long long.

Definition at line 13134 of file SemaExpr.cpp.

References Context, clang::Generic, clang::VectorType::getElementType(), clang::VectorType::getNumElements(), clang::isa(), clang::Type::isExtVectorBoolType(), and V.

Referenced by CheckVectorCompareOperands(), CheckVectorLogicalOperands(), convertHalfVecBinOp(), and CreateBuiltinUnaryOp().

◆ getSourceManager()

◆ getSpecialMember()

◆ getStdAlignValT()

◆ getStdBadAlloc()

CXXRecordDecl * Sema::getStdBadAlloc ( ) const

Definition at line 12040 of file SemaDeclCXX.cpp.

References Context, and StdBadAlloc.

Referenced by ActOnTag(), DeclareGlobalAllocationFunction(), and DeclareGlobalNewDelete().

◆ getStdNamespace()

◆ getSuperIdentifier()

IdentifierInfo * Sema::getSuperIdentifier ( ) const

Definition at line 2873 of file Sema.cpp.

References Context.

◆ getTemplateArgumentBindingsText() [1/2]

◆ getTemplateArgumentBindingsText() [2/2]

std::string Sema::getTemplateArgumentBindingsText ( const TemplateParameterList * Params,
const TemplateArgumentList & Args )

◆ getTemplateArgumentPackExpansionPattern()

TemplateArgumentLoc Sema::getTemplateArgumentPackExpansionPattern ( TemplateArgumentLoc OrigLoc,
SourceLocation & Ellipsis,
UnsignedOrNone & NumExpansions ) const

Returns the pattern of the pack expansion for a template argument.

Parameters
OrigLocThe template argument to expand.
EllipsisWill be set to the location of the ellipsis.
NumExpansionsWill be set to the number of expansions that will be generated from this pack expansion, if known a priori.

Definition at line 1383 of file SemaTemplateVariadic.cpp.

References clang::cast(), clang::TypeLoc::castAs(), Context, clang::TemplateArgument::Declaration, clang::TemplateArgument::Expression, clang::TemplateArgumentLoc::getArgument(), clang::TemplateArgument::getAsExpr(), clang::TemplateArgument::getAsType(), clang::PackExpansionExpr::getEllipsisLoc(), clang::PackExpansionTypeLoc::getEllipsisLoc(), clang::TemplateArgument::getKind(), clang::PackExpansionExpr::getNumExpansions(), clang::TemplateArgument::getNumTemplateExpansions(), clang::TemplateArgument::getPackExpansionPattern(), clang::PackExpansionExpr::getPattern(), clang::PackExpansionTypeLoc::getPatternLoc(), clang::TemplateArgumentLoc::getTemplateEllipsisLoc(), clang::TemplateArgumentLoc::getTemplateKWLoc(), clang::TemplateArgumentLoc::getTemplateNameLoc(), clang::TemplateArgumentLoc::getTemplateQualifierLoc(), clang::TypeLoc::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::ConcreteTypeLoc< Base, Derived, TypeClass, LocalData >::getTypePtr(), clang::TemplateArgumentLoc::getTypeSourceInfo(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::TemplateArgument::Integral, clang::TemplateArgument::isCanonicalExpr(), clang::TemplateArgument::isPackExpansion(), clang::TemplateArgument::Null, clang::TemplateArgument::NullPtr, clang::TemplateArgument::Pack, clang::TypeLocBuilder::pushFullCopy(), clang::TemplateArgument::StructuralValue, clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, and clang::TemplateArgument::Type.

◆ getTemplateDepth()

unsigned Sema::getTemplateDepth ( Scope * S) const

Determine the number of levels of enclosing template parameters.

This is only usable while parsing. Note that this does not include dependent contexts in which no template parameters have yet been declared, such as in a terse function template or generic lambda before the first 'auto' is encountered.

Definition at line 59 of file SemaTemplate.cpp.

References getFunctionScopes(), getInventedParameterInfos(), clang::Scope::getParent(), and clang::Scope::getTemplateParamParent().

Referenced by ActOnStmtExpr(), and EnterTemplatedContext().

◆ getTemplateInstantiationArgs()

MultiLevelTemplateArgumentList Sema::getTemplateInstantiationArgs ( const NamedDecl * D,
const DeclContext * DC = nullptr,
bool Final = false,
std::optional< ArrayRef< TemplateArgument > > Innermost = std::nullopt,
bool RelativeToPrimary = false,
const FunctionDecl * Pattern = nullptr,
bool ForConstraintInstantiation = false,
bool SkipForSpecialization = false,
bool ForDefaultArgumentSubstitution = false )

Retrieve the template argument list(s) that should be used to instantiate the definition of the given declaration.

Parameters
NDthe declaration for which we are computing template instantiation arguments.
DCIn the event we don't HAVE a declaration yet, we instead provide the decl context where it will be created. In this case, the Innermost should likely be provided. If ND is non-null, this is ignored.
Innermostif non-NULL, specifies a template argument list for the template declaration passed as ND.
RelativeToPrimarytrue if we should get the template arguments relative to the primary template, even when we're dealing with a specialization. This is only relevant for function template specializations.
PatternIf non-NULL, indicates the pattern from which we will be instantiating the definition of the given declaration, ND. This is used to determine the proper set of template instantiation arguments for friend function template specializations.
ForConstraintInstantiationwhen collecting arguments, ForConstraintInstantiation indicates we should continue looking when encountering a lambda generic call operator, and continue looking for arguments on an enclosing class template.
SkipForSpecializationwhen specified, any template specializations in a traversal would be ignored.
ForDefaultArgumentSubstitutionindicates we should continue looking when encountering a specialized member function template, rather than returning immediately.

Definition at line 489 of file SemaTemplateInstantiate.cpp.

References clang::Decl::castFromDeclContext(), Context, clang::Function, clang::isa(), clang::Decl::isFileContextDecl(), and clang::Result.

Referenced by ActOnExplicitInstantiation(), BuildCXXDefaultInitExpr(), CalculateTemplateDepthForConstraints(), CheckDeducedArgumentConstraints(), CheckFunctionConstraintsWithoutInstantiation(), CheckTemplateArgumentList(), InstantiateClassTemplateSpecialization(), InstantiateClassTemplateSpecializationMembers(), InstantiateDefaultArgument(), InstantiateExceptionSpec(), InstantiateFunctionDefinition(), InstantiateVariableDefinition(), RequireCompleteEnumDecl(), SubstConceptTemplateArguments(), SubstituteConceptsInConstraintExpression(), and SubstituteConstraintExpressionWithoutSatisfaction().

◆ getTemplateNameKindForDiagnostics()

◆ GetTemplateParameterList()

TemplateParameterList * Sema::GetTemplateParameterList ( TemplateDecl * TD)

Returns the template parameter list with all default template argument information.

Definition at line 1885 of file SemaTemplate.cpp.

References clang::cast(), clang::Decl::FOK_None, clang::Decl::getFriendObjectKind(), clang::NamedDecl::getMostRecentDecl(), and clang::Decl::getPreviousDecl().

Referenced by CheckClassTemplate(), and CheckTemplateArgumentList().

◆ getTopMostPointOfInstantiation()

SourceLocation Sema::getTopMostPointOfInstantiation ( const NamedDecl * N) const

Returns the top most location responsible for the definition of N.

If N is a a template specialization, this is the location of the top of the instantiation stack. Otherwise, the location of N is returned.

Definition at line 11814 of file SemaTemplate.cpp.

References CodeSynthesisContexts, clang::CPlusPlus, getLangOpts(), clang::Decl::getLocation(), clang::isa(), and clang::FunctionDecl::isFunctionTemplateSpecialization().

Referenced by DoEmitAvailabilityWarning().

◆ getTrivialTemplateArgumentLoc()

TemplateArgumentLoc Sema::getTrivialTemplateArgumentLoc ( const TemplateArgument & Arg,
QualType NTTPType,
SourceLocation Loc,
NamedDecl * TemplateParam = nullptr )

Allocate a TemplateArgumentLoc where all locations have been initialized to the given location.

Parameters
ArgThe template argument we are producing template argument location information for.
NTTPTypeFor a declaration template argument, the type of the non-type template parameter that corresponds to this template argument. Can be null if no type sugar is available to add to the type from the template argument.
LocThe source location to use for the resulting template argument.

Definition at line 2869 of file SemaTemplateDeduction.cpp.

References BuildExpressionFromDeclTemplateArgument(), BuildExpressionFromNonTypeTemplateArgument(), Context, clang::TemplateArgument::Declaration, clang::TemplateArgument::Expression, clang::ActionResult< PtrTy, Compress >::get(), clang::ActionResult< PtrTy, Compress >::getAs(), clang::TemplateArgument::getAsExpr(), clang::TemplateArgument::getAsTemplateOrTemplatePattern(), clang::TemplateArgument::getAsType(), clang::TemplateArgument::getKind(), clang::TemplateArgument::getNullPtrType(), clang::TemplateArgument::getParamTypeForDecl(), clang::TemplateArgument::Integral, clang::QualType::isNull(), clang::TemplateArgument::Null, clang::TemplateArgument::NullPtr, clang::TemplateArgument::Pack, clang::TemplateArgument::StructuralValue, clang::Template, clang::TemplateArgument::Template, clang::TemplateArgument::TemplateExpansion, clang::TemplateParam, and clang::TemplateArgument::Type.

Referenced by ActOnNonTypeTemplateParameter(), checkBuiltinTemplateIdType(), clang::hlsl::TemplateParameterListBuilder::constructConceptSpecializationExpr(), ConvertDeducedTemplateArgument(), FindInstantiatedDecl(), FinishTemplateArgumentDeduction(), formImmediatelyDeclaredConstraint(), getIdentityTemplateArgumentLoc(), getTrivialIntegralTemplateArgument(), getTrivialTypeTemplateArgument(), and isTemplateTemplateParameterAtLeastAsSpecializedAs().

◆ GetTypeForDeclarator()

◆ GetTypeForDeclaratorCast()

◆ GetTypeFromParser()

QualType Sema::GetTypeFromParser ( ParsedType Ty,
TypeSourceInfo ** TInfo = nullptr )
static

◆ getTypeName()

ParsedType Sema::getTypeName ( const IdentifierInfo & II,
SourceLocation NameLoc,
Scope * S,
CXXScopeSpec * SS = nullptr,
bool isClassName = false,
bool HasTrailingDot = false,
ParsedType ObjectType = nullptr,
bool IsCtorOrDtorName = false,
bool WantNontrivialTypeSourceInfo = false,
bool IsClassTemplateDeductionContext = true,
ImplicitTypenameContext AllowImplicitTypename = ImplicitTypenameContext::No,
IdentifierInfo ** CorrectedII = nullptr )

If the identifier refers to a type name within this scope, return the declaration of that type.

This routine performs ordinary name lookup of the identifier II within the given scope, with optional C++ scope specifier SS, to determine whether the name refers to a type. If so, returns an opaque pointer (actually a QualType) corresponding to that type. Otherwise, returns NULL.

Definition at line 274 of file SemaDecl.cpp.

References ActOnTypenameType(), clang::Ambiguous, clang::AmbiguousTagHiding, checkTypeDeclType(), CheckTypenameType(), computeDeclContext(), Context, CorrectTypo(), clang::CPlusPlus, clang::CPlusPlus20, clang::FixItHint::CreateInsertion(), CreateParsedType(), clang::SemaBase::DiagCompat(), diagnoseTypo(), DiagnoseUseOfDecl(), clang::ErrorRecovery, clang::Found, clang::FoundOverloaded, clang::FoundUnresolvedValue, clang::ActionResult< PtrTy, Compress >::get(), clang::OpaquePtr< PtrTy >::get(), clang::getAsTypeTemplateDecl(), clang::SourceRange::getBegin(), clang::TypoCorrection::getCorrectionAsIdentifierInfo(), clang::TypoCorrection::getCorrectionSpecifier(), getLangOpts(), clang::Decl::getLocation(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::UsingShadowDecl::getTargetDecl(), getTypeName(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::NamedDecl::getUnderlyingDecl(), clang::CXXScopeSpec::getWithLocInContext(), Implicit, clang::isa(), clang::DeclContext::isDependentContext(), isDependentScopeSpecifier(), clang::CXXScopeSpec::isEmpty(), clang::CXXScopeSpec::isNotEmpty(), clang::Type::isRecordType(), isTemplateName(), LookupName(), LookupOrdinaryName, LookupQualifiedName(), LookupTagName, clang::OpaquePtr< QualType >::make(), clang::CXXScopeSpec::MakeTrivial(), clang::No, clang::None, None, clang::NotFound, clang::NotFoundInCurrentInstantiation, clang::SemaBase::PDiag(), clang::TypeLocBuilder::push(), clang::TypeLocBuilder::pushTypeSpec(), recoverFromTypeInKnownDependentBase(), RequireCompleteDeclContext(), clang::Result, clang::DeducedTemplateSpecializationTypeLoc::setElaboratedKeywordLoc(), clang::DependentNameTypeLoc::setElaboratedKeywordLoc(), clang::TagTypeLoc::setElaboratedKeywordLoc(), clang::DependentNameTypeLoc::setNameLoc(), clang::ObjCInterfaceTypeLoc::setNameLoc(), clang::TypeSpecTypeLoc::setNameLoc(), clang::DependentNameTypeLoc::setQualifierLoc(), clang::T, clang::Template, clang::TemplateName, clang::Typename, and clang::Yes.

Referenced by ActOnPseudoDestructorExpr(), DiagnoseUnknownTypeName(), findOMPAllocatorHandleT(), findOMPAlloctraitT(), findOMPDependT(), findOMPEventHandleT(), and getTypeName().

◆ getUndefinedButUsed()

void Sema::getUndefinedButUsed ( SmallVectorImpl< std::pair< NamedDecl *, SourceLocation > > & Undefined)

Obtain a sorted list of functions that are undefined but ODR-used.

Obtains a sorted list of functions and variables that are undefined but ODR-used.

Definition at line 946 of file Sema.cpp.

References clang::cast(), clang::VarDecl::DeclarationOnly, clang::Decl::hasAttr(), clang::isa(), isExternalWithNoLinkageType(), clang::Decl::isInvalidDecl(), clang::Undefined, and UndefinedButUsed.

Referenced by checkUndefinedButUsed().

◆ getVariadicCallType()

◆ GloballyUniqueObjectMightBeAccidentallyDuplicated()

◆ HandleDeclarator()

NamedDecl * Sema::HandleDeclarator ( Scope * S,
Declarator & D,
MultiTemplateParamsArg TemplateParameterLists )

Get the innermost enclosing declaration scope.

Definition at line 6436 of file SemaDecl.cpp.

References ActOnDecompositionDeclarator(), ActOnFunctionDeclarator(), ActOnTypedefDeclarator(), ActOnVariableDeclarator(), clang::cast(), clang::SemaOpenMP::checkDeclIsAllowedInOpenMPTarget(), CheckExtraCXXDefaultArguments(), computeDeclContext(), clang::CPlusPlus, CurContext, clang::SemaBase::Diag(), DiagnoseClassNameShadow(), diagnoseQualifiedDeclaration(), DiagnoseTemplateParameterShadow(), DiagnoseUnexpandedParameterPack(), ForExternalRedeclaration, forRedeclarationInCurContext(), clang::DeclSpec::getBeginLoc(), clang::Declarator::getCXXScopeSpec(), clang::Scope::getDeclParent(), clang::Declarator::getDeclSpec(), clang::Declarator::getIdentifierLoc(), clang::UnqualifiedId::getKind(), getLangOpts(), clang::DeclarationNameInfo::getName(), clang::Declarator::getName(), GetNameForDeclarator(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::Declarator::getSourceRange(), clang::DeclSpec::getSourceRange(), clang::DeclSpec::getStorageClassSpec(), clang::Scope::getTemplateParamParent(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), hasDefinition(), clang::IK_TemplateId, clang::isa(), clang::Declarator::isDecompositionDeclarator(), clang::DeclContext::isDependentContext(), clang::DeclSpec::isFriendSpecified(), clang::Type::isFunctionType(), clang::CXXScopeSpec::isInvalid(), clang::Declarator::isInvalidType(), clang::DeclContext::isRecord(), clang::CXXScopeSpec::isSet(), clang::Decl::isTemplateParameter(), LookupName(), LookupOrdinaryName, LookupQualifiedName(), LookupRedeclarationWithLinkage, New, OpenMP(), Previous, PushOnScopeChains(), RebuildDeclaratorInCurrentInstantiation(), RemoveUsingDecls(), RequireCompleteDeclContext(), clang::DeclSpec::SCS_extern, clang::DeclSpec::SCS_static, clang::DeclSpec::SCS_typedef, clang::Declarator::setInvalidType(), clang::UnqualifiedId::TemplateId, UPPC_DeclarationQualifier, UPPC_DeclarationType, and warnOnCTypeHiddenInCPlusPlus().

Referenced by ActOnCXXMemberDeclarator(), ActOnDeclarator(), ActOnStartOfFunctionDef(), and ActOnTemplateDeclarator().

◆ HandleDelayedAccessCheck()

◆ handleDelayedAvailabilityCheck()

◆ HandleDependentAccessCheck()

◆ HandleExprEvaluationContextForTypeof()

◆ HandleField()

FieldDecl * Sema::HandleField ( Scope * S,
RecordDecl * TagD,
SourceLocation DeclStart,
Declarator & D,
Expr * BitfieldWidth,
InClassInitStyle InitStyle,
AccessSpecifier AS )

HandleField - Analyze a field of a C struct or a C++ data member.

Definition at line 19084 of file SemaDecl.cpp.

References clang::Ambiguous, CheckExtraCXXDefaultArguments(), CheckFieldDecl(), Context, clang::CPlusPlus, clang::SemaBase::Diag(), DiagnoseFunctionSpecifiers(), DiagnoseTemplateParameterShadow(), DiagnoseUnexpandedParameterPack(), ForVisibleRedeclaration, clang::Found, clang::FoundOverloaded, clang::FoundUnresolvedValue, clang::Declarator::getBeginLoc(), clang::Declarator::getDeclSpec(), clang::Declarator::getDecompositionDeclarator(), clang::Declarator::getIdentifier(), clang::Declarator::getIdentifierLoc(), clang::DeclSpec::getInlineSpecLoc(), getLangOpts(), clang::DecompositionDeclarator::getLSquareLoc(), clang::DecompositionDeclarator::getSourceRange(), clang::DeclSpec::getSpecifierName(), clang::DeclSpec::getThreadStorageClassSpec(), clang::DeclSpec::getThreadStorageClassSpecLoc(), clang::TypeSourceInfo::getType(), GetTypeForDeclarator(), isDeclInScope(), clang::Declarator::isDecompositionDeclarator(), clang::DeclSpec::isInlineSpecified(), clang::Decl::isInvalidDecl(), clang::DeclSpec::isModulePrivateSpecified(), clang::Decl::isTemplateParameter(), LookupMemberName, LookupName(), clang::NotFound, clang::NotFoundInCurrentInstantiation, Previous, PushOnScopeChains(), clang::DeclSpec::SCS_mutable, clang::Declarator::setInvalidType(), clang::NamedDecl::setModulePrivate(), clang::T, and UPPC_DataMemberType.

Referenced by ActOnCXXMemberDeclarator(), and ActOnField().

◆ HandleFunctionTypeMismatch()

◆ handleLambdaNumbering()

◆ HandleMSProperty()

MSPropertyDecl * Sema::HandleMSProperty ( Scope * S,
RecordDecl * TagD,
SourceLocation DeclStart,
Declarator & D,
Expr * BitfieldWidth,
InClassInitStyle InitStyle,
AccessSpecifier AS,
const ParsedAttr & MSPropertyAttr )

◆ handlerCanCatch()

◆ handleTagNumbering()

◆ hasAcceptableDefaultArgument()

bool Sema::hasAcceptableDefaultArgument ( const NamedDecl * D,
llvm::SmallVectorImpl< Module * > * Modules,
Sema::AcceptableKind Kind )

Determine if the template parameter D has a reachable default argument.

Definition at line 1717 of file SemaLookup.cpp.

References clang::cast().

Referenced by hasReachableDefaultArgument(), and hasVisibleDefaultArgument().

◆ hasAcceptableDefinition() [1/2]

bool clang::Sema::hasAcceptableDefinition ( NamedDecl * D,
AcceptableKind Kind )
inline

Definition at line 15547 of file Sema.h.

References hasAcceptableDefinition().

◆ hasAcceptableDefinition() [2/2]

◆ hasAnyAcceptableTemplateNames()

bool Sema::hasAnyAcceptableTemplateNames ( LookupResult & R,
bool AllowFunctionTemplates = true,
bool AllowDependent = true,
bool AllowNonTemplateFunctions = false )

◆ hasAnyUnrecoverableErrorsInThisFunction()

bool Sema::hasAnyUnrecoverableErrorsInThisFunction ( ) const

Determine whether any errors occurred within this function/method/ block.

Definition at line 2495 of file Sema.cpp.

References getCurFunction().

Referenced by ActOnBlockStmtExpr(), ActOnFinishFunctionBody(), and BuildStmtExpr().

◆ hasCStrMethod()

bool Sema::hasCStrMethod ( const Expr * E)

Check to see if a given expression could have '.c_str()' called on it.

Check if we could call '.c_str()' on an object.

FIXME: This returns the wrong results in some cases (if cv-qualifiers don't allow the call, or if it would be ambiguous).

Definition at line 8502 of file SemaChecking.cpp.

References CXXRecordMembersNamed(), and clang::Expr::getType().

Referenced by checkVariadicArgument().

◆ hasExplicitCallingConv()

bool Sema::hasExplicitCallingConv ( QualType T)

Definition at line 8238 of file SemaType.cpp.

References clang::T.

Referenced by adjustMemberFunctionCC(), CheckMemberSpecialization(), and CheckMSVCRTEntryPoint().

◆ hasMergedDefinitionInCurrentModule()

bool Sema::hasMergedDefinitionInCurrentModule ( const NamedDecl * Def)

Definition at line 1684 of file SemaLookup.cpp.

References Context.

Referenced by hasAcceptableDefinition().

◆ hasReachableDeclaration()

bool clang::Sema::hasReachableDeclaration ( const NamedDecl * D,
llvm::SmallVectorImpl< Module * > * Modules = nullptr )
inline

Determine whether any declaration of an entity is reachable.

Definition at line 9672 of file Sema.h.

References hasReachableDeclarationSlow(), and isReachable().

◆ hasReachableDeclarationSlow()

bool Sema::hasReachableDeclarationSlow ( const NamedDecl * D,
llvm::SmallVectorImpl< Module * > * Modules = nullptr )

Definition at line 2119 of file SemaLookup.cpp.

References hasAcceptableDeclarationImpl(), isReachable(), and Reachable.

Referenced by hasReachableDeclaration().

◆ hasReachableDefaultArgument()

bool Sema::hasReachableDefaultArgument ( const NamedDecl * D,
llvm::SmallVectorImpl< Module * > * Modules = nullptr )

Determine if the template parameter D has a reachable default argument.

Definition at line 1736 of file SemaLookup.cpp.

References hasAcceptableDefaultArgument(), and Reachable.

Referenced by diagnoseMissingArgument(), and SubstDefaultTemplateArgumentIfAvailable().

◆ hasReachableDefinition() [1/2]

bool clang::Sema::hasReachableDefinition ( NamedDecl * D)
inline

Definition at line 15539 of file Sema.h.

References hasReachableDefinition().

◆ hasReachableDefinition() [2/2]

bool Sema::hasReachableDefinition ( NamedDecl * D,
NamedDecl ** Suggested,
bool OnlyNeedComplete = false )

Determine if D has a reachable definition.

Determine whether there is any declaration of D that was ever a definition (perhaps before module merging) and is currently reachable.

If not, suggest a declaration that should be made reachable to expose the definition.

Parameters
DThe definition of the entity.
SuggestedFilled in with the declaration that should be made reachable in order to provide a definition of this entity.
OnlyNeedCompleteIf true, we only need the type to be complete, not defined. This only matters for enums with a fixed underlying type, since in all other cases, a type is complete if and only if it is defined.

Definition at line 9387 of file SemaType.cpp.

References hasAcceptableDefinition(), and Reachable.

Referenced by CheckConceptRedefinition(), computeDeclContext(), DiagnoseUninstantiableTemplate(), hasReachableDefinition(), clang::LookupResult::isAvailableForLookup(), and RequireCompleteEnumDecl().

◆ hasReachableExplicitSpecialization()

bool Sema::hasReachableExplicitSpecialization ( const NamedDecl * D,
llvm::SmallVectorImpl< Module * > * Modules = nullptr )

Determine if there is a reachable declaration of D that is an explicit specialization declaration for a specialization of a template.

(For a member specialization, use hasReachableMemberSpecialization.)

Definition at line 1797 of file SemaLookup.cpp.

References Reachable.

◆ hasReachableMemberSpecialization()

bool Sema::hasReachableMemberSpecialization ( const NamedDecl * D,
llvm::SmallVectorImpl< Module * > * Modules = nullptr )

Determine if there is a reachable declaration of D that is a member specialization declaration (as opposed to an instantiated declaration).

Definition at line 1831 of file SemaLookup.cpp.

References hasAcceptableMemberSpecialization(), and Reachable.

◆ hasStructuralCompatLayout()

bool Sema::hasStructuralCompatLayout ( Decl * D,
Decl * Suggested )

Determine if D and Suggested have a structurally compatible layout as described in C11 6.2.7/1.

Definition at line 9262 of file SemaType.cpp.

References clang::Default, clang::Decl::getASTContext(), getLangOpts(), and clang::StructuralEquivalenceContext::IsEquivalent().

Referenced by ActOnDuplicateDefinition().

◆ hasUncompilableErrorOccurred()

bool Sema::hasUncompilableErrorOccurred ( ) const

Whether uncompilable error has occurred.

This includes error happens in deferred diagnostics.

Definition at line 1786 of file Sema.cpp.

References CurContext, DeviceDeferredDiags, Diags, getDiagnostics(), and hasUncompilableErrorOccurred().

Referenced by ActOnFinishFunctionBody(), FindInstantiatedDecl(), hasUncompilableErrorOccurred(), maybeAddDeclWithEffects(), and performFunctionEffectAnalysis().

◆ hasVisibleDeclaration()

bool clang::Sema::hasVisibleDeclaration ( const NamedDecl * D,
llvm::SmallVectorImpl< Module * > * Modules = nullptr )
inline

Determine whether any declaration of an entity is visible.

Definition at line 9663 of file Sema.h.

References hasVisibleDeclarationSlow(), and isVisible().

◆ hasVisibleDeclarationSlow()

bool Sema::hasVisibleDeclarationSlow ( const NamedDecl * D,
llvm::SmallVectorImpl< Module * > * Modules )

Definition at line 2111 of file SemaLookup.cpp.

References hasAcceptableDeclarationImpl(), isVisible(), and Visible.

Referenced by hasVisibleDeclaration().

◆ hasVisibleDefaultArgument()

bool Sema::hasVisibleDefaultArgument ( const NamedDecl * D,
llvm::SmallVectorImpl< Module * > * Modules = nullptr )

Determine if the template parameter D has a visible default argument.

Definition at line 1730 of file SemaLookup.cpp.

References hasAcceptableDefaultArgument(), and Visible.

Referenced by CheckDeductionGuideTemplate(), CheckTemplateParameterList(), and isPreferredLookupResult().

◆ hasVisibleDefinition() [1/2]

bool clang::Sema::hasVisibleDefinition ( const NamedDecl * D)
inline

Definition at line 15520 of file Sema.h.

References hasVisibleDefinition().

◆ hasVisibleDefinition() [2/2]

bool Sema::hasVisibleDefinition ( NamedDecl * D,
NamedDecl ** Suggested,
bool OnlyNeedComplete = false )

Determine if D has a visible definition.

Determine whether there is any declaration of D that was ever a definition (perhaps before module merging) and is currently visible.

If not, suggest a declaration that should be made visible to expose the definition.

Parameters
DThe definition of the entity.
SuggestedFilled in with the declaration that should be made visible in order to provide a definition of this entity.
OnlyNeedCompleteIf true, we only need the type to be complete, not defined. This only matters for enums with a fixed underlying type, since in all other cases, a type is complete if and only if it is defined.

Definition at line 9370 of file SemaType.cpp.

References hasAcceptableDefinition(), and Visible.

Referenced by checkVarDeclRedefinition(), hasVisibleDefinition(), isRedefinitionAllowedFor(), MergeTypedefNameDecl(), and shouldSkipAnonEnumBody().

◆ hasVisibleExplicitSpecialization()

bool Sema::hasVisibleExplicitSpecialization ( const NamedDecl * D,
llvm::SmallVectorImpl< Module * > * Modules = nullptr )

Determine if there is a visible declaration of D that is an explicit specialization declaration for a specialization of a template.

(For a member specialization, use hasVisibleMemberSpecialization.)

Definition at line 1791 of file SemaLookup.cpp.

References Visible.

◆ hasVisibleMemberSpecialization()

bool Sema::hasVisibleMemberSpecialization ( const NamedDecl * D,
llvm::SmallVectorImpl< Module * > * Modules = nullptr )

Determine if there is a visible declaration of D that is a member specialization declaration (as opposed to an instantiated declaration).

Definition at line 1825 of file SemaLookup.cpp.

References hasAcceptableMemberSpecialization(), and Visible.

◆ hasVisibleMergedDefinition()

bool Sema::hasVisibleMergedDefinition ( const NamedDecl * Def)

Definition at line 1677 of file SemaLookup.cpp.

References Context, and isModuleVisible().

Referenced by hasAcceptableDefinition().

◆ Hexagon()

SemaHexagon & clang::Sema::Hexagon ( )
inline

Definition at line 1463 of file Sema.h.

◆ HideUsingShadowDecl()

void Sema::HideUsingShadowDecl ( Scope * S,
UsingShadowDecl * Shadow )

Hides a using shadow declaration.

This is required by the current using-decl implementation when a resolvable using declaration in a class is followed by a declaration which would hide or override one or more of the using decl's targets; for example:

struct Base { void foo(int); }; struct Derived : Base { using Base::foo; void foo(int); };

The governing language is C++03 [namespace.udecl]p12:

When a using-declaration brings names from a base class into a derived class scope, member functions in the derived class override and/or hide member functions with the same name and parameter types in a base class (rather than conflicting).

There are two ways to implement this: (1) optimistically create shadow decls when they're not hidden by existing declarations, or (2) don't create any shadow decls (or at least don't make them visible) until we've fully parsed/instantiated the class. The problem with (1) is that we might have to retroactively remove a shadow decl, which requires several O(n) operations because the decl structures are (very reasonably) not designed for removal. (2) avoids this but is very fiddly and phase-dependent.

Definition at line 12967 of file SemaDeclCXX.cpp.

References clang::cast(), clang::DeclarationName::CXXConversionFunctionName, clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::UsingShadowDecl::getIntroducer(), clang::DeclarationName::getNameKind(), IdResolver, clang::Scope::RemoveDecl(), clang::DeclContext::removeDecl(), and clang::BaseUsingDecl::removeShadowDecl().

Referenced by CheckOverload().

◆ HLSL()

◆ IgnoredValueConversions()

◆ ImpCastExprToType()

ExprResult Sema::ImpCastExprToType ( Expr * E,
QualType Ty,
CastKind Kind,
ExprValueKind VK = VK_PRValue,
const CXXCastPath * BasePath = nullptr,
CheckedConversionKind CCK = CheckedConversionKind::Implicit )

ImpCastExprToType - If Expr is not of type 'Type', insert an implicit cast.

If there is already an implicit cast, merge into the existing one. If isLvalue, the result of the cast is an lvalue.

If there is already an implicit cast, merge into the existing one. The result is of the given category.

Definition at line 756 of file Sema.cpp.

References Context, clang::CPlusPlus, clang::CPlusPlus11, clang::ImplicitCastExpr::Create(), CreateMaterializeTemporaryExpr(), CurFPFeatureOverrides(), clang::SemaBase::Diag(), diagnoseFunctionEffectConversion(), diagnoseNullableToNonnullConversion(), diagnoseZeroToNullptrConversion(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::CastExpr::getCastKindName(), clang::Expr::getExprLoc(), getLangOpts(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::isa(), isCast(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isPRValue(), clang::SC_Register, and clang::VK_PRValue.

Referenced by ActOnBlockStmtExpr(), ActOnCaseExpr(), ActOnCXXDelete(), ActOnGCCAsmStmt(), ActOnNumericConstant(), BuildAtomicExpr(), BuildCallExpr(), BuildCXXTypeId(), BuildExpressionFromDeclTemplateArgument(), BuildImplicitBaseInitializer(), BuildResolvedCallExpr(), BuildReturnStmt(), BuildVectorLiteral(), BuiltinCallWithStaticChain(), CallExprUnaryConversions(), castElement(), castVector(), checkArithmeticOrEnumeralThreeWayCompare(), CheckAssignmentConstraints(), CheckCompareOperands(), checkConditionalBlockPointerCompatibility(), checkConditionalNullPointer(), checkConditionalObjectPointersCompatibility(), CheckConditionalOperands(), checkConditionalPointerCompatibility(), CheckEnumConstant(), checkMemberDecomposition(), CheckPlaceholderExpr(), checkPointerIntegerMismatch(), CheckPointerToMemberOperands(), CheckSingleAssignmentConstraints(), checkSizelessVectorShift(), CheckTemplateArgument(), CheckTemplateArgumentPointerToMember(), CheckTransparentUnionArgumentConstraints(), CheckVectorConditionalTypes(), CheckVectorOperands(), checkVectorShift(), ConstantFoldAttrArgs(), convertVector(), CreateBuiltinArraySubscriptExpr(), CreateBuiltinUnaryOp(), CreateFunctionRefExpr(), CXXCheckConditionalOperands(), DeduceNullPtrTemplateArgument(), DefaultArgumentPromotion(), DefaultFunctionArrayConversion(), FindCompositePointerType(), handleComplexFloatConversion(), handleComplexIntConversion(), handleComplexIntegerToFloatConversion(), handleFloatConversion(), handleIntToFloatConversion(), IgnoredValueConversions(), LookupMemberExpr(), OpenCLConvertScalarsToVectors(), clang::InitializationSequence::Perform(), PerformImplicitConversion(), PerformImplicitObjectArgumentInitialization(), PerformObjectMemberConversion(), PerformQualificationConversion(), prepareMatrixSplat(), PrepareScalarCast(), prepareVectorSplat(), rebuildPotentialResultsAsNonOdrUsed(), ShouldTryAgainWithRedefinitionType(), tryGCCVectorConvertAndSplat(), tryVectorConvertAndSplat(), UsualArithmeticConversions(), UsualUnaryConversions(), and UsualUnaryFPConversions().

◆ ImplicitlyDefineFunction()

◆ inConstraintSubstitution()

bool clang::Sema::inConstraintSubstitution ( ) const
inline

Determine whether we are currently performing constraint substitution.

Definition at line 13968 of file Sema.h.

References CodeSynthesisContexts.

Referenced by inParameterMappingSubstitution().

◆ incrementMSManglingNumber()

void clang::Sema::incrementMSManglingNumber ( ) const
inline

Definition at line 1249 of file Sema.h.

◆ inferGslOwnerPointerAttribute()

void Sema::inferGslOwnerPointerAttribute ( CXXRecordDecl * Record)

Add [[gsl::Owner]] and [[gsl::Pointer]] attributes for std:: types.

Definition at line 168 of file SemaAttr.cpp.

References addGslOwnerPointerAttributeIfNotExisting(), Context, and inferGslPointerAttribute().

Referenced by ActOnClassTemplateSpecialization(), ActOnTag(), and CheckClassTemplate().

◆ inferGslPointerAttribute() [1/2]

void Sema::inferGslPointerAttribute ( NamedDecl * ND,
CXXRecordDecl * UnderlyingRecord )

Add gsl::Pointer attribute to std::container::iterator.

Parameters
NDThe declaration that introduces the name std::container::iterator.
UnderlyingRecordThe record named by ND.

Definition at line 112 of file SemaAttr.cpp.

References addGslOwnerPointerAttributeIfNotExisting(), Context, clang::Decl::getDeclContext(), and clang::NamedDecl::getName().

Referenced by ActOnTypedefNameDecl(), inferGslOwnerPointerAttribute(), and inferGslPointerAttribute().

◆ inferGslPointerAttribute() [2/2]

void Sema::inferGslPointerAttribute ( TypedefNameDecl * TD)

◆ inferLifetimeBoundAttribute()

void Sema::inferLifetimeBoundAttribute ( FunctionDecl * FD)

◆ inferLifetimeCaptureByAttribute()

void Sema::inferLifetimeCaptureByAttribute ( FunctionDecl * FD)

Add [[clang:::lifetime_capture_by(this)]] to STL container methods.

Definition at line 277 of file SemaAttr.cpp.

References Context, and clang::lifetimes::isGslPointerType().

Referenced by AddKnownFunctionAttributes(), and CheckFunctionDeclaration().

◆ inferNullableClassAttribute()

void Sema::inferNullableClassAttribute ( CXXRecordDecl * CRD)

Add _Nullable attributes for std:: types.

Definition at line 322 of file SemaAttr.cpp.

References Context, clang::NamedDecl::getName(), clang::Decl::hasAttr(), clang::Decl::isInStdNamespace(), clang::Nullable, and clang::TagDecl::redecls().

Referenced by ActOnTag(), and CheckClassTemplate().

◆ Initialize()

void Sema::Initialize ( )

Perform initialization that occurs after the parser has been initialized but before it parses anything.

Definition at line 371 of file Sema.cpp.

References addImplicitTypedef(), clang::OpenCLOptions::addSupport(), clang::Class, Consumer, Context, clang::CPlusPlus, getLangOpts(), clang::LangOptions::getOpenCLCompatibleVersion(), getOpenCLOptions(), IdResolver, ObjC(), OpenCL(), PP, PushOnScopeChains(), TUScope, and VAListTagName.

◆ InitializeExplicitObjectArgument()

◆ InnermostDeclarationWithDelayedImmediateInvocations()

std::optional< ExpressionEvaluationContextRecord::InitializationContext > clang::Sema::InnermostDeclarationWithDelayedImmediateInvocations ( ) const
inline

◆ inParameterMappingSubstitution()

bool clang::Sema::inParameterMappingSubstitution ( ) const
inline

◆ InstantiateAttrs()

void Sema::InstantiateAttrs ( const MultiLevelTemplateArgumentList & TemplateArgs,
const Decl * Pattern,
Decl * Inst,
LateInstantiatedAttrVec * LateAttrs = nullptr,
LocalInstantiationScope * OuterMostScope = nullptr )

◆ InstantiateAttrsForDecl()

void Sema::InstantiateAttrsForDecl ( const MultiLevelTemplateArgumentList & TemplateArgs,
const Decl * Pattern,
Decl * Inst,
LateInstantiatedAttrVec * LateAttrs = nullptr,
LocalInstantiationScope * OuterMostScope = nullptr )

◆ InstantiateClass()

bool Sema::InstantiateClass ( SourceLocation PointOfInstantiation,
CXXRecordDecl * Instantiation,
CXXRecordDecl * Pattern,
const MultiLevelTemplateArgumentList & TemplateArgs,
TemplateSpecializationKind TSK,
bool Complain = true )

Instantiate the definition of a class from a given pattern.

Parameters
PointOfInstantiationThe point of instantiation within the source code.
Instantiationis the declaration whose definition is being instantiated. This will be either a class template specialization or a member class of a class template specialization.
Patternis the pattern from which the instantiation occurs. This will be either the declaration of a class template or the declaration of a member class of a class template.
TemplateArgsThe template arguments to be substituted into the pattern.
TSKthe kind of implicit or explicit instantiation to perform.
Complainwhether to complain if the class cannot be instantiated due to the lack of a definition.
Returns
true if an error occurred, false otherwise.

Definition at line 3421 of file SemaTemplateInstantiate.cpp.

References clang::Sema::RecursiveInstGuard::Template.

Referenced by ActOnExplicitInstantiation(), and InstantiateClassMembers().

◆ InstantiateClassMembers()

void Sema::InstantiateClassMembers ( SourceLocation PointOfInstantiation,
CXXRecordDecl * Instantiation,
const MultiLevelTemplateArgumentList & TemplateArgs,
TemplateSpecializationKind TSK )

Instantiates the definitions of all of the member of the given class, which is an instantiation of a class template or a member class of a template.

Definition at line 4059 of file SemaTemplateInstantiate.cpp.

References CheckFunctionConstraints(), CheckSpecializationInstantiationRedecl(), Consumer, Context, clang::DeclContext::decls(), clang::Enum, clang::DeclContextLookupResult::find_first(), clang::Function, clang::CXXRecordDecl::getDefinition(), clang::EnumDecl::getDefinition(), clang::VarDecl::getDefinition(), clang::CXXRecordDecl::getInstantiatedFromMemberClass(), clang::VarDecl::getInstantiatedFromStaticDataMember(), clang::VarDecl::getMemberSpecializationInfo(), clang::MemberSpecializationInfo::getPointOfInstantiation(), clang::CXXRecordDecl::getTemplateInstantiationPattern(), clang::MemberSpecializationInfo::getTemplateSpecializationKind(), clang::Decl::hasAttr(), InstantiateClass(), InstantiateClassMembers(), InstantiateEnum(), InstantiateFunctionDefinition(), InstantiateInClassInitializer(), InstantiateVariableDefinition(), clang::isa(), clang::CXXRecordDecl::isLocalClass(), clang::ConstraintSatisfaction::IsSatisfied, clang::VarDecl::isStaticDataMember(), clang::DeclContext::lookup(), MarkVTableUsed(), PendingLocalImplicitInstantiations, clang::MemberSpecializationInfo::setPointOfInstantiation(), clang::MemberSpecializationInfo::setTemplateSpecializationKind(), clang::VarDecl::setTemplateSpecializationKind(), clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ExplicitSpecialization, and clang::TSK_ImplicitInstantiation.

Referenced by ActOnExplicitInstantiation(), InstantiateClassMembers(), and InstantiateClassTemplateSpecializationMembers().

◆ InstantiateClassTemplateSpecialization()

◆ InstantiateClassTemplateSpecializationMembers()

void Sema::InstantiateClassTemplateSpecializationMembers ( SourceLocation PointOfInstantiation,
ClassTemplateSpecializationDecl * ClassTemplateSpec,
TemplateSpecializationKind TSK )

Instantiate the definitions of all of the members of the given class template specialization, which was named as part of an explicit instantiation.

Definition at line 4285 of file SemaTemplateInstantiate.cpp.

References getTemplateInstantiationArgs(), and InstantiateClassMembers().

Referenced by ActOnExplicitInstantiation().

◆ InstantiateDefaultArgument()

◆ InstantiateDefaultCtorDefaultArgs()

void Sema::InstantiateDefaultCtorDefaultArgs ( CXXConstructorDecl * Ctor)

In the MS ABI, we need to instantiate default arguments of dllexported default constructors along with the constructor definition.

This allows IR gen to emit a constructor closure which calls the default constructor with its default arguments.

Definition at line 1067 of file SemaTemplateInstantiateDecl.cpp.

References CheckCXXDefaultArgExpr(), CleanupVarDeclMarking(), Context, clang::Decl::getAttr(), clang::Attr::getLocation(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), and clang::CXXConstructorDecl::isDefaultConstructor().

Referenced by ActOnStartOfFunctionDef(), InstantiateFunctionDefinition(), and ReferenceDllExportedMembers().

◆ InstantiateEnum()

bool Sema::InstantiateEnum ( SourceLocation PointOfInstantiation,
EnumDecl * Instantiation,
EnumDecl * Pattern,
const MultiLevelTemplateArgumentList & TemplateArgs,
TemplateSpecializationKind TSK )

Instantiate the definition of an enum from a given pattern.

Parameters
PointOfInstantiationThe point of instantiation within the source code.
Instantiationis the declaration whose definition is being instantiated. This will be a member enumeration of a class temploid specialization, or a local enumeration within a function temploid specialization.
PatternThe templated declaration from which the instantiation occurs.
TemplateArgsThe template arguments to be substituted into the pattern.
TSKThe kind of implicit or explicit instantiation to perform.
Returns
true if an error occurred, false otherwise.

Definition at line 3685 of file SemaTemplateInstantiate.cpp.

References Context, DiagnoseUninstantiableTemplate(), clang::EnumDecl::getDefinition(), clang::EnumDecl::getInstantiatedFromMemberEnum(), clang::EnumDecl::getMemberSpecializationInfo(), InstantiateAttrs(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::Decl::isInvalidDecl(), clang::Sema::ContextRAII::pop(), PotentiallyEvaluated, clang::MemberSpecializationInfo::setPointOfInstantiation(), clang::MemberSpecializationInfo::setTemplateSpecializationKind(), clang::Decl::setVisibleDespiteOwningModule(), and clang::Sema::RecursiveInstGuard::Template.

Referenced by InstantiateClassMembers(), and RequireCompleteEnumDecl().

◆ InstantiateExceptionSpec()

◆ instantiateExplicitSpecifier()

◆ InstantiateFunctionDeclaration()

Instantiate (or find existing instantiation of) a function template with a given set of template arguments.

Usually this should not be used, and template argument deduction should be used in its place.

Definition at line 5517 of file SemaTemplateInstantiateDecl.cpp.

References clang::TemplateArgumentList::asArray(), clang::DeclContext::getParent(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::Sema::InstantiatingTemplate::isInvalid(), and SubstDecl().

Referenced by CheckIfFunctionSpecializationIsImmediate(), DeduceReturnType(), DefineImplicitLambdaToFunctionPointerConversion(), and instantiateOMPDeclareVariantAttr().

◆ InstantiateFunctionDefinition()

void Sema::InstantiateFunctionDefinition ( SourceLocation PointOfInstantiation,
FunctionDecl * Function,
bool Recursive = false,
bool DefinitionRequired = false,
bool AtEndOfTU = false )

Instantiate the definition of the given function from its template.

Parameters
PointOfInstantiationthe point at which the instantiation was required. Note that this is not precisely a "point of instantiation" for the function, but it's close.
Functionthe already-instantiated declaration of a function template specialization or member function of a class template specialization.
Recursiveif true, recursively instantiates any functions that are required by this instantiation.
DefinitionRequiredif true, then we are performing an explicit instantiation where the body of the function is required. Complain if there is no such body.

Definition at line 5533 of file SemaTemplateInstantiateDecl.cpp.

References ActOnFinishFunctionBody(), ActOnSkippedFunctionBody(), ActOnStartOfFunctionDef(), clang::Sema::DefaultedFunctionKind::asSpecialMember(), clang::cast(), Consumer, Context, clang::CopyAssignment, clang::CopyConstructor, clang::CPlusPlus11, CurFPFeatures, clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXConversionFunctionName, clang::DeclarationName::CXXDestructorName, clang::SemaBase::Diag(), DiagnoseUninstantiableTemplate(), ExprEvalContexts, ExternalSource, FpPragmaStack, clang::Function, clang::ActionResult< PtrTy, Compress >::get(), getASTMutationListener(), clang::DeclaratorDecl::getBeginLoc(), clang::TypeLoc::getBeginLoc(), clang::FunctionDecl::getBody(), clang::Type::getContainedAutoType(), clang::Decl::getDeclContext(), getDefaultedFunctionKind(), clang::FunctionDecl::getDefinition(), getDefinition(), getDiagnostics(), clang::Decl::getEndLoc(), clang::DeclarationNameInfo::getInfo(), clang::DeclaratorDecl::getInnerLocStart(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::DeclarationNameInfo::getName(), clang::DeclarationNameInfo::getNamedTypeInfo(), clang::FunctionDecl::getNameInfo(), clang::DeclarationName::getNameKind(), clang::TagTypeLoc::getNameLoc(), clang::Decl::getPreviousDecl(), getPrintingPolicy(), clang::FunctionDecl::getReturnType(), getSourceManager(), getTemplateInstantiationArgs(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), clang::InheritingConcreteTypeLoc< Base, Derived, TypeClass >::getTypePtr(), clang::DeclaratorDecl::getTypeSourceInfo(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::FunctionDecl::hasSkippedBody(), InstantiateDefaultCtorDefaultArgs(), InstantiateMemInitializers(), clang::isa(), clang::FunctionDecl::isDefaulted(), clang::Decl::isFromASTFile(), clang::isGenericLambdaCallOperatorOrStaticInvokerSpecialization(), clang::FunctionDecl::isInlined(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::FunctionDecl::isLateTemplateParsed(), clang::FunctionDecl::isThisDeclarationADefinition(), clang::FunctionDecl::isThisDeclarationInstantiatedFromAFriendDefinition(), LateParsedInstantiations, LateParsedTemplateMap, LateTemplateParser, clang::DeclarationNameLoc::makeNamedTypeLoc(), clang::Method, clang::MoveAssignment, clang::MoveConstructor, clang::None, OpaqueParser, OS, PendingInstantiations, clang::Sema::LocalEagerInstantiationScope::perform(), PerformDependentDiagnostics(), clang::Sema::ContextRAII::pop(), PotentiallyEvaluated, clang::TypeLocBuilder::push(), clang::TypeLocBuilder::pushTrivial(), clang::Result, Sema(), clang::SemaBase::SemaRef, SetDeclDefaulted(), clang::TagTypeLoc::setElaboratedKeywordLoc(), clang::TagTypeLoc::setNameLoc(), clang::TagTypeLoc::setQualifierLoc(), clang::ValueDecl::setType(), clang::DeclaratorDecl::setTypeSourceInfo(), SourceMgr, SubstQualifier(), SubstStmt(), clang::T, clang::Sema::RecursiveInstGuard::Template, clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, updateAttrsForLateParsedTemplate(), and clang::FunctionDecl::willHaveBody().

Referenced by ActOnExplicitInstantiation(), CheckIfFunctionSpecializationIsImmediate(), CheckPlaceholderExpr(), DeduceReturnType(), InstantiateClassMembers(), instantiateOMPDeclareVariantAttr(), MarkFunctionReferenced(), and PerformPendingInstantiations().

◆ InstantiateInClassInitializer()

bool Sema::InstantiateInClassInitializer ( SourceLocation PointOfInstantiation,
FieldDecl * Instantiation,
FieldDecl * Pattern,
const MultiLevelTemplateArgumentList & TemplateArgs )

Instantiate the definition of a field from the given pattern.

Parameters
PointOfInstantiationThe point of instantiation within the source code.
Instantiationis the declaration whose definition is being instantiated. This will be a class of a class temploid specialization, or a local enumeration within a function temploid specialization.
PatternThe templated declaration from which the instantiation occurs.
TemplateArgsThe template arguments to be substituted into the pattern.
Returns
true if an error occurred, false otherwise.

Definition at line 3740 of file SemaTemplateInstantiate.cpp.

References ActOnFinishCXXInClassMemberInitializer(), ActOnStartCXXInClassMemberInitializer(), Context, CurContext, Diag(), ExprEvalContexts, clang::ActionResult< PtrTy, Compress >::get(), getASTMutationListener(), clang::FieldDecl::getInClassInitializer(), clang::FieldDecl::getInClassInitStyle(), clang::DeclContext::getOuterLexicalRecordContext(), clang::FieldDecl::getParent(), clang::FieldDecl::hasInClassInitializer(), clang::Init, clang::isa(), clang::Sema::InstantiatingTemplate::isInvalid(), PotentiallyEvaluated, clang::Decl::setInvalidDecl(), SubstInitializer(), and clang::Sema::RecursiveInstGuard::Template.

Referenced by BuildCXXDefaultInitExpr(), and InstantiateClassMembers().

◆ InstantiateMemInitializers()

◆ InstantiateVariableDefinition()

void Sema::InstantiateVariableDefinition ( SourceLocation PointOfInstantiation,
VarDecl * Var,
bool Recursive = false,
bool DefinitionRequired = false,
bool AtEndOfTU = false )

Instantiate the definition of the given variable from its template.

Parameters
PointOfInstantiationthe point at which the instantiation was required. Note that this is not precisely a "point of instantiation" for the variable, but it's close.
Varthe already-instantiated declaration of a templated variable.
Recursiveif true, recursively instantiates any functions that are required by this instantiation.
DefinitionRequiredif true, then we are performing an explicit instantiation where a definition of the variable is required. Complain if there is no such definition.

Definition at line 6276 of file SemaTemplateInstantiateDecl.cpp.

References clang::TemplateArgumentListInfo::addArgument(), AnalysisWarnings, clang::TemplateArgumentList::asArray(), clang::cast(), CompleteVarTemplateSpecializationDecl(), Consumer, Context, clang::CPlusPlus11, clang::SemaBase::Diag(), DiagnoseUninstantiableTemplate(), getASTContext(), clang::DeclaratorDecl::getBeginLoc(), clang::Decl::getDeclContext(), clang::VarDecl::getDefinition(), getDiagnostics(), clang::Redeclarable< decl_type >::getFirstDecl(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::VarDecl::getPointOfInstantiation(), getSourceManager(), clang::VarTemplateSpecializationDecl::getSpecializedTemplate(), clang::VarTemplateSpecializationDecl::getSpecializedTemplateOrPartial(), clang::VarTemplateSpecializationDecl::getTemplateArgs(), clang::VarTemplateSpecializationDecl::getTemplateArgsAsWritten(), getTemplateInstantiationArgs(), clang::VarTemplateSpecializationDecl::getTemplateInstantiationArgs(), clang::VarDecl::getTemplateInstantiationPattern(), clang::VarDecl::getTemplateSpecializationKind(), clang::VarDecl::getTemplateSpecializationKindForInstantiation(), clang::VarDecl::hasInit(), InstantiateVariableInitializer(), clang::Sema::InstantiatingTemplate::isInvalid(), clang::Decl::isInvalidDecl(), clang::VarDecl::isOutOfLine(), clang::DeclContext::isRecord(), clang::VarDecl::isStaticDataMember(), clang::VarDecl::mightBeUsableInConstantExpressions(), PendingInstantiations, clang::Sema::GlobalEagerInstantiationScope::perform(), clang::Sema::LocalEagerInstantiationScope::perform(), clang::Sema::ContextRAII::pop(), clang::TemplateArgumentListInfo::setLAngleLoc(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::VarTemplateSpecializationDecl::setTemplateArgsAsWritten(), clang::VarDecl::setTemplateSpecializationKind(), clang::Decl::setVisibleDespiteOwningModule(), SubstDecl(), clang::Sema::RecursiveInstGuard::Template, clang::TSK_ExplicitInstantiationDeclaration, clang::TSK_ExplicitInstantiationDefinition, clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, and clang::TemplateDeclInstantiator::VisitVarTemplateSpecializationDecl().

Referenced by ActOnExplicitInstantiation(), completeExprArrayBound(), DoMarkVarDeclReferenced(), InstantiateClassMembers(), and PerformPendingInstantiations().

◆ InstantiateVariableInitializer()

void Sema::InstantiateVariableInitializer ( VarDecl * Var,
VarDecl * OldVar,
const MultiLevelTemplateArgumentList & TemplateArgs )

◆ inTemplateInstantiation()

◆ InvalidLogicalVectorOperands()

QualType Sema::InvalidLogicalVectorOperands ( SourceLocation Loc,
ExprResult & LHS,
ExprResult & RHS )

Diagnose cases where a scalar was implicitly converted to a vector and diagnose the underlying types.

Otherwise, diagnose the error as invalid vector logical operands for non-C++ cases.

Definition at line 10170 of file SemaExpr.cpp.

References clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::IgnoreImpCasts(), clang::Type::isVectorType(), and clang::Vector.

Referenced by CheckVectorLogicalOperands().

◆ InvalidOperands()

◆ InventAbbreviatedTemplateParameterTypeName()

IdentifierInfo * Sema::InventAbbreviatedTemplateParameterTypeName ( const IdentifierInfo * ParamName,
unsigned Index )

Invent a new identifier for parameters of abbreviated templates.

Definition at line 139 of file Sema.cpp.

References Context, clang::IdentifierInfo::getName(), and OS.

Referenced by InventTemplateParameter().

◆ isAbstractType()

◆ isAcceptable()

bool clang::Sema::isAcceptable ( const NamedDecl * D,
AcceptableKind Kind )
inline

Determine whether a declaration is acceptable (visible/reachable).

Definition at line 15508 of file Sema.h.

References isReachable(), isVisible(), and Visible.

Referenced by hasAcceptableDeclarationImpl(), hasAcceptableDefaultArgument(), and hasAcceptableDefinition().

◆ isAcceptableNestedNameSpecifier()

bool Sema::isAcceptableNestedNameSpecifier ( const NamedDecl * SD,
bool * CanCorrect = nullptr )

Determines whether the given declaration is an valid acceptable result for name lookup of a nested-name-specifier.

Parameters
SDDeclaration checked for nested-name-specifier.
IsExtensionIf not null and the declaration is accepted as an extension, the pointed variable is assigned true.

Definition at line 305 of file SemaCXXScopeSpec.cpp.

References clang::cast(), Context, clang::NamedDecl::getUnderlyingDecl(), and clang::isa().

Referenced by BuildCXXNestedNameSpecifier(), and FindFirstQualifierInScope().

◆ isAcceptableTagRedeclaration()

bool Sema::isAcceptableTagRedeclaration ( const TagDecl * Previous,
TagTypeKind NewTag,
bool isDefinition,
SourceLocation NewTagLoc,
const IdentifierInfo * Name )

◆ isAlwaysConstantEvaluatedContext()

◆ IsAssignConvertCompatible()

◆ IsAtLeastAsConstrained()

bool Sema::IsAtLeastAsConstrained ( const NamedDecl * D1,
MutableArrayRef< AssociatedConstraint > AC1,
const NamedDecl * D2,
MutableArrayRef< AssociatedConstraint > AC2,
bool & Result )

Check whether the given declaration's associated constraints are at least as constrained than another declaration's according to the partial ordering of constraints.

Parameters
ResultIf no error occurred, receives the result of true if D1 is at least constrained than D2, and false otherwise.
Returns
true if an error occurred, false otherwise.

Definition at line 2493 of file SemaConcept.cpp.

References CalculateTemplateDepthForConstraints(), clang::FunctionDecl::getTemplatedKind(), clang::Result, clang::SubsumptionChecker::Subsumes(), clang::FunctionDecl::TK_FunctionTemplate, and clang::FunctionDecl::TK_NonTemplate.

Referenced by CheckTemplateTemplateArgument(), getMoreConstrainedFunction(), getMoreSpecialized(), getMoreSpecializedTemplate(), and SetEligibleMethods().

◆ isAttrContext()

bool clang::Sema::isAttrContext ( ) const
inline

◆ IsBlockPointerConversion()

◆ isCast()

bool clang::Sema::isCast ( CheckedConversionKind CCK)
inlinestatic

◆ isCheckingDefaultArgumentOrInitializer()

◆ isCompleteType()

◆ IsComplexPromotion()

bool Sema::IsComplexPromotion ( QualType FromType,
QualType ToType )

Determine if a conversion is a complex promotion.

A complex promotion is defined as a complex -> complex conversion where the conversion between the underlying real types is a floating-point or integral promotion.

Definition at line 2895 of file SemaOverload.cpp.

References clang::Type::getAs(), clang::ComplexType::getElementType(), IsFloatingPointPromotion(), and IsIntegralPromotion().

Referenced by IsStandardConversion().

◆ isConstantEvaluatedContext()

◆ isCurrentClassName()

bool Sema::isCurrentClassName ( const IdentifierInfo & II,
Scope * S,
const CXXScopeSpec * SS = nullptr )

isCurrentClassName - Determine whether the identifier II is the name of the class type currently being defined.

In the case of nested classes, this will only return true if II is the name of the innermost class.

Definition at line 2705 of file SemaDeclCXX.cpp.

References getCurrentClass(), and clang::NamedDecl::getIdentifier().

Referenced by ClassifyName().

◆ isCurrentClassNameTypo()

bool Sema::isCurrentClassNameTypo ( IdentifierInfo *& II,
const CXXScopeSpec * SS )

Determine whether the identifier II is a typo for the name of the class type currently being defined.

If so, update it to the identifier that should have been used.

Definition at line 2711 of file SemaDeclCXX.cpp.

References computeDeclContext(), clang::CPlusPlus, CurContext, clang::NamedDecl::getIdentifier(), getLangOpts(), clang::IdentifierInfo::getLength(), clang::IdentifierInfo::getName(), clang::CXXScopeSpec::isInvalid(), and clang::CXXScopeSpec::isSet().

◆ IsCXXTriviallyRelocatableType() [1/2]

◆ IsCXXTriviallyRelocatableType() [2/2]

◆ isDeclaratorFunctionLike()

◆ isDeclInScope()

bool Sema::isDeclInScope ( NamedDecl * D,
DeclContext * Ctx,
Scope * S = nullptr,
bool AllowInlineNamespace = false ) const

isDeclInScope - If 'Ctx' is a function/method, isDeclInScope returns true if 'D' is in Scope 'S', otherwise 'S' is ignored and isDeclInScope returns true if 'D' belongs to the given declaration context.

Parameters
AllowInlineNamespaceIf true, allow the declaration to be in the enclosing namespace set of the context, rather than contained directly within it.

Definition at line 1621 of file SemaDecl.cpp.

References IdResolver.

Referenced by ActOnDecompositionDeclarator(), ActOnEnumConstant(), ActOnExceptionDeclarator(), ActOnTag(), ActOnVariableDeclarator(), CheckAnonMemberRedeclaration(), CheckClassTemplate(), FilterLookupForScope(), FilterUsingLookup(), HandleField(), HandleMSProperty(), and MergeCXXFunctionDecl().

◆ isDeductionGuideName()

◆ isDependentScopeSpecifier()

◆ IsDerivedFrom() [1/4]

bool Sema::IsDerivedFrom ( SourceLocation Loc,
CXXRecordDecl * Derived,
CXXRecordDecl * Base )

Definition at line 3072 of file SemaDeclCXX.cpp.

References IsDerivedFrom().

◆ IsDerivedFrom() [2/4]

◆ IsDerivedFrom() [3/4]

bool Sema::IsDerivedFrom ( SourceLocation Loc,
QualType Derived,
QualType Base )

Definition at line 3079 of file SemaDeclCXX.cpp.

References clang::Type::getAsCXXRecordDecl(), and IsDerivedFrom().

◆ IsDerivedFrom() [4/4]

bool Sema::IsDerivedFrom ( SourceLocation Loc,
QualType Derived,
QualType Base,
CXXBasePaths & Paths )

Definition at line 3086 of file SemaDeclCXX.cpp.

References clang::Type::getAsCXXRecordDecl(), and IsDerivedFrom().

◆ isEquivalentInternalLinkageDeclaration()

bool Sema::isEquivalentInternalLinkageDeclaration ( const NamedDecl * A,
const NamedDecl * B )

Determine if A and B are equivalent internal linkage declarations from different modules, and thus an ambiguity error can be downgraded to an extension warning.

Determine whether two declarations are "equivalent" for the purposes of name lookup and overload resolution.

This applies when the same internal/no linkage entity is defined by two modules (probably by textually including the same header). In such a case, we don't consider the declarations to declare the same entity, but we also don't want lookups with both declarations visible to be ambiguous in some cases (this happens when using a modularized libstdc++).

Definition at line 11177 of file SemaOverload.cpp.

References clang::cast(), Context, and getOwningModule().

Referenced by CheckUsingShadowDecl().

◆ isExternalWithNoLinkageType()

bool Sema::isExternalWithNoLinkageType ( const ValueDecl * VD) const

Determine if VD, which must be a variable or function, is an external symbol that nonetheless can't be referenced from outside this translation unit because its type has no linkage and it's not extern "C".

Determine whether ND is an external-linkage function or variable whose type has no linkage.

Definition at line 935 of file Sema.cpp.

References getLangOpts(), clang::Type::getLinkage(), clang::ValueDecl::getType(), clang::NamedDecl::hasExternalFormalLinkage(), clang::isExternalFormalLinkage(), and isFunctionOrVarDeclExternC().

Referenced by checkUndefinedButUsed(), getUndefinedButUsed(), MarkFunctionReferenced(), and MarkVarDeclODRUsed().

◆ IsFloatingPointPromotion()

bool Sema::IsFloatingPointPromotion ( QualType FromType,
QualType ToType )

IsFloatingPointPromotion - Determines whether the conversion from FromType to ToType is a floating point promotion (C++ 4.6).

If so, returns true and sets PromotedType to the promoted type.

An rvalue of type float can be converted to an rvalue of type double. (C++ 4.6p1).

Definition at line 2858 of file SemaOverload.cpp.

References clang::CPlusPlus, clang::Type::getAs(), getLangOpts(), and HLSL().

Referenced by IsComplexPromotion(), IsStandardConversion(), and IsVectorOrMatrixElementConversion().

◆ IsFunctionConversion()

bool Sema::IsFunctionConversion ( QualType FromType,
QualType ToType ) const

Determine whether the conversion from FromType to ToType is a valid conversion of ExtInfo/ExtProtoInfo on the nested function type.

More precisely, this method checks whether FromType can be transformed into an exact match for ToType, by transforming its extended function type information in legal manner (e.g. by strictly stripping "noreturn" or "noexcept", or by stripping "noescape" for arguments).

Definition at line 1914 of file SemaOverload.cpp.

References clang::cast(), clang::CanQual< T >::castAs(), Context, clang::declaresSameEntity(), clang::EST_None, clang::FunctionProtoType::ExtProtoInfo::ExtParameterInfos, clang::FunctionProtoType::ExtProtoInfo::FunctionEffects, clang::Type::getAs(), clang::MemberPointerType::getMostRecentCXXRecordDecl(), clang::FunctionType::ExtInfo::getNoReturn(), clang::MemberPointerType::getPointeeType(), getPointeeType(), clang::QualType::getTypePtr(), clang::nullptr, and clang::FunctionType::ExtInfo::withNoReturn().

Referenced by BuildExpressionFromDeclTemplateArgument(), CheckOriginalCallArgDeduction(), checkPointerTypesForAssignment(), CompareReferenceRelationship(), handlerCanCatch(), IsStandardConversion(), and TryFunctionConversion().

◆ isImmediateFunctionContext()

bool clang::Sema::isImmediateFunctionContext ( ) const
inline

◆ isImplicitlyDeleted()

bool Sema::isImplicitlyDeleted ( FunctionDecl * FD)

Determine whether the given function is an implicitly-deleted special member function.

Definition at line 16120 of file SemaDeclCXX.cpp.

References clang::isa(), clang::FunctionDecl::isDefaulted(), and clang::FunctionDecl::isDeleted().

Referenced by CreateOverloadedBinOp(), and clang::InitializationSequence::Diagnose().

◆ isIncompatibleTypedef()

◆ isInitListConstructor()

bool Sema::isInitListConstructor ( const FunctionDecl * Ctor)

◆ isInLifetimeExtendingContext()

bool clang::Sema::isInLifetimeExtendingContext ( ) const
inline

◆ IsInsideALocalClassWithinATemplateFunction()

◆ IsIntegralPromotion()

◆ IsInvalidSMECallConversion()

bool Sema::IsInvalidSMECallConversion ( QualType FromType,
QualType ToType )

◆ IsInvalidUnlessNestedName()

bool Sema::IsInvalidUnlessNestedName ( Scope * S,
CXXScopeSpec & SS,
NestedNameSpecInfo & IdInfo,
bool EnteringContext )

IsInvalidUnlessNestedName - This method is used for error recovery purposes to determine whether the specified identifier is only valid as a nested name specifier, for example a namespace name.

It is conservatively correct to always return false from this method.

The arguments are the same as those passed to ActOnCXXNestedNameSpecifier.

Definition at line 881 of file SemaCXXScopeSpec.cpp.

References BuildCXXNestedNameSpecifier(), and clang::CXXScopeSpec::isInvalid().

◆ isLaxVectorConversion()

bool Sema::isLaxVectorConversion ( QualType srcType,
QualType destType )

◆ IsLayoutCompatible()

bool Sema::IsLayoutCompatible ( QualType T1,
QualType T2 ) const

Definition at line 15946 of file SemaChecking.cpp.

References getASTContext(), and isLayoutCompatible().

◆ isLibstdcxxEagerExceptionSpecHack()

bool clang::Sema::isLibstdcxxEagerExceptionSpecHack ( const Declarator & D)

Determine if we're in a case where we need to (incorrectly) eagerly parse an exception specification to work around a libstdc++ bug.

HACK: 2014-11-14 libstdc++ had a bug where it shadows std::swap with a member swap function then tries to call std::swap unqualified from the exception specification of that function.

This function detects whether we're in such a case and turns off delay-parsing of exception specifications. Libstdc++ 6.1 (released 2016-04-27) appears to have resolved it as side-effect of commit ddb63209a8d (2015-06-05).

Definition at line 45 of file SemaExceptionSpec.cpp.

References Context, CurContext, clang::Declarator::getBeginLoc(), clang::Declarator::getIdentifier(), getPreprocessor(), and clang::IdentifierInfo::isStr().

◆ isMemberAccessibleForDeletion() [1/2]

bool clang::Sema::isMemberAccessibleForDeletion ( CXXRecordDecl * NamingClass,
DeclAccessPair Found,
QualType ObjectType )
inline

Definition at line 1778 of file Sema.h.

References clang::Found, isMemberAccessibleForDeletion(), and clang::SemaBase::PDiag().

◆ isMemberAccessibleForDeletion() [2/2]

bool Sema::isMemberAccessibleForDeletion ( CXXRecordDecl * NamingClass,
DeclAccessPair Found,
QualType ObjectType,
SourceLocation Loc,
const PartialDiagnostic & Diag )

Is the given member accessible for the purposes of deciding whether to define a special member function as deleted?

Definition at line 1600 of file SemaAccess.cpp.

References AR_accessible, AR_delayed, AR_dependent, AR_inaccessible, clang::AS_public, CheckAccess(), Context, clang::SemaBase::Diag(), clang::Found, and getLangOpts().

Referenced by isMemberAccessibleForDeletion().

◆ IsMemberPointerConversion()

bool Sema::IsMemberPointerConversion ( Expr * From,
QualType FromType,
QualType ToType,
bool InOverloadResolution,
QualType & ConvertedType )

IsMemberPointerConversion - Determines whether the conversion of the expression From, which has the (possibly adjusted) type FromType, can be converted to the type ToType via a member pointer conversion (C++ 4.11).

If so, returns true and places the converted type (that might differ from ToType in its cv-qualifiers at some level) into ConvertedType.

Definition at line 3649 of file SemaOverload.cpp.

References Context, clang::declaresSameEntity(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::MemberPointerType::getMostRecentCXXRecordDecl(), clang::MemberPointerType::getPointeeType(), clang::MemberPointerType::getQualifier(), IsDerivedFrom(), clang::Expr::isNullPointerConstant(), clang::Expr::NPC_ValueDependentIsNotNull, and clang::Expr::NPC_ValueDependentIsNull.

Referenced by IsStandardConversion().

◆ isMicrosoftMissingTypename()

bool Sema::isMicrosoftMissingTypename ( const CXXScopeSpec * SS,
Scope * S )

isMicrosoftMissingTypename - In Microsoft mode, within class scope, if a CXXScopeSpec's type is equal to the type of one of the base classes then downgrade the missing typename error to a warning.

This is needed for MSVC compatibility; Example:

template<class T> class A {
public:
typedef int TYPE;
};
template<class T> class B : public A<T> {
public:
A<T>::TYPE a; // no typename required because A<T> is a base class.
};
#define TYPE(DERIVED, BASE)
Definition ASTFwd.h:26

Definition at line 699 of file SemaDecl.cpp.

References clang::cast(), Context, CurContext, clang::NestedNameSpecifier::getAsType(), clang::NestedNameSpecifier::getKind(), clang::CXXScopeSpec::getScopeRep(), clang::Scope::isFunctionPrototypeScope(), clang::NestedNameSpecifier::MicrosoftSuper, clang::T, and clang::NestedNameSpecifier::Type.

Referenced by DiagnoseUnknownTypeName().

◆ isModuleVisible()

◆ isMoreSpecializedThanPrimary() [1/2]

◆ isMoreSpecializedThanPrimary() [2/2]

◆ isObjCPointerConversion()

◆ IsOverload()

bool Sema::IsOverload ( FunctionDecl * New,
FunctionDecl * Old,
bool UseMemberUsingDeclRules,
bool ConsiderCudaAttrs = true )

◆ IsOverride()

bool Sema::IsOverride ( FunctionDecl * MD,
FunctionDecl * BaseMD,
bool UseMemberUsingDeclRules,
bool ConsiderCudaAttrs = true )

Definition at line 1649 of file SemaOverload.cpp.

References IsOverloadOrOverrideImpl().

Referenced by AddOverriddenMethods().

◆ IsPointerConversion()

bool Sema::IsPointerConversion ( Expr * From,
QualType FromType,
QualType ToType,
bool InOverloadResolution,
QualType & ConvertedType,
bool & IncompatibleObjC )

IsPointerConversion - Determines whether the conversion of the expression From, which has the (possibly adjusted) type FromType, can be converted to the type ToType via a pointer conversion (C++ 4.10).

If so, returns true and places the converted type (that might differ from ToType in its cv-qualifiers at some level) into ConvertedType.

This routine also supports conversions to and from block pointers and conversions with Objective-C's 'id', 'id<protocols...>', and pointers to interfaces. FIXME: Once we've determined the appropriate overloading rules for Objective-C, we may want to split the Objective-C checks into a different routine; however, GCC seems to consider all of these conversions to be pointer conversions, so for now they live here. IncompatibleObjC will be set if the conversion is an allowed Objective-C conversion that should result in a warning.

Definition at line 2973 of file SemaOverload.cpp.

References BuildSimilarlyQualifiedPointerType(), clang::Type::castAs(), Context, clang::CPlusPlus, clang::Type::getAs(), clang::Stmt::getBeginLoc(), getLangOpts(), clang::PointerType::getPointeeType(), clang::Type::isBlockPointerType(), IsDerivedFrom(), clang::Type::isFunctionType(), clang::Type::isIncompleteOrObjectType(), isNullPointerConstantForConversion(), clang::Type::isNullPtrType(), clang::Type::isObjCObjectPointerType(), isObjCPointerConversion(), clang::Type::isPointerType(), clang::Type::isRecordType(), clang::Type::isVectorType(), and clang::Type::isVoidType().

Referenced by IsStandardConversion().

◆ IsPointerInterconvertibleBaseOf()

◆ isPotentialImplicitMemberAccess()

◆ isPreciseFPEnabled()

bool clang::Sema::isPreciseFPEnabled ( )
inline

Are precise floating point semantics currently enabled?

Definition at line 2217 of file Sema.h.

References CurFPFeatures.

Referenced by ActOnPragmaFEnvAccess(), and ActOnPragmaFloatControl().

◆ IsQualificationConversion()

bool Sema::IsQualificationConversion ( QualType FromType,
QualType ToType,
bool CStyle,
bool & ObjCLifetimeConversion )

IsQualificationConversion - Determines whether the conversion from an rvalue of type FromType to ToType is a qualification conversion (C++ 4.4).

Parameters
ObjCLifetimeConversionOutput parameter that will be set to indicate when the qualification conversion involves a change in the Objective-C object lifetime.

Definition at line 3881 of file SemaOverload.cpp.

References Context, getASTContext(), clang::QualType::getUnqualifiedType(), and isQualificationConversionStep().

Referenced by CheckOriginalCallArgDeduction(), CheckTemplateArgumentIsCompatibleWithParameter(), CheckTemplateArgumentPointerToMember(), CompareQualificationConversions(), handlerCanCatch(), isAllowableExplicitConversion(), isNullPointerValueTemplateArgument(), and IsStandardConversion().

◆ isQualifiedMemberAccess()

bool Sema::isQualifiedMemberAccess ( Expr * E)

Determine whether the given expression is a qualified member access expression, of a form that could be turned into a pointer to member with the address-of operator.

Definition at line 16190 of file SemaExpr.cpp.

References clang::isa(), clang::NamedDecl::isCXXClassMember(), and clang::Method.

Referenced by BuildUnaryOp().

◆ isReachable()

bool clang::Sema::isReachable ( const NamedDecl * D)
inline

Determine whether a declaration is reachable.

Definition at line 15501 of file Sema.h.

References clang::Decl::isUnconditionallyVisible(), and Reachable.

Referenced by ArgumentDependentLookup(), hasReachableDeclaration(), hasReachableDeclarationSlow(), isAcceptable(), and IsRedefinitionInModule().

◆ isRedefinitionAllowedFor() [1/2]

bool clang::Sema::isRedefinitionAllowedFor ( const NamedDecl * D,
bool & Visible )
inline

Definition at line 15529 of file Sema.h.

References isRedefinitionAllowedFor(), and Visible.

◆ isRedefinitionAllowedFor() [2/2]

bool Sema::isRedefinitionAllowedFor ( NamedDecl * D,
NamedDecl ** Suggested,
bool & Visible )

Determine if D has a definition which allows we redefine it in current TU.

Suggested is the definition that should be made visible to expose the definition.

Definition at line 21129 of file SemaDecl.cpp.

References hasVisibleDefinition(), clang::Decl::isInAnotherModuleUnit(), and Visible.

Referenced by ActOnClassTemplateSpecialization(), ActOnTag(), CheckClassTemplate(), CheckForFunctionRedefinition(), and isRedefinitionAllowedFor().

◆ IsRedefinitionInModule()

bool Sema::IsRedefinitionInModule ( const NamedDecl * New,
const NamedDecl * Old ) const

Check the redefinition in C++20 Modules.

[basic.def.odr]p14: For any definable item D with definitions in multiple translation units,

  • if D is a non-inline non-templated function or variable, or
  • if the definitions in different translation units do not satisfy the following requirements, the program is ill-formed; a diagnostic is required only if the definable item is attached to a named module and a prior definition is reachable at the point where a later definition occurs.
  • Each such definition shall not be attached to a named module ([module.unit]).
  • Each such definition shall consist of the same sequence of tokens, ... ...

Return true if the redefinition is not allowed. Return false otherwise.

Definition at line 1794 of file SemaDecl.cpp.

References getASTContext(), clang::Decl::getOwningModule(), clang::Module::getTopLevelModule(), clang::Module::isHeaderLikeModule(), clang::Module::isNamedModule(), isReachable(), New, and Sema().

Referenced by CheckConceptRedefinition().

◆ isSameOrCompatibleFunctionType()

bool Sema::isSameOrCompatibleFunctionType ( QualType Param,
QualType Arg )

Compare types for equality with respect to possibly compatible function types (noreturn adjustment, implicit calling conventions).

If any of parameter and argument is not a function, just perform type comparison.

Parameters
Pthe template parameter type.
Athe argument type.

Definition at line 1408 of file SemaTemplateDeduction.cpp.

References Context, clang::Type::getAs(), and TryFunctionConversion().

Referenced by DeduceTemplateArguments(), DeduceTemplateArgumentsByTypeMatch(), ResolveOverloadForDeduction(), and ResolveSingleFunctionTemplateSpecialization().

◆ isSFINAEContext()

◆ IsSimplyAccessible()

bool Sema::IsSimplyAccessible ( NamedDecl * Decl,
CXXRecordDecl * NamingClass,
QualType BaseType )

Checks access to Target from the given class.

The check will take access specifiers into account, but no member access expressions and such.

Parameters
Targetthe declaration to check if it can be accessed
NamingClassthe class in which the lookup was started.
BaseTypetype of the left side of member access expression. BaseType and NamingClass are used for C++ access control. Depending on the lookup case, they should be set to the following:
  • lhs.target (member access without a qualifier): BaseType and NamingClass are both the type of 'lhs'.
  • lhs.X::target (member access with a qualifier): BaseType is the type of 'lhs', NamingClass is 'X'
  • X::target (qualified lookup without member access): BaseType is null, NamingClass is 'X'.
  • target (unqualified lookup). BaseType is null, NamingClass is the parent class of 'target'.
Returns
true if the Target is accessible from the Class, false otherwise.

Definition at line 1923 of file SemaAccess.cpp.

References AR_inaccessible, clang::AS_none, Context, clang::CPlusPlus, CurContext, clang::declaresSameEntity(), getCurFunctionDecl(), getCurMethodDecl(), getLangOpts(), clang::ObjCInterfaceDecl::isSuperClassOf(), clang::DeclAccessPair::make(), clang::sema::AccessedEntity::Member, clang::ObjCIvarDecl::Package, clang::ObjCIvarDecl::Private, clang::ObjCIvarDecl::Public, and clang::Target.

◆ isStdInitializerList()

bool Sema::isStdInitializerList ( QualType Ty,
QualType * Element )

Tests whether Ty is an instance of std::initializer_list and, if it is and Element is not NULL, assigns the element type to Element.

Definition at line 12301 of file SemaDeclCXX.cpp.

References clang::CPlusPlus, getLangOpts(), isStdClassTemplate(), and StdInitializerList.

Referenced by CompareImplicitConversionSequences(), DeduceFromInitializerList(), diagnoseListInit(), isInitListConstructor(), clang::InitializationSequence::Perform(), TryInitializerListConstruction(), TryListConversion(), and TryListInitialization().

◆ isStdTypeIdentity()

bool Sema::isStdTypeIdentity ( QualType Ty,
QualType * TypeArgument,
const Decl ** MalformedDecl = nullptr )

Tests whether Ty is an instance of std::type_identity and, if it is and TypeArgument is not NULL, assigns the element type to Element.

If MalformedDecl is not null, and type_identity was ruled out due to being incorrectly structured despite having the correct name, the faulty Decl will be assigned to MalformedDecl.

Definition at line 12312 of file SemaDeclCXX.cpp.

References clang::CPlusPlus, getLangOpts(), isStdClassTemplate(), and StdTypeIdentity.

Referenced by IsPotentiallyTypeAwareOperatorNewOrDelete(), and resolveAllocationOverload().

◆ IsStringInit()

bool Sema::IsStringInit ( Expr * Init,
const ArrayType * AT )

Definition at line 170 of file SemaInit.cpp.

References Context, clang::Init, and SIF_None.

Referenced by TryListConversion().

◆ IsStringLiteralToNonConstPointerConversion()

bool Sema::IsStringLiteralToNonConstPointerConversion ( Expr * From,
QualType ToType )

Helper function to determine whether this is the (deprecated) C++ conversion from a string literal to a pointer to non-const char or non-const wchar_t (for narrow and wide string literals, respectively).

Definition at line 4488 of file SemaExprCXX.cpp.

References clang::Binary, Context, clang::Type::getAs(), clang::Type::getPointeeType(), clang::Expr::IgnoreParens(), clang::Ordinary, clang::Unevaluated, clang::UTF16, clang::UTF32, clang::UTF8, and clang::Wide.

Referenced by DiagnoseAssignmentResult(), and IsStandardConversion().

◆ isTagName()

DeclSpec::TST Sema::isTagName ( IdentifierInfo & II,
Scope * S )

isTagName() - This method is called for error recovery purposes only to determine if the specified name is a valid tag name ("struct foo").

If so, this returns the TST for the tag corresponding to it (TST_enum, TST_union, TST_struct, TST_interface, TST_class). This is used to diagnose cases in C where the user forgot to specify the tag.

Definition at line 675 of file SemaDecl.cpp.

References clang::Class, clang::Enum, clang::Found, clang::LookupResult::getAsSingle(), clang::LookupResult::getResultKind(), clang::Interface, LookupName(), LookupTagName, clang::Struct, clang::LookupResult::suppressDiagnostics(), clang::DeclSpec::TST_class, clang::DeclSpec::TST_enum, clang::DeclSpec::TST_interface, clang::DeclSpec::TST_struct, clang::DeclSpec::TST_union, clang::DeclSpec::TST_unspecified, and clang::Union.

◆ isTemplateName()

TemplateNameKind Sema::isTemplateName ( Scope * S,
CXXScopeSpec & SS,
bool hasTemplateKeyword,
const UnqualifiedId & Name,
ParsedType ObjectType,
bool EnteringContext,
TemplateTy & Template,
bool & MemberOfUnknownSpecialization,
bool Disambiguation = false )

◆ isTemplateTemplateParameterAtLeastAsSpecializedAs()

bool Sema::isTemplateTemplateParameterAtLeastAsSpecializedAs ( TemplateParameterList * PParam,
TemplateDecl * PArg,
TemplateDecl * AArg,
const DefaultArguments & DefaultArgs,
SourceLocation ArgLoc,
bool PartialOrdering,
bool * StrictPackMatch )

Definition at line 6483 of file SemaTemplateDeduction.cpp.

References clang::TemplateArgumentListInfo::addArgument(), clang::AlreadyDiagnosed, ArgumentToParameter, Both, CheckTemplateArgumentList(), clang::ConstraintsNotSatisfied, Context, clang::CUDATargetMismatch, clang::DeducedMismatch, clang::DeducedMismatchNested, DeduceTemplateArguments(), clang::SemaBase::Diag(), clang::sema::TemplateDeductionInfo::FirstArg, clang::getAsNamedDecl(), clang::TemplateParameterList::getDepth(), clang::TemplateParameterList::getInjectedTemplateArgs(), clang::TemplateArgument::getKind(), clang::TemplateParameterList::getLAngleLoc(), clang::Decl::getLocation(), clang::sema::TemplateDeductionInfo::getLocation(), clang::TemplateParameterList::getParam(), clang::TemplateParameterList::getRAngleLoc(), clang::TemplateParameterList::getTemplateLoc(), clang::TemplateDecl::getTemplateParameters(), getTrivialTemplateArgumentLoc(), clang::sema::TemplateDeductionInfo::hasStrictPackMatch(), clang::Incomplete, clang::IncompletePack, clang::Inconsistent, clang::InstantiationDepth, clang::Invalid, clang::InvalidExplicitArguments, clang::Sema::InstantiatingTemplate::isInvalid(), clang::Decl::isInvalidDecl(), clang::TemplateArgument::isPackExpansion(), clang::MiscellaneousDeductionFailure, clang::NonDeducedMismatch, clang::NonDependentConversionFailure, clang::TemplateArgument::Pack, clang::TemplateArgument::pack_begin(), clang::TemplateArgument::pack_size(), clang::sema::TemplateDeductionInfo::Param, clang::PartialOrdering, runWithSufficientStackSpace(), clang::sema::TemplateDeductionInfo::SecondArg, clang::TemplateParameterList::size(), clang::Sema::CheckTemplateArgumentInfo::StrictPackMatch, clang::SubstitutionFailure, clang::Success, clang::Sema::CheckTemplateArgumentInfo::SugaredConverted, clang::TooFewArguments, clang::TooManyArguments, and clang::Underqualified.

Referenced by CheckTemplateTemplateArgument().

◆ isThisOutsideMemberFunctionBody()

bool Sema::isThisOutsideMemberFunctionBody ( QualType BaseType)

Determine whether the given type is the type of *this that is used outside of the body of a member function for a type that is currently being defined.

Definition at line 1487 of file SemaExprCXX.cpp.

References clang::Class, and CXXThisTypeOverride.

Referenced by ActOnStartCXXMemberReference(), and LookupMemberExprInRecord().

◆ isUnavailableAlignedAllocationFunction()

bool Sema::isUnavailableAlignedAllocationFunction ( const FunctionDecl & FD) const

Determine whether FD is an aligned allocation or deallocation function that is unavailable.

Definition at line 2109 of file SemaExprCXX.cpp.

References getLangOpts(), clang::FunctionDecl::isDefined(), and clang::FunctionDecl::isReplaceableGlobalAllocationFunction().

Referenced by CanUseDecl(), and diagnoseUnavailableAlignedAllocation().

◆ isUnevaluatedContext()

◆ isUnexpandedParameterPackPermitted()

bool Sema::isUnexpandedParameterPackPermitted ( )

Determine whether an unexpanded parameter pack might be permitted in this location.

Determine whether it's possible for an unexpanded parameter pack to be valid in this location.

Useful for error recovery.

This only happens when we're in a declaration that is nested within an expression that could be expanded, such as a lambda-expression within a function call.

This is conservatively correct, but may claim that some unexpanded packs are permitted when they are not.

Definition at line 424 of file SemaTemplateVariadic.cpp.

References FunctionScopes, and clang::isa().

◆ isUsualDeallocationFunction()

◆ isValidPointerAttrType()

bool Sema::isValidPointerAttrType ( QualType T,
bool RefOkay = false )

Determine if type T is a valid subject for a nonnull and similar attributes.

Dependent types are considered valid so they can be checked during instantiation time. By default, we look through references (the behavior used by nonnull), but if the second parameter is true, then we treat a reference type as valid.

Definition at line 1245 of file SemaDeclAttr.cpp.

References clang::RecordDecl::fields(), clang::RecordDecl::getDefinitionOrSelf(), clang::Decl::hasAttr(), clang::Type::isAnyPointerType(), clang::Type::isBlockPointerType(), and clang::T.

Referenced by AddAllocAlignAttr(), AddAssumeAlignedAttr(), attrNonNullArgCheck(), CheckNonNullArguments(), handleNoEscapeAttr(), and handleNonNullAttr().

◆ isValidSectionSpecifier()

llvm::Error Sema::isValidSectionSpecifier ( StringRef Str)

Used to implement to perform semantic checking on attribute((section("foo"))) specifiers.

In this case, "foo" is passed in to be checked. If the section specifier is invalid, return an Error that indicates the problem.

This is a simple quality of implementation feature to catch errors and give good diagnostics in cases when the assembler or code generator would otherwise reject the section specifier.

Definition at line 3327 of file SemaDeclAttr.cpp.

References Context.

Referenced by ActOnPragmaClangSection(), checkCodeSegName(), checkSectionName(), and handlePatchableFunctionEntryAttr().

◆ isValidSveBitcast()

bool Sema::isValidSveBitcast ( QualType srcType,
QualType destType )

Are the two types SVE-bitcast-compatible types?

I.e. is bitcasting from the first SVE type (e.g. an SVE VLAT) to the second type (e.g. an SVE VLST) allowed?

This will also return false if the two given types do not make sense from the perspective of SVE bitcasts.

Definition at line 7710 of file SemaExpr.cpp.

References clang::VectorType::getVectorKind(), clang::Type::isSVESizelessBuiltinType(), clang::Type::isVectorType(), and clang::SveFixedLengthData.

◆ isValidVarArgType()

◆ IsValueInFlagEnum()

bool Sema::IsValueInFlagEnum ( const EnumDecl * ED,
const llvm::APInt & Val,
bool AllowMask ) const

IsValueInFlagEnum - Determine if a value is allowed as part of a flag enum.

If AllowMask is true, then we also allow the complement of a valid value, to be used as a mask.

Definition at line 20693 of file SemaDecl.cpp.

References clang::EnumDecl::enumerators(), FlagBitsCache, clang::EnumDecl::isClosedFlag(), and clang::TagDecl::isCompleteDefinition().

Referenced by ActOnEnumBody(), DiagnoseAssignmentEnum(), and ShouldDiagnoseSwitchCaseNotInEnum().

◆ isVisible()

◆ LazilyCreateBuiltin()

NamedDecl * Sema::LazilyCreateBuiltin ( IdentifierInfo * II,
unsigned ID,
Scope * S,
bool ForRedeclaration,
SourceLocation Loc )

LazilyCreateBuiltin - The specified Builtin-ID was first used at file scope.

lazily create a decl for it. ForRedeclaration is true if we're creating this built-in in anticipation of redeclaring the built-in.

Definition at line 2411 of file SemaDecl.cpp.

References Context, CreateBuiltin(), CurContext, clang::SemaBase::Diag(), clang::Error, clang::ASTContext::GE_Missing_setjmp, clang::ASTContext::GE_Missing_type, getHeaderName(), clang::QualType::isNull(), LangOpts, LookupNecessaryTypesForBuiltin(), New, PushOnScopeChains(), RegisterLocallyScopedExternCDecl(), and TUScope.

Referenced by LookupBuiltin().

◆ LazyProcessLifetimeCaptureByParams()

◆ LLVM_DECLARE_VIRTUAL_ANCHOR_FUNCTION()

clang::Sema::LLVM_DECLARE_VIRTUAL_ANCHOR_FUNCTION ( )

This virtual key function only exists to limit the emission of debug info describing the Sema class.

GCC and Clang only emit debug info for a class with a vtable when the vtable is emitted. Sema is final and not polymorphic, but the debug info size savings are so significant that it is worth adding a vtable just to take advantage of this optimization.

◆ LoadExternalVTableUses()

void Sema::LoadExternalVTableUses ( )

Load any externally-stored vtable uses.

Definition at line 18979 of file SemaDeclCXX.cpp.

References ExternalSource, VTablesUsed, and VTableUses.

Referenced by DefineUsedVTables(), and MarkVTableUsed().

◆ LoadExternalWeakUndeclaredIdentifiers()

void Sema::LoadExternalWeakUndeclaredIdentifiers ( )

Load weak undeclared identifiers from the external source.

Definition at line 1061 of file Sema.cpp.

References ExternalSource, and WeakUndeclaredIdentifiers.

Referenced by ActOnEndOfTranslationUnit(), and ProcessPragmaWeak().

◆ LookupBinOp()

◆ LookupBuiltin()

◆ LookupConstructors()

◆ LookupCopyingAssignment()

CXXMethodDecl * Sema::LookupCopyingAssignment ( CXXRecordDecl * Class,
unsigned Quals,
bool RValueThis,
unsigned ThisQuals )

Look up the copying assignment operator for the given class.

Definition at line 3649 of file SemaLookup.cpp.

References clang::Class, clang::Qualifiers::Const, clang::CopyAssignment, LookupSpecialMember(), clang::Result, and clang::Qualifiers::Volatile.

◆ LookupCopyingConstructor()

CXXConstructorDecl * Sema::LookupCopyingConstructor ( CXXRecordDecl * Class,
unsigned Quals )

Look up the copying constructor for the given class.

Definition at line 3611 of file SemaLookup.cpp.

References clang::Class, clang::Qualifiers::Const, clang::CopyConstructor, LookupSpecialMember(), clang::Result, and clang::Qualifiers::Volatile.

Referenced by CheckCXXThrowOperand().

◆ lookupCoroutineTraits()

ClassTemplateDecl * Sema::lookupCoroutineTraits ( SourceLocation KwLoc,
SourceLocation FuncLoc )

Lookup 'coroutine_traits' in std namespace and std::experimental namespace.

The namespace found is recorded in Namespace.

Definition at line 2007 of file SemaCoroutine.cpp.

References clang::SemaBase::Diag(), clang::Found, getStdNamespace(), LookupOrdinaryName, LookupQualifiedName(), PP, clang::Result, and StdCoroutineTraitsCache.

Referenced by lookupPromiseType().

◆ LookupDefaultConstructor()

CXXConstructorDecl * Sema::LookupDefaultConstructor ( CXXRecordDecl * Class)

Look up the default constructor for the given class.

Definition at line 3603 of file SemaLookup.cpp.

References clang::Class, clang::DefaultConstructor, LookupSpecialMember(), and clang::Result.

Referenced by TryConstructorInitialization(), TryListInitialization(), and TryValueInitialization().

◆ LookupDestructor()

◆ LookupExistingLabel()

LabelDecl * Sema::LookupExistingLabel ( IdentifierInfo * II,
SourceLocation IdentLoc )

Perform a name lookup for a label with the specified name; this does not create a new label if the lookup fails.

Definition at line 4456 of file SemaLookup.cpp.

References clang::cast(), CurContext, clang::Decl::getDeclContext(), LookupLabel, LookupSingleName(), and NotForRedeclaration.

Referenced by LookupOrCreateLabel().

◆ lookupExternCFunctionOrVariable()

NamedDecl * Sema::lookupExternCFunctionOrVariable ( IdentifierInfo * IdentId,
SourceLocation NameLoc,
Scope * curScope )

◆ LookupInlineAsmField()

◆ LookupInlineAsmIdentifier()

◆ LookupInlineAsmVarDeclField()

◆ LookupInSuper()

bool Sema::LookupInSuper ( LookupResult & R,
CXXRecordDecl * Class )

Perform qualified name lookup into all base classes of the given class.

Parameters
Rcaptures both the lookup criteria and any lookup results found.
ClassThe context in which qualified name lookup will search. Name lookup will search in all base classes merging the results.
Returns
True if any decls were found (but possibly ambiguous)

Definition at line 2765 of file SemaLookup.cpp.

References clang::LookupResult::addDecl(), clang::Class, Context, clang::LookupResult::empty(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupNameInfo(), LookupQualifiedName(), clang::CXXRecordDecl::MergeAccess(), clang::LookupResult::resolveKind(), clang::Result, and clang::LookupResult::setNamingClass().

Referenced by LookupParsedName(), and LookupQualifiedName().

◆ LookupLiteralOperator()

Sema::LiteralOperatorLookupResult Sema::LookupLiteralOperator ( Scope * S,
LookupResult & R,
ArrayRef< QualType > ArgTys,
bool AllowRaw,
bool AllowTemplate,
bool AllowStringTemplate,
bool DiagnoseMissing,
StringLiteral * StringLit = nullptr )

◆ LookupMovingAssignment()

CXXMethodDecl * Sema::LookupMovingAssignment ( CXXRecordDecl * Class,
unsigned Quals,
bool RValueThis,
unsigned ThisQuals )

Look up the moving assignment operator for the given class.

Definition at line 3664 of file SemaLookup.cpp.

References clang::Class, clang::Qualifiers::Const, LookupSpecialMember(), clang::MoveAssignment, clang::Result, and clang::Qualifiers::Volatile.

◆ LookupMovingConstructor()

CXXConstructorDecl * Sema::LookupMovingConstructor ( CXXRecordDecl * Class,
unsigned Quals )

Look up the moving constructor for the given class.

Definition at line 3622 of file SemaLookup.cpp.

References clang::Class, clang::Qualifiers::Const, LookupSpecialMember(), clang::MoveConstructor, clang::Result, and clang::Qualifiers::Volatile.

◆ LookupName()

bool Sema::LookupName ( LookupResult & R,
Scope * S,
bool AllowBuiltinCreation = false,
bool ForceNoCPlusPlus = false )

Perform unqualified name lookup starting from a given scope.

Unqualified name lookup (C++ [basic.lookup.unqual], C99 6.2.1) is used to find names within the current scope. For example, 'x' in

int x;
int f() {
return x; // unqualified name look finds 'x' in the global scope
}

Different lookup criteria can find different names. For example, a particular scope can have both a struct and a function of the same name, and each can be found by certain lookup criteria. For more information about lookup criteria, see the documentation for the class LookupCriteria.

Parameters
SThe scope from which unqualified name lookup will begin. If the lookup criteria permits, name lookup may also search in the parent scopes.
[in,out]RSpecifies the lookup to perform (e.g., the name to look up and the lookup kind), and is updated with the results of lookup including zero or more declarations and possibly additional information used to diagnose ambiguities.
Returns
true if lookup succeeded and false otherwise.

Definition at line 2214 of file SemaLookup.cpp.

References clang::LookupResult::addDecl(), clang::CPlusPlus, clang::Scope::DeclScope, clang::DeclContext::Equals(), ExternalSource, clang::LookupResult::getAcceptableDecl(), clang::Scope::getEntity(), clang::Scope::getFlags(), getLangOpts(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupName(), clang::Scope::getParent(), clang::DeclContext::getRedeclContext(), IdResolver, clang::isa(), clang::Scope::isDeclScope(), isNamespaceOrTranslationUnitScope(), clang::DeclContext::isTransparentContext(), LookupBuiltin(), LookupObjCImplicitSelfParam, LookupRedeclarationWithLinkage, clang::LookupResult::resolveKind(), and clang::LookupResult::setShadowed().

Referenced by ActOnAliasDeclaration(), ActOnDecompositionDeclarator(), ActOnEnumConstant(), ActOnFinishConceptDefinition(), ActOnFriendFunctionDecl(), ActOnIdExpression(), ActOnLambdaExpressionAfterIntroducer(), ActOnNamespaceAliasDef(), ActOnParamDeclarator(), ActOnPragmaDump(), ActOnPragmaUnused(), ActOnSizeofParameterPackExpr(), ActOnStartConceptDefinition(), ActOnTag(), BuildBuiltinCallExpr(), BuildCXXNestedNameSpecifier(), buildMemcpyForAssignmentOp(), BuildOperatorCoawaitLookupExpr(), BuildUsingDeclaration(), BuildUsingEnumDeclaration(), CheckAnonMemberRedeclaration(), CheckClassTemplate(), CheckObjCBridgeCFCast(), CheckObjCBridgeNSCast(), CheckShadow(), CheckTypenameType(), DiagnoseInvalidRedeclaration(), emitReplacement(), FindFirstQualifierInScope(), getDestructorName(), getOpenCLEnumType(), getOpenCLTypedefType(), getTypeName(), HandleDeclarator(), HandleField(), HandleMSProperty(), isTagName(), isValidInteropVariable(), lookupExternCFunctionOrVariable(), LookupInlineAsmField(), LookupLiteralOperator(), clang::LookupNamed(), clang::LookupNamespace(), LookupOverloadedOperatorName(), LookupParsedName(), LookupPredefedObjCSuperType(), LookupSingleName(), LookupTemplateName(), markUsedForAliasOrIfunc(), ProcessAPINotes(), warnAboutAmbiguousFunction(), and warnAboutRedundantParens().

◆ LookupNecessaryTypesForBuiltin()

void Sema::LookupNecessaryTypesForBuiltin ( Scope * S,
unsigned ID )

Definition at line 1007 of file SemaLookup.cpp.

References LookupPredefedObjCSuperType().

Referenced by ActOnFunctionDeclarator(), and LazilyCreateBuiltin().

◆ LookupOrCreateLabel()

LabelDecl * Sema::LookupOrCreateLabel ( IdentifierInfo * II,
SourceLocation IdentLoc,
SourceLocation GnuLabelLoc = SourceLocation() )

LookupOrCreateLabel - Do a name lookup of a label with the specified name.

If GnuLabelLoc is a valid source location, then this is a definition of an label label name, otherwise it is a normal label definition or use.

Definition at line 4466 of file SemaLookup.cpp.

References clang::cast(), Context, clang::LabelDecl::Create(), CurContext, clang::Scope::getFnParent(), clang::SourceLocation::isValid(), LookupExistingLabel(), and PushOnScopeChains().

Referenced by GetOrCreateMSAsmLabel().

◆ LookupOverloadedBinOp()

◆ LookupOverloadedOperatorName()

◆ LookupParsedName()

bool Sema::LookupParsedName ( LookupResult & R,
Scope * S,
CXXScopeSpec * SS,
QualType ObjectType,
bool AllowBuiltinCreation = false,
bool EnteringContext = false )

Performs name lookup for a name that was parsed in the source code, and may contain a C++ scope specifier.

This routine is a convenience routine meant to be called from contexts that receive a name and an optional C++ scope specifier (e.g., "N::M::x"). It will then perform either qualified or unqualified name lookup (with LookupQualifiedName or LookupName, respectively) on the given name and return those results. It will perform a special type of lookup for "__super::" scope specifier.

Parameters
SThe scope from which unqualified name lookup will begin.
SSAn optional C++ scope-specifier, e.g., "::N::M".
EnteringContextIndicates whether we are going to enter the context of the scope-specifier SS (if present).
Returns
True if any decls were found (but possibly ambiguous)

Definition at line 2711 of file SemaLookup.cpp.

References clang::Type::castAs(), computeDeclContext(), clang::Type::getAs(), clang::CXXScopeSpec::getRange(), clang::CXXScopeSpec::getScopeRep(), clang::DeclContext::isDependentContext(), isDependentScopeSpecifier(), clang::Type::isDependentType(), clang::CXXScopeSpec::isEmpty(), clang::Type::isIncompleteType(), clang::CXXScopeSpec::isInvalid(), clang::CXXScopeSpec::isNotEmpty(), clang::QualType::isNull(), LookupInSuper(), LookupName(), LookupQualifiedName(), clang::NestedNameSpecifier::MicrosoftSuper, RequireCompleteDeclContext(), clang::LookupResult::setContextRange(), and clang::LookupResult::setNotFoundInCurrentInstantiation().

Referenced by ActOnExplicitInstantiation(), ActOnIdExpression(), ActOnNamespaceAliasDef(), ActOnUsingDirective(), buildDeclareReductionRef(), BuildMemInitializer(), BuildQualifiedDeclarationNameExpr(), buildUserDefinedMapperRef(), CheckMicrosoftIfExistsSymbol(), CheckTemplateTypeArgument(), ClassifyName(), hasUserDefinedMapper(), isTagTypeWithMissingTag(), LookupMemberExprInRecord(), and LookupPotentialTypoResult().

◆ LookupQualifiedName() [1/2]

bool Sema::LookupQualifiedName ( LookupResult & R,
DeclContext * LookupCtx,
bool InUnqualifiedLookup = false )

Perform qualified name lookup into a given context.

Qualified name lookup (C++ [basic.lookup.qual]) is used to find names when the context of those names is explicit specified, e.g., "std::vector" or "x->member", or as part of unqualified name lookup.

Different lookup criteria can find different names. For example, a particular scope can have both a struct and a function of the same name, and each can be found by certain lookup criteria. For more information about lookup criteria, see the documentation for the class LookupCriteria.

Parameters
Rcaptures both the lookup criteria and any lookup results found.
LookupCtxThe context in which qualified name lookup will search. If the lookup criteria permits, name lookup may also search in the parent contexts or (for C++ classes) base classes.
InUnqualifiedLookuptrue if this is qualified name lookup that occurs as part of unqualified name lookup.
Returns
true if lookup succeeded, false if it failed.

Definition at line 2431 of file SemaLookup.cpp.

References clang::LookupResult::addDecl(), clang::AS_none, clang::CXXBasePathElement::Base, clang::CXXBasePaths::begin(), clang::DeclContextLookupResult::begin(), Context, clang::DeclarationName::CXXConversionFunctionName, clang::CXXBasePath::Decls, clang::CXXBasePaths::end(), clang::DeclListNode::iterator::end(), clang::Found, clang::CXXBasePaths::front(), clang::LookupResult::getAcceptableDecl(), getAsTemplateNameDecl(), clang::Decl::getCanonicalDecl(), clang::DeclarationName::getCXXNameType(), clang::CXXRecordDecl::getDefinition(), clang::LookupResult::getIdentifierNamespace(), clang::LookupResult::getLookupKind(), clang::LookupResult::getLookupName(), clang::DeclarationName::getNameKind(), clang::CXXBaseSpecifier::getType(), clang::NamedDecl::getUnderlyingDecl(), clang::CXXRecordDecl::hasAnyDependentBases(), clang::DeclContext::isDependentContext(), clang::Type::isDependentType(), clang::DeclContext::isFileContext(), clang::LookupResult::isForRedeclaration(), clang::Decl::isInIdentifierNamespace(), clang::QualType::isNull(), clang::LookupResult::isTemplateNameLookup(), clang::DeclContext::lookup(), LookupDirect(), clang::CXXRecordDecl::lookupInBases(), LookupLabel, LookupNamespaceName, LookupObjCProtocolName, LookupOperatorName, LookupQualifiedNameInUsingDirectives(), clang::CXXRecordDecl::MergeAccess(), Next, clang::LookupResult::resolveKind(), clang::Result, clang::LookupResult::setAmbiguousBaseSubobjects(), clang::LookupResult::setAmbiguousBaseSubobjectTypes(), clang::LookupResult::setNamingClass(), clang::LookupResult::setNotFoundInCurrentInstantiation(), clang::CXXBasePaths::setOrigin(), clang::DeclContext::setUseQualifiedLookup(), clang::DeclContext::shouldUseQualifiedLookup(), and clang::CXXBasePathElement::SubobjectNumber.

Referenced by ActOnCXXTypeid(), ActOnFriendFunctionDecl(), ActOnStartNamespaceDef(), ActOnTag(), AddMemberOperatorCandidates(), BuildBuiltinOffsetOf(), BuildCallToObjectOfClassType(), buildCoroutineHandle(), BuildCXXNestedNameSpecifier(), buildDeclareReductionRef(), BuildNonArrayForRange(), BuildOverloadedArrowExpr(), buildSingleCopyAssignRecursively(), buildStdNoThrowDeclRef(), BuildUsingDeclaration(), BuildUsingEnumDeclaration(), BuildVariableInstantiation(), CheckClassTemplate(), checkTupleLikeDecomposition(), CheckTypenameType(), CXXRecordMembersNamed(), DeduceTemplateSpecializationFromInitializer(), DiagnoseEmptyLookup(), DiagnoseInvalidRedeclaration(), DiagnoseTwoPhaseLookup(), DiagnoseTypeAwareAllocators(), doesUsualArrayDeleteWantSize(), emitReplacement(), EvaluateAsStringImpl(), FindAllocationFunctions(), FindDeallocationFunction(), getDestructorName(), getStdTrait(), getTypeName(), HandleDeclarator(), clang::HLSLExternalSemaSource::InitializeSema(), isDeclaratorFunctionLike(), lookupCoroutineHandleType(), lookupCoroutineTraits(), LookupGlobalDeallocationFunctions(), LookupInlineAsmField(), LookupInlineAsmVarDeclField(), LookupInSuper(), lookupMember(), lookupMember(), clang::LookupNamed(), clang::LookupNamespace(), LookupParsedName(), LookupPotentialTypoResult(), lookupPromiseType(), LookupQualifiedName(), LookupStdClassTemplate(), LookupStdSourceLocationImpl(), LookupTemplateName(), resolveAllocationOverloadInterior(), resolveBuiltinNewDeleteOverload(), and shouldAddReversedEqEq().

◆ LookupQualifiedName() [2/2]

bool Sema::LookupQualifiedName ( LookupResult & R,
DeclContext * LookupCtx,
CXXScopeSpec & SS )

Performs qualified name lookup or special type of lookup for "__super::" scope specifier.

This routine is a convenience overload meant to be called from contexts that need to perform a qualified name lookup with an optional C++ scope specifier that might require special kind of lookup.

Parameters
Rcaptures both the lookup criteria and any lookup results found.
LookupCtxThe context in which qualified name lookup will search.
SSAn optional C++ scope-specifier.
Returns
true if lookup succeeded, false if it failed.

Definition at line 2703 of file SemaLookup.cpp.

References clang::CXXScopeSpec::getScopeRep(), LookupInSuper(), LookupQualifiedName(), and clang::NestedNameSpecifier::MicrosoftSuper.

◆ LookupSingleName()

◆ LookupSpecialMember()

Sema::SpecialMemberOverloadResult Sema::LookupSpecialMember ( CXXRecordDecl * D,
CXXSpecialMemberKind SM,
bool ConstArg,
bool VolatileArg,
bool RValueThis,
bool ConstThis,
bool VolatileThis )

Definition at line 3382 of file SemaLookup.cpp.

References clang::QualType::addConst(), AddMethodCandidate(), AddMethodTemplateCandidate(), AddOverloadCandidate(), AddTemplateOverloadCandidate(), clang::QualType::addVolatile(), clang::Sema::SpecialMemberOverloadResult::Ambiguous, clang::AS_public, clang::DeclContextLookupResult::begin(), clang::OverloadCandidateSet::BestViableFunction(), BumpAlloc, CanDeclareSpecialMemberFunction(), clang::cast(), clang::Expr::Classify(), Context, clang::CopyAssignment, clang::CopyConstructor, clang::CPlusPlus11, clang::OverloadCandidateSet::CSK_Normal, clang::DefaultConstructor, clang::Destructor, clang::DeclContextLookupResult::empty(), clang::DeclContextLookupResult::end(), clang::getConstructorInfo(), clang::DeclAccessPair::getDecl(), clang::CXXRecordDecl::getDefinition(), clang::CXXRecordDecl::getDestructor(), getLangOpts(), clang::Decl::getLocation(), clang::NamedDecl::getUnderlyingDecl(), clang::isa(), clang::FunctionDecl::isDeleted(), clang::DeclContext::lookup(), clang::DeclAccessPair::make(), clang::MoveAssignment, clang::MoveConstructor, clang::CXXRecordDecl::needsImplicitCopyAssignment(), clang::CXXRecordDecl::needsImplicitCopyConstructor(), clang::CXXRecordDecl::needsImplicitDefaultConstructor(), clang::CXXRecordDecl::needsImplicitDestructor(), clang::CXXRecordDecl::needsImplicitMoveAssignment(), clang::CXXRecordDecl::needsImplicitMoveConstructor(), clang::Sema::SpecialMemberOverloadResult::NoMemberOrDeleted, clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, clang::Result, runWithSufficientStackSpace(), SM, SpecialMemberCache, clang::Sema::SpecialMemberOverloadResult::Success, clang::VK_LValue, and clang::VK_PRValue.

Referenced by checkMoveAssignmentForRepeatedMove(), lookupCallFromSpecialMember(), LookupCopyingAssignment(), LookupCopyingConstructor(), LookupDefaultConstructor(), LookupDestructor(), LookupMovingAssignment(), and LookupMovingConstructor().

◆ LookupTemplateName()

bool Sema::LookupTemplateName ( LookupResult & R,
Scope * S,
CXXScopeSpec & SS,
QualType ObjectType,
bool EnteringContext,
RequiredTemplateKind RequiredTemplate = SourceLocation(),
AssumedTemplateKind * ATK = nullptr,
bool AllowTypoCorrection = true )

Definition at line 387 of file SemaTemplate.cpp.

References clang::Type::castAs(), clang::LookupResult::clear(), computeDeclContext(), CorrectTypo(), clang::CPlusPlus11, clang::SemaBase::Diag(), diagnoseTypo(), clang::LookupResult::empty(), clang::ErrorRecovery, FilterAcceptableTemplateNames(), clang::Found, FoundFunctions, FoundNothing, clang::Type::getAs(), clang::DeclarationName::getAsString(), getAsTemplateNameDecl(), clang::Decl::getCanonicalDecl(), clang::LookupResult::getFoundDecl(), getLangOpts(), clang::Decl::getLocation(), clang::CXXScopeSpec::getRange(), clang::Sema::RequiredTemplateKind::getTemplateKeywordLoc(), clang::NamedDecl::getUnderlyingDecl(), clang::Sema::RequiredTemplateKind::hasTemplateKeyword(), clang::isa(), clang::LookupResult::isAmbiguous(), isDependentScopeSpecifier(), clang::Type::isDependentType(), clang::CXXScopeSpec::isEmpty(), clang::Type::isIncompleteType(), clang::CXXScopeSpec::isInvalid(), clang::CXXScopeSpec::isNotEmpty(), clang::QualType::isNull(), clang::Type::isObjCObjectOrInterfaceType(), clang::LookupResult::isSingleResult(), clang::Type::isVectorType(), LookupName(), LookupOrdinaryName, LookupQualifiedName(), None, clang::nullptr, clang::SemaBase::PDiag(), RequireCompleteDeclContext(), clang::LookupResult::setTemplateNameLookup(), clang::CorrectionCandidateCallback::WantCXXNamedCasts, clang::CorrectionCandidateCallback::WantExpressionKeywords, clang::CorrectionCandidateCallback::WantRemainingKeywords, and clang::CorrectionCandidateCallback::WantTypeSpecifiers.

Referenced by ActOnIdExpression(), ActOnTemplateName(), BuildQualifiedTemplateIdExpr(), DiagnoseEmptyLookup(), isDeductionGuideName(), isTemplateName(), and LookupMemberExprInRecord().

◆ LookupVisibleDecls() [1/2]

void Sema::LookupVisibleDecls ( DeclContext * Ctx,
LookupNameKind Kind,
VisibleDeclConsumer & Consumer,
bool IncludeGlobalScope = true,
bool IncludeDependentBases = false,
bool LoadExternal = true )

Definition at line 4448 of file SemaLookup.cpp.

References Consumer.

◆ LookupVisibleDecls() [2/2]

void Sema::LookupVisibleDecls ( Scope * S,
LookupNameKind Kind,
VisibleDeclConsumer & Consumer,
bool IncludeGlobalScope = true,
bool LoadExternal = true )

Definition at line 4440 of file SemaLookup.cpp.

References Consumer.

Referenced by AddRecordMembersCompletionResults().

◆ LoongArch()

SemaLoongArch & clang::Sema::LoongArch ( )
inline

Definition at line 1468 of file Sema.h.

◆ M68k()

SemaM68k & clang::Sema::M68k ( )
inline

Definition at line 1473 of file Sema.h.

Referenced by handleInterruptAttr().

◆ MakeFullDiscardedValueExpr()

FullExprArg clang::Sema::MakeFullDiscardedValueExpr ( Expr * Arg)
inline

◆ MakeFullExpr() [1/2]

FullExprArg clang::Sema::MakeFullExpr ( Expr * Arg)
inline

Definition at line 7802 of file Sema.h.

References clang::Expr::getExprLoc(), and MakeFullExpr().

Referenced by isNonNegativeIntegerValue(), and MakeFullExpr().

◆ MakeFullExpr() [2/2]

FullExprArg clang::Sema::MakeFullExpr ( Expr * Arg,
SourceLocation CC )
inline

Definition at line 7805 of file Sema.h.

References ActOnFinishFullExpr().

◆ makeMergedDefinitionVisible()

◆ makeModuleVisible()

void clang::Sema::makeModuleVisible ( Module * Mod,
SourceLocation ImportLoc )
inline

Definition at line 9892 of file Sema.h.

◆ makeUnavailableInSystemHeader()

bool Sema::makeUnavailableInSystemHeader ( SourceLocation loc,
UnavailableAttr::ImplicitReason reason )

makeUnavailableInSystemHeader - There is an error in the current context.

If we're still in a system header, and we can plausibly make the relevant declaration unavailable instead of erroring, do so and return true.

Definition at line 630 of file Sema.cpp.

References clang::Decl::addAttr(), Context, CurContext, clang::Decl::hasAttr(), and inTemplateInstantiation().

Referenced by diagnoseObjCARCConversion().

◆ MarkAnyDeclReferenced()

void Sema::MarkAnyDeclReferenced ( SourceLocation Loc,
Decl * D,
bool MightBeOdrUse )

Perform marking for a reference to an arbitrary declaration.

It marks the declaration referenced, and performs odr-use checking for functions and variables. This method should not be used when building a normal expression which refers to a variable.

Definition at line 20597 of file SemaExpr.cpp.

References MarkFunctionReferenced(), MarkVariableReferenced(), and clang::Decl::setReferenced().

Referenced by ActOnSizeofParameterPackExpr(), BuildCXXNestedNameSpecifier(), BuildMemInitializer(), CheckTemplateArgumentAddressOfObjectOrFunction(), checkTypeDeclType(), ClassifyName(), getDestructorName(), LookupInlineAsmField(), and MarkExprReferenced().

◆ MarkAsLateParsedTemplate()

void Sema::MarkAsLateParsedTemplate ( FunctionDecl * FD,
Decl * FnD,
CachedTokens & Toks )

◆ MarkBaseAndMemberDestructorsReferenced()

void Sema::MarkBaseAndMemberDestructorsReferenced ( SourceLocation Loc,
CXXRecordDecl * Record )

MarkBaseAndMemberDestructorsReferenced - Given a record decl, mark all the non-trivial destructors of its members and bases as referenced.

Definition at line 5924 of file SemaDeclCXX.cpp.

References clang::RecordDecl::fields(), clang::DeclContext::isDependentContext(), clang::TagDecl::isUnion(), MarkBaseDestructorsReferenced(), and MarkFieldDestructorReferenced().

Referenced by ActOnFinishFunctionBody(), and DefineImplicitDestructor().

◆ MarkCaptureUsedInEnclosingContext()

void Sema::MarkCaptureUsedInEnclosingContext ( ValueDecl * Capture,
SourceLocation Loc,
unsigned CapturingScopeIndex )

◆ MarkDeclarationsReferencedInExpr()

void Sema::MarkDeclarationsReferencedInExpr ( Expr * E,
bool SkipLocalVariables = false,
ArrayRef< const Expr * > StopAt = {} )

Mark any declarations that appear within this expression or any potentially-evaluated subexpressions as "referenced".

Parameters
SkipLocalVariablesIf true, don't mark local variables as 'referenced'.
StopAtSubexpressions that we shouldn't recurse into.

Definition at line 20702 of file SemaExpr.cpp.

Referenced by BuildCXXDefaultInitExpr(), and CheckCXXDefaultArgExpr().

◆ MarkDeclarationsReferencedInType()

void Sema::MarkDeclarationsReferencedInType ( SourceLocation Loc,
QualType T )

Mark all of the declarations referenced within a particular AST node as referenced.

Used when template instantiation instantiates a non-dependent type – entities referenced by the type are now referenced.

Definition at line 20648 of file SemaExpr.cpp.

References clang::T.

◆ MarkDeclRefReferenced()

void Sema::MarkDeclRefReferenced ( DeclRefExpr * E,
const Expr * Base = nullptr )

◆ MarkDeducedTemplateParameters() [1/2]

void Sema::MarkDeducedTemplateParameters ( ASTContext & Ctx,
const FunctionTemplateDecl * FunctionTemplate,
llvm::SmallBitVector & Deduced )
static

Marks all of the template parameters that will be deduced by a call to the given function template.

Definition at line 7175 of file SemaTemplateDeduction.cpp.

References clang::Function, FunctionTemplate, clang::TemplateParameterList::getDepth(), MarkUsedTemplateParameters(), and clang::TemplateParameterList::size().

◆ MarkDeducedTemplateParameters() [2/2]

void clang::Sema::MarkDeducedTemplateParameters ( const FunctionTemplateDecl * FunctionTemplate,
llvm::SmallBitVector & Deduced )
inline

◆ MarkExpressionAsImmediateEscalating()

void Sema::MarkExpressionAsImmediateEscalating ( Expr * E)

◆ MarkFunctionParmPackReferenced()

void Sema::MarkFunctionParmPackReferenced ( FunctionParmPackExpr * E)

Perform reference-marking and odr-use handling for a FunctionParmPackExpr.

Definition at line 20587 of file SemaExpr.cpp.

References clang::FunctionParmPackExpr::getParameterPackLocation(), MarkExprReferenced(), and RefsMinusAssignments.

◆ MarkFunctionReferenced()

void Sema::MarkFunctionReferenced ( SourceLocation Loc,
FunctionDecl * Func,
bool MightBeOdrUse = true )

Mark a function referenced, and check whether it is odr-used (C++ [basic.def.odr]p2, C99 6.9p3)

Definition at line 18587 of file SemaExpr.cpp.

References clang::cast(), clang::SemaCUDA::CheckCall(), CheckCompleteDestructorVariant(), CheckCompleteParameterTypesForMangler(), checkSpecializationReachability(), CodeSynthesisContexts, clang::Constructor, Consumer, Context, CUDA(), CurContext, DefineDefaultedComparison(), DefineImplicitCopyAssignment(), DefineImplicitCopyConstructor(), DefineImplicitDefaultConstructor(), DefineImplicitDestructor(), DefineImplicitLambdaToBlockPointerConversion(), DefineImplicitLambdaToFunctionPointerConversion(), DefineImplicitMoveAssignment(), DefineImplicitMoveConstructor(), DefineInheritingConstructor(), clang::Destructor, clang::Func, funcHasParameterSizeMangling(), getASTContext(), getDefaultedComparisonKind(), clang::FunctionProtoType::getExceptionSpecType(), getLangOpts(), clang::CXXRecordDecl::getNumVBases(), clang::DeclContext::getParent(), getPrintingPolicy(), ImmediateFunctionContext, clang::Init, InstantiateFunctionDefinition(), clang::isa(), isExternalWithNoLinkageType(), isImplicitlyDefinableConstexprFunction(), clang::SourceLocation::isInvalid(), clang::CXXConversionDecl::isLambdaToBlockPointerConversion(), isOdrUseContext(), isPotentiallyConstantEvaluatedContext(), clang::isUnresolvedExceptionSpec(), LangOpts, MarkFunctionReferenced(), MarkVTableUsed(), None, OS, PendingInstantiations, PendingLocalImplicitInstantiations, PotentiallyEvaluated, clang::SemaCUDA::RecordImplicitHostDeviceFuncUsedByDevice(), ResolveExceptionSpec(), runWithSufficientStackSpace(), clang::TSK_ImplicitInstantiation, clang::TSK_Undeclared, and UndefinedButUsed.

Referenced by ActOnCXXDelete(), ActOnDecltypeExpression(), BuildCXXConstructExpr(), BuildCXXNew(), CheckCXXThrowOperand(), CheckDestructor(), checkDestructorReference(), CheckParmsForFunctionDef(), DeduceTemplateSpecializationFromInitializer(), DefineImplicitLambdaToFunctionPointerConversion(), DefineInheritingConstructor(), FinalizeVarWithDestructor(), findDeleteForPromise(), MarkAnyDeclReferenced(), MarkBaseDestructorsReferenced(), MarkFieldDestructorReferenced(), MarkFunctionReferenced(), MarkVirtualBaseDestructorsReferenced(), MarkVirtualMembersReferenced(), MarkVTableUsed(), MaybeBindToTemporary(), clang::InitializationSequence::Perform(), PerformConstructorInitialization(), ReferenceDllExportedMembers(), and SetDelegatingInitializer().

◆ MarkMemberReferenced()

◆ MarkThisReferenced()

void Sema::MarkThisReferenced ( CXXThisExpr * This)

◆ MarkTypoCorrectedFunctionDefinition()

void Sema::MarkTypoCorrectedFunctionDefinition ( const NamedDecl * F)

Definition at line 9323 of file SemaDecl.cpp.

References TypoCorrectedFunctionDefinitions.

Referenced by DiagnoseInvalidRedeclaration().

◆ MarkUnusedFileScopedDecl()

void Sema::MarkUnusedFileScopedDecl ( const DeclaratorDecl * D)

If it's a file scoped decl that must warn if not used, keep track of it.

Definition at line 1974 of file SemaDecl.cpp.

References clang::First, ShouldWarnIfUnusedFileScopedDecl(), and UnusedFileScopedDecls.

Referenced by ActOnFunctionDeclarator(), CheckFunctionTemplateSpecialization(), and FinalizeDeclaration().

◆ MarkUsedTemplateParameters() [1/4]

void Sema::MarkUsedTemplateParameters ( ArrayRef< TemplateArgument > TemplateArgs,
unsigned Depth,
llvm::SmallBitVector & Used )

Definition at line 7159 of file SemaTemplateDeduction.cpp.

References Context, MarkUsedTemplateParameters(), and Used.

◆ MarkUsedTemplateParameters() [2/4]

void Sema::MarkUsedTemplateParameters ( ArrayRef< TemplateArgumentLoc > TemplateArgs,
unsigned Depth,
llvm::SmallBitVector & Used )

Definition at line 7167 of file SemaTemplateDeduction.cpp.

References Context, getArgument(), MarkUsedTemplateParameters(), and Used.

◆ MarkUsedTemplateParameters() [3/4]

void Sema::MarkUsedTemplateParameters ( const Expr * E,
bool OnlyDeduced,
unsigned Depth,
llvm::SmallBitVector & Used )

Mark which template parameters are used in a given expression.

Parameters
Ethe expression from which template parameters will be deduced.
Useda bit vector whose elements will be set to true to indicate when the corresponding template parameter will be deduced.

Definition at line 7130 of file SemaTemplateDeduction.cpp.

References Context, MarkUsedTemplateParameters(), and Used.

Referenced by checkTemplatePartialSpecialization(), MarkDeducedTemplateParameters(), MarkUsedTemplateParameters(), MarkUsedTemplateParameters(), MarkUsedTemplateParameters(), and MarkUsedTemplateParameters().

◆ MarkUsedTemplateParameters() [4/4]

void Sema::MarkUsedTemplateParameters ( const TemplateArgumentList & TemplateArgs,
bool OnlyDeduced,
unsigned Depth,
llvm::SmallBitVector & Used )

Mark which template parameters can be deduced from a given template argument list.

Parameters
TemplateArgsthe template argument list from which template parameters will be deduced.
Useda bit vector whose elements will be set to true to indicate when the corresponding template parameter will be deduced.

Definition at line 7143 of file SemaTemplateDeduction.cpp.

References clang::TemplateArgumentList::asArray(), Context, hasPackExpansionBeforeEnd(), MarkUsedTemplateParameters(), clang::TemplateArgumentList::size(), and Used.

◆ MarkUsedTemplateParametersForSubsumptionParameterMapping()

void Sema::MarkUsedTemplateParametersForSubsumptionParameterMapping ( const Expr * E,
unsigned Depth,
llvm::SmallBitVector & Used )

Mark which template parameters are named in a given expression.

Unlike MarkUsedTemplateParameters, this excludes parameter that are used but not directly named by an expression - i.e. it excludes any template parameter that denotes the type of a referenced NTTP.

Parameters
Useda bit vector whose elements will be set to true to indicate when the corresponding template parameter will be deduced.

Definition at line 7136 of file SemaTemplateDeduction.cpp.

References Used.

◆ MarkVariableReferenced()

void Sema::MarkVariableReferenced ( SourceLocation Loc,
VarDecl * Var )

Mark a variable referenced, and check whether it is odr-used (C++ [basic.def.odr]p2, C99 6.9p3).

Note that this should not be used directly for normal expressions referring to VarDecl.

Definition at line 20441 of file SemaExpr.cpp.

References DoMarkVarDeclReferenced(), and RefsMinusAssignments.

Referenced by CheckComparisonCategoryType(), MarkAnyDeclReferenced(), and ReferenceDllExportedMembers().

◆ MarkVirtualBaseDestructorsReferenced()

void Sema::MarkVirtualBaseDestructorsReferenced ( SourceLocation Location,
CXXRecordDecl * ClassDecl,
llvm::SmallPtrSetImpl< const CXXRecordDecl * > * DirectVirtualBases = nullptr )

Mark destructors of virtual bases of this class referenced.

In the Itanium C++ ABI, this is done when emitting a destructor for any non-abstract class. In the Microsoft C++ ABI, this is done any time a class's destructor is referenced.

Definition at line 5944 of file SemaDeclCXX.cpp.

References AR_accessible, CheckDerivedToBaseConversion(), CheckDestructorAccess(), Context, DiagnoseUseOfDecl(), clang::Decl::getLocation(), LookupDestructorIfRelevant(), MarkFunctionReferenced(), clang::SemaBase::PDiag(), and clang::CXXRecordDecl::vbases().

Referenced by CheckCompleteDestructorVariant(), and MarkBaseDestructorsReferenced().

◆ MarkVirtualMemberExceptionSpecsNeeded()

void Sema::MarkVirtualMemberExceptionSpecsNeeded ( SourceLocation Loc,
const CXXRecordDecl * RD )

Mark the exception specifications of all virtual member functions in the given class as needed.

Definition at line 19159 of file SemaDeclCXX.cpp.

References clang::CXXRecordDecl::methods(), and ResolveExceptionSpec().

Referenced by DefineUsedVTables().

◆ MarkVirtualMembersReferenced()

void Sema::MarkVirtualMembersReferenced ( SourceLocation Loc,
const CXXRecordDecl * RD,
bool ConstexprOnly = false )

◆ MarkVTableUsed()

◆ MatchTemplateParametersToScopeSpecifier()

TemplateParameterList * Sema::MatchTemplateParametersToScopeSpecifier ( SourceLocation DeclStartLoc,
SourceLocation DeclLoc,
const CXXScopeSpec & SS,
TemplateIdAnnotation * TemplateId,
ArrayRef< TemplateParameterList * > ParamLists,
bool IsFriend,
bool & IsMemberSpecialization,
bool & Invalid,
bool SuppressDiagnostic = false )

Match the given template parameter lists to the given scope specifier, returning the template parameter list that applies to the name.

Parameters
DeclStartLocthe start of the declaration that has a scope specifier or a template parameter list.
DeclLocThe location of the declaration itself.
SSthe scope specifier that will be matched to the given template parameter lists. This scope specifier precedes a qualified name that is being declared.
TemplateIdThe template-id following the scope specifier, if there is one. Used to check for a missing 'template<>'.
ParamListsthe template parameter lists, from the outermost to the innermost template parameter lists.
IsFriendWhether to apply the slightly different rules for matching template parameters to scope specifiers in friend declarations.
IsMemberSpecializationwill be set true if the scope specifier denotes a fully-specialized type, and therefore this is a declaration of a member specialization.
Returns
the template parameter list, if any, that corresponds to the name that is preceded by the scope specifier SS. This template parameter list may have template parameters (if we're declaring a template) or may have no template parameters (if we're declaring a template specialization), or may be NULL (if what we're declaring isn't itself a template).

Definition at line 2827 of file SemaTemplate.cpp.

References CheckTemplateParameterList(), computeDeclContext(), Context, clang::TemplateParameterList::Create(), clang::FixItHint::CreateInsertion(), DependsOnTemplateParameters(), clang::SemaBase::Diag(), clang::Enum, clang::TemplateName::getAsDeducedTemplateName(), clang::TemplateName::getAsDependentTemplateName(), clang::TemplateName::getAsTemplateDecl(), clang::NestedNameSpecifier::getKind(), getRangeOfTypeInNestedNameSpecifier(), clang::CXXScopeSpec::getScopeRep(), clang::Invalid, clang::isa(), clang::SourceLocation::isValid(), clang::TemplateIdAnnotation::LAngleLoc, clang::TemplateIdAnnotation::RAngleLoc, clang::T, clang::Template, TemplateParameterListsAreEqual(), TPC_ClassTemplateMember, TPL_TemplateMatch, clang::TSK_ExplicitSpecialization, and clang::NestedNameSpecifier::Type.

Referenced by ActOnClassTemplateSpecialization(), ActOnFunctionDeclarator(), ActOnStartFunctionDeclarationDeclarator(), ActOnTag(), ActOnTemplatedFriendTag(), and ActOnVariableDeclarator().

◆ maybeAddDeclWithEffects() [1/2]

void clang::Sema::maybeAddDeclWithEffects ( const Decl * D,
const FunctionEffectsRef & FX )

◆ maybeAddDeclWithEffects() [2/2]

template<class FuncOrBlockDecl>
void clang::Sema::maybeAddDeclWithEffects ( FuncOrBlockDecl * D)
inline

Inline checks from the start of maybeAddDeclWithEffects, to minimize performance impact on code not using effects.

Definition at line 15677 of file Sema.h.

References Context, clang::FunctionEffectsRef::empty(), and maybeAddDeclWithEffects().

Referenced by ActOnBlockStmtExpr(), ActOnStartOfFunctionDef(), BuildLambdaExpr(), maybeAddDeclWithEffects(), and MergeFunctionDecl().

◆ MaybeBindToTemporary()

ExprResult Sema::MaybeBindToTemporary ( Expr * E)

MaybeBindToTemporary - If the passed in expression has a record type with a non-trivial destructor, this will return CXXBindTemporaryExpr.

Otherwise it simply returns the passed in expression.

Definition at line 6509 of file SemaExprCXX.cpp.

References clang::Bind, clang::Call, clang::cast(), CheckDestructorAccess(), Cleanup, Context, clang::CPlusPlus, clang::CXXBindTemporaryExpr::Create(), clang::CXXTemporary::Create(), clang::ImplicitCastExpr::Create(), clang::Destructor, DiagnoseUseOfDecl(), clang::QualType::DK_nontrivial_c_struct, clang::Sema::ExpressionEvaluationContextRecord::EK_Decltype, clang::ExprError(), ExprEvalContexts, clang::Expr::getExprLoc(), getLangOpts(), clang::ObjCMethodDecl::getMethodFamily(), clang::Expr::getType(), clang::QualType::getTypePtr(), clang::Decl::hasAttr(), clang::isa(), clang::DeclContext::isDependentContext(), clang::QualType::isDestructedType(), clang::Expr::isGLValue(), clang::Decl::isInvalidDecl(), clang::Type::isObjCARCImplicitlyUnretainedType(), clang::Type::isObjCRetainableType(), LookupDestructor(), MarkFunctionReferenced(), clang::nullptr, clang::OMF_performSelector, clang::SemaBase::PDiag(), clang::T, and clang::VK_PRValue.

Referenced by BuildCallToMemberFunction(), BuildCallToObjectOfClassType(), BuildCompoundLiteralExpr(), BuildCXXCastArgument(), BuildLambdaExpr(), BuildLiteralOperatorCall(), BuildOverloadedArrowExpr(), BuildResolvedCallExpr(), BuildStmtExpr(), CopyObject(), CreateOverloadedArraySubscriptExpr(), CreateOverloadedBinOp(), CreateOverloadedUnaryOp(), clang::InitializationSequence::Perform(), and PerformConstructorInitialization().

◆ MaybeConvertParenListExprToParenExpr()

ExprResult Sema::MaybeConvertParenListExprToParenExpr ( Scope * S,
Expr * ME )

◆ MaybeCreateExprWithCleanups() [1/2]

◆ MaybeCreateExprWithCleanups() [2/2]

◆ MaybeCreateStmtWithCleanups()

Stmt * Sema::MaybeCreateStmtWithCleanups ( Stmt * SubStmt)

◆ MaybeEmitAmbiguousAtomicConstraintsDiagnostic()

bool Sema::MaybeEmitAmbiguousAtomicConstraintsDiagnostic ( const NamedDecl * D1,
ArrayRef< AssociatedConstraint > AC1,
const NamedDecl * D2,
ArrayRef< AssociatedConstraint > AC2 )

If D1 was not at least as constrained as D2, but would've been if a pair of atomic constraints involved had been declared in a concept and not repeated in two separate places in code.

Returns
true if such a diagnostic was emitted, false otherwise.

Definition at line 2557 of file SemaConcept.cpp.

References Context, clang::SemaBase::Diag(), clang::Stmt::getBeginLoc(), clang::AtomicConstraint::getConstraintExpr(), getNormalizedAssociatedConstraints(), clang::Stmt::getSourceRange(), clang::NormalizedConstraintWithParamMapping::hasMatchingParameterMapping(), isSFINAEContext(), clang::Stmt::Profile(), and clang::SubsumptionChecker::Subsumes().

Referenced by checkMoreSpecializedThanPrimary(), CheckTemplateTemplateArgument(), and MaybeDiagnoseAmbiguousConstraints().

◆ maybeExtendBlockObject()

◆ MaybeSuggestAddingStaticToDecl()

◆ mergeAlwaysInlineAttr()

AlwaysInlineAttr * Sema::mergeAlwaysInlineAttr ( Decl * D,
const AttributeCommonInfo & CI,
const IdentifierInfo * Ident )

◆ mergeAvailabilityAttr()

AvailabilityAttr * Sema::mergeAvailabilityAttr ( NamedDecl * D,
const AttributeCommonInfo & CI,
const IdentifierInfo * Platform,
bool Implicit,
VersionTuple Introduced,
VersionTuple Deprecated,
VersionTuple Obsoleted,
bool IsUnavailable,
StringRef Message,
bool IsStrict,
StringRef Replacement,
AvailabilityMergeKind AMK,
int Priority,
const IdentifierInfo * IIEnvironment )

◆ mergeBTFDeclTagAttr()

BTFDeclTagAttr * Sema::mergeBTFDeclTagAttr ( Decl * D,
const BTFDeclTagAttr & AL )

Definition at line 6362 of file SemaDeclAttr.cpp.

References Context, and hasBTFDeclTagAttr().

Referenced by mergeDeclAttribute().

◆ mergeCodeSegAttr()

CodeSegAttr * Sema::mergeCodeSegAttr ( Decl * D,
const AttributeCommonInfo & CI,
StringRef Name )

◆ MergeCompatibleFunctionDecls()

bool Sema::MergeCompatibleFunctionDecls ( FunctionDecl * New,
FunctionDecl * Old,
Scope * S,
bool MergeTypeWithOld )

Completes the merge of two function declarations that are known to be compatible.

This routine handles the merging of attributes and other properties of function declarations from the old declaration to the new declaration, once we know that New is in fact a redeclaration of Old.

Returns
false

Definition at line 4473 of file SemaDecl.cpp.

References Context, clang::CPlusPlus, getLangOpts(), clang::FunctionDecl::getMostRecentDecl(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::ValueDecl::getType(), clang::FunctionDecl::isPureVirtual(), clang::Decl::isUsed(), MergeCXXFunctionDecl(), mergeDeclAttributes(), mergeParamDeclAttributes(), mergeParamDeclTypes(), and New.

Referenced by MergeFunctionDecl().

◆ MergeCXXFunctionDecl()

bool Sema::MergeCXXFunctionDecl ( FunctionDecl * New,
FunctionDecl * Old,
Scope * S )

MergeCXXFunctionDecl - Merge two declarations of the same C++ function, once we already know that they have the same type.

Subroutine of MergeFunctionDecl. Returns true if there was an error, false otherwise.

Definition at line 453 of file SemaDeclCXX.cpp.

References clang::cast(), CheckForFunctionRedefinition(), Diag(), clang::Decl::FOK_None, clang::Decl::FOK_Undeclared, functionDeclHasDefaultArgument(), clang::FunctionDecl::getConstexprKind(), clang::ParmVarDecl::getDefaultArgRange(), clang::CXXRecordDecl::getDescribedClassTemplate(), clang::Decl::getFriendObjectKind(), clang::VarDecl::getInit(), getLangOpts(), clang::Decl::getLocation(), clang::FunctionDecl::getMinRequiredArguments(), clang::FunctionDecl::getMostRecentDecl(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::FunctionDecl::getPreviousDecl(), getSpecialMember(), clang::ParmVarDecl::getUninstantiatedDefaultArg(), clang::ParmVarDecl::hasDefaultArg(), clang::ParmVarDecl::hasInheritedDefaultArg(), clang::ParmVarDecl::hasUninstantiatedDefaultArg(), clang::ParmVarDecl::hasUnparsedDefaultArg(), clang::Invalid, clang::isa(), isDeclInScope(), clang::FunctionDecl::isDefined(), clang::FunctionDecl::isInlined(), clang::Decl::isLocalExternDecl(), clang::LookupResult::isVisible(), isVisible(), New, clang::ParmVarDecl::setDefaultArg(), clang::ParmVarDecl::setHasInheritedDefaultArg(), clang::ParmVarDecl::setUninstantiatedDefaultArg(), clang::ParmVarDecl::setUnparsedDefaultArg(), clang::TSK_ExplicitSpecialization, clang::TSK_ImplicitInstantiation, and clang::TSK_Undeclared.

Referenced by MergeCompatibleFunctionDecls().

◆ mergeDeclAttributes()

◆ mergeDLLExportAttr()

DLLExportAttr * Sema::mergeDLLExportAttr ( Decl * D,
const AttributeCommonInfo & CI )

◆ mergeDLLImportAttr()

DLLImportAttr * Sema::mergeDLLImportAttr ( Decl * D,
const AttributeCommonInfo & CI )

◆ mergeEnforceTCBAttr()

EnforceTCBAttr * Sema::mergeEnforceTCBAttr ( Decl * D,
const EnforceTCBAttr & AL )

Definition at line 6990 of file SemaDeclAttr.cpp.

References mergeEnforceTCBAttrImpl().

Referenced by mergeDeclAttribute().

◆ mergeEnforceTCBLeafAttr()

EnforceTCBLeafAttr * Sema::mergeEnforceTCBLeafAttr ( Decl * D,
const EnforceTCBLeafAttr & AL )

Definition at line 6995 of file SemaDeclAttr.cpp.

References mergeEnforceTCBAttrImpl().

Referenced by mergeDeclAttribute().

◆ mergeErrorAttr()

◆ mergeFormatAttr()

FormatAttr * Sema::mergeFormatAttr ( Decl * D,
const AttributeCommonInfo & CI,
const IdentifierInfo * Format,
int FormatIdx,
int FirstArg )

◆ mergeFormatMatchesAttr()

FormatMatchesAttr * Sema::mergeFormatMatchesAttr ( Decl * D,
const AttributeCommonInfo & CI,
const IdentifierInfo * Format,
int FormatIdx,
StringLiteral * FormatStr )

◆ MergeFunctionDecl()

bool Sema::MergeFunctionDecl ( FunctionDecl * New,
NamedDecl *& Old,
Scope * S,
bool MergeTypeWithOld,
bool NewDeclIsDefn )

MergeFunctionDecl - We just parsed a function 'New' from declarator D which has the same name and scope as a previous declaration 'Old'.

Figure out how to resolve this situation, merging decls or emitting diagnostics as appropriate.

In C++, New and Old must be declarations that are not overloaded. Use IsOverload to determine whether New and Old are overloaded, and to select the Old declaration that New should be merged with.

Returns true if there was an error, false otherwise.

Definition at line 3686 of file SemaDecl.cpp.

References adjustDeclContextForDeclaratorDecl(), BuiltinFunction, canFullyTypeCheckRedeclaration(), canRedefineFunction(), clang::cast(), clang::Type::castAs(), clang::FunctionProtoType::ExtProtoInfo::CFIUncheckedCallee, CheckEquivalentExceptionSpec(), CheckRedeclarationInModule(), checkUsingShadowRedecl(), Context, clang::CPlusPlus, clang::ParmVarDecl::Create(), clang::SemaBase::Diag(), diagnoseFunctionEffectMergeConflicts(), clang::First, clang::Decl::FOK_None, clang::FunctionProtoType::ExtProtoInfo::FunctionEffects, clang::Type::getAs(), clang::Decl::getAsFunction(), getASTContext(), clang::FunctionDecl::getBuiltinID(), getCallingConvAttributedType(), clang::FunctionDecl::getCanonicalDecl(), clang::FunctionType::ExtInfo::getCC(), clang::Type::getContainedAutoType(), clang::FunctionDecl::getDeclaredReturnType(), clang::NamedDecl::getDeclName(), clang::FunctionType::getExtInfo(), clang::FunctionProtoType::getExtProtoInfo(), clang::Redeclarable< decl_type >::getFirstDecl(), clang::Decl::getFriendObjectKind(), clang::FunctionDecl::getFunctionEffects(), clang::FunctionType::ExtInfo::getHasRegParm(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::FunctionType::getNameForCallConv(), clang::FunctionType::ExtInfo::getNoCallerSavedRegs(), clang::FunctionType::ExtInfo::getNoReturn(), getNoteDiagForInvalidRedeclaration(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), clang::FunctionType::ExtInfo::getProducesResult(), clang::FunctionType::ExtInfo::getRegParm(), clang::FunctionType::getRegParmType(), clang::FunctionDecl::getReturnType(), clang::FunctionType::getReturnType(), clang::FunctionDecl::getReturnTypeSourceRange(), getSpecialMember(), clang::ValueDecl::getType(), clang::FunctionEffectSet::getUnion(), clang::Decl::hasAttr(), clang::NamedDecl::hasExternalFormalLinkage(), hasIdenticalPassObjectSizeAttrs(), clang::FunctionDecl::hasInheritedPrototype(), clang::FunctionDecl::hasPrototype(), clang::FunctionDecl::hasWrittenPrototype(), haveIncompatibleLanguageLinkages(), HLSL(), inTemplateInstantiation(), clang::isa(), clang::QualType::isCanonical(), clang::FunctionDecl::isDefined(), clang::FunctionDecl::isExplicitlyDefaulted(), clang::FunctionDecl::isExternC(), clang::FunctionDecl::isFunctionTemplateSpecialization(), clang::Decl::isImplicit(), clang::Decl::isInAnotherModuleUnit(), clang::FunctionDecl::isInlined(), clang::Decl::isInvalidDecl(), IsInvalidSMECallConversion(), clang::QualType::isNull(), clang::Type::isObjCObjectPointerType(), clang::DeclContext::isRecord(), clang::CXXMethodDecl::isStatic(), clang::FunctionDecl::isTrivial(), clang::Decl::isUsed(), maybeAddDeclWithEffects(), MergeCompatibleFunctionDecls(), New, notePreviousDefinition(), clang::nullptr, clang::FunctionDecl::redecls(), clang::FunctionDecl::redecls_end(), clang::SC_None, clang::SC_Static, clang::Decl::setImplicit(), clang::FunctionDecl::setTrivial(), SubstAutoType(), SubstAutoTypeDependent(), UndefinedButUsed, clang::FunctionType::ExtInfo::withCallingConv(), clang::FunctionType::ExtInfo::withNoCallerSavedRegs(), clang::FunctionType::ExtInfo::withNoReturn(), clang::FunctionType::ExtInfo::withProducesResult(), and clang::FunctionType::ExtInfo::withRegParm().

Referenced by CheckFunctionDeclaration().

◆ mergeInternalLinkageAttr() [1/2]

InternalLinkageAttr * Sema::mergeInternalLinkageAttr ( Decl * D,
const InternalLinkageAttr & AL )

◆ mergeInternalLinkageAttr() [2/2]

◆ mergeMinSizeAttr()

MinSizeAttr * Sema::mergeMinSizeAttr ( Decl * D,
const AttributeCommonInfo & CI )

◆ mergeModularFormatAttr()

ModularFormatAttr * Sema::mergeModularFormatAttr ( Decl * D,
const AttributeCommonInfo & CI,
const IdentifierInfo * ModularImplFn,
StringRef ImplName,
MutableArrayRef< StringRef > Aspects )

◆ mergeMSInheritanceAttr()

◆ mergeObjCMethodDecls()

◆ mergeOptimizeNoneAttr()

OptimizeNoneAttr * Sema::mergeOptimizeNoneAttr ( Decl * D,
const AttributeCommonInfo & CI )

◆ mergeSectionAttr()

◆ MergeTypedefNameDecl()

void Sema::MergeTypedefNameDecl ( Scope * S,
TypedefNameDecl * New,
LookupResult & OldDecls )

MergeTypedefNameDecl - We just parsed a typedef 'New' which has the same name and scope as a previous declaration 'Old'.

Figure out how to resolve this situation, merging decls or emitting diagnostics as appropriate. If there was an error, set New to be invalid.

Definition at line 2549 of file SemaDecl.cpp.

References clang::C11, CleanupMergedEnum(), Context, clang::CPlusPlus, CurContext, clang::SemaBase::Diag(), clang::LookupResult::getAsSingle(), getDiagnostics(), getLangOpts(), clang::Decl::getLocation(), getPointeeType(), clang::LookupResult::getRepresentativeDecl(), hasVisibleDefinition(), clang::isa(), clang::Decl::isImplicit(), isIncompatibleTypedef(), clang::Decl::isInvalidDecl(), clang::Type::isStructureType(), clang::SourceLocation::isValid(), makeMergedDefinitionVisible(), mergeDeclAttributes(), New, clang::NewTag, notePreviousDefinition(), ObjC(), clang::T, and clang::Typedef.

Referenced by ActOnTypedefNameDecl().

◆ mergeTypeVisibilityAttr()

TypeVisibilityAttr * Sema::mergeTypeVisibilityAttr ( Decl * D,
const AttributeCommonInfo & CI,
TypeVisibilityAttr::VisibilityType Vis )

Definition at line 2962 of file SemaDeclAttr.cpp.

Referenced by handleVisibilityAttr(), and mergeDeclAttribute().

◆ mergeUuidAttr()

UuidAttr * Sema::mergeUuidAttr ( Decl * D,
const AttributeCommonInfo & CI,
StringRef UuidAsWritten,
MSGuidDecl * GuidDecl )

◆ MergeVarDecl()

void Sema::MergeVarDecl ( VarDecl * New,
LookupResult & Previous )

MergeVarDecl - We just parsed a variable 'New' which has the same name and scope as a previous declaration 'Old'.

Figure out how to resolve this situation, merging decls or emitting diagnostics as appropriate.

Tentative definition rules (C99 6.9.2p2) are checked by FinalizeDeclaratorGroup. Unfortunately, we can't analyze tentative definitions here, since the initializer hasn't been attached.

Definition at line 4666 of file SemaDecl.cpp.

References adjustDeclContextForDeclaratorDecl(), CheckRedeclarationInModule(), checkUsingShadowRedecl(), checkVarDeclRedefinition(), clang::CPlusPlus, clang::VarDecl::DeclarationOnly, clang::VarDecl::Definition, clang::SemaBase::Diag(), clang::Decl::getAccess(), clang::VarDecl::getCanonicalDecl(), clang::VarDecl::getDefinition(), getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::VarDecl::getMostRecentDecl(), getNoteDiagForInvalidRedeclaration(), clang::Decl::getPreviousDecl(), clang::VarDecl::getStorageClass(), clang::VarTemplateDecl::getTemplatedDecl(), clang::TemplateDecl::getTemplateParameters(), clang::VarDecl::getTLSKind(), clang::Decl::hasAttr(), clang::NamedDecl::hasExternalFormalLinkage(), clang::VarDecl::hasInit(), clang::NamedDecl::hasLinkage(), haveIncompatibleLanguageLinkages(), clang::VarDecl::isConstexpr(), clang::Decl::isInAnotherModuleUnit(), clang::VarDecl::isInline(), clang::VarDecl::isLocalVarDeclOrParm(), clang::DeclContext::isRecord(), clang::VarDecl::isStaticDataMember(), clang::Decl::isUsed(), mergeDeclAttributes(), mergeTypeWithPrevious(), MergeVarDeclTypes(), New, notePreviousDefinition(), Previous, clang::SC_Extern, clang::SC_Static, clang::Decl::setAccess(), clang::Redeclarable< decl_type >::setPreviousDecl(), TemplateParameterListsAreEqual(), clang::VarDecl::TLS_Dynamic, TPL_TemplateMatch, and UndefinedButUsed.

Referenced by CheckVariableDeclaration().

◆ MergeVarDeclExceptionSpecs()

void Sema::MergeVarDeclExceptionSpecs ( VarDecl * New,
VarDecl * Old )

Merge the exception specifications of two variable declarations.

This is called when there's a redeclaration of a VarDecl. The function checks if the redeclaration might have an exception specification and validates compatibility and merges the specs if necessary.

Definition at line 1725 of file SemaDeclCXX.cpp.

References clang::Type::castAs(), CheckEquivalentExceptionSpec(), Context, clang::Type::getAs(), getLangOpts(), clang::Decl::getLocation(), clang::Type::getPointeeType(), getPointeeType(), clang::ValueDecl::getType(), clang::Type::isFunctionProtoType(), and New.

Referenced by MergeVarDeclTypes().

◆ MergeVarDeclTypes()

void Sema::MergeVarDeclTypes ( VarDecl * New,
VarDecl * Old,
bool MergeTypeWithOld )

MergeVarDeclTypes - We parsed a variable 'New' which has the same name and scope as a previous declaration 'Old'.

Figure out how to merge their types, emitting diagnostics as appropriate.

Declarations using the auto type specifier (C++ [decl.spec.auto]) call back to here in AddInitializerToDecl. We can't check them before the initializer is attached.

Definition at line 4550 of file SemaDecl.cpp.

References clang::Type::containsErrors(), Context, clang::CPlusPlus, diagnoseVarDeclTypeMismatch(), clang::ArrayType::getElementType(), getLangOpts(), clang::VarDecl::getMostRecentDecl(), clang::VarDecl::getPreviousDecl(), clang::ValueDecl::getType(), clang::Type::isArrayType(), clang::Type::isDependentType(), clang::Type::isIncompleteArrayType(), clang::Decl::isInvalidDecl(), clang::QualType::isNull(), clang::Type::isObjCObjectPointerType(), MergeVarDeclExceptionSpecs(), and New.

Referenced by DeduceVariableDeclarationType(), and MergeVarDecl().

◆ mergeVisibilityAttr()

VisibilityAttr * Sema::mergeVisibilityAttr ( Decl * D,
const AttributeCommonInfo & CI,
VisibilityAttr::VisibilityType Vis )

Definition at line 2955 of file SemaDeclAttr.cpp.

Referenced by handleVisibilityAttr(), and mergeDeclAttribute().

◆ mergeVisibilityType()

void Sema::mergeVisibilityType ( Decl * D,
SourceLocation Loc,
VisibilityAttr::VisibilityType Type )

◆ mightBeIntendedToBeTemplateName()

bool clang::Sema::mightBeIntendedToBeTemplateName ( ExprResult E,
bool & Dependent )
inline

Determine whether it's plausible that E was intended to be a template-name.

Definition at line 3847 of file Sema.h.

References clang::CPlusPlus, clang::Dependent, clang::ActionResult< PtrTy, Compress >::get(), getLangOpts(), and clang::ActionResult< PtrTy, Compress >::isInvalid().

◆ MIPS()

SemaMIPS & clang::Sema::MIPS ( )
inline

Definition at line 1478 of file Sema.h.

Referenced by handleInterruptAttr().

◆ ModifyFnAttributesMSPragmaOptimize()

void Sema::ModifyFnAttributesMSPragmaOptimize ( FunctionDecl * FD)

Only called on function definitions; if there is a MSVC #pragma optimize in scope, consider changing the function's attributes based on the optimization list passed to the pragma.

Definition at line 1300 of file SemaAttr.cpp.

References AddOptnoneAttributeIfNoConflicts(), clang::DeclaratorDecl::getBeginLoc(), and MSPragmaOptimizeIsOn.

Referenced by ActOnFunctionDeclarator().

◆ MSP430()

SemaMSP430 & clang::Sema::MSP430 ( )
inline

Definition at line 1483 of file Sema.h.

Referenced by handleInterruptAttr().

◆ needsRebuildOfDefaultArgOrInit()

bool clang::Sema::needsRebuildOfDefaultArgOrInit ( ) const
inline

◆ NeedToCaptureVariable()

bool Sema::NeedToCaptureVariable ( ValueDecl * Var,
SourceLocation Loc )

Checks if the variable must be captured.

Definition at line 19756 of file SemaExpr.cpp.

References clang::Implicit, and tryCaptureVariable().

Referenced by BuildDeclRefExpr().

◆ NoteAllFoundTemplates()

◆ NoteAllOverloadCandidates()

◆ NoteDeletedFunction()

◆ NoteDeletedInheritingConstructor()

◆ NoteHiddenVirtualMethods()

void Sema::NoteHiddenVirtualMethods ( CXXMethodDecl * MD,
SmallVectorImpl< CXXMethodDecl * > & OverloadedMethods )

◆ NoteOverloadCandidate()

◆ notePreviousDefinition()

◆ NoteTemplateLocation()

◆ NoteTemplateParameterLocation()

◆ NVPTX()

SemaNVPTX & clang::Sema::NVPTX ( )
inline

Definition at line 1488 of file Sema.h.

◆ ObjC()

SemaObjC & clang::Sema::ObjC ( )
inline

Definition at line 1493 of file Sema.h.

Referenced by ActOnCastExpr(), ActOnCXXForRangeStmt(), ActOnDependentMemberExpr(), ActOnEndOfTranslationUnit(), ActOnFields(), ActOnFinishFunctionBody(), ActOnFunctionDeclarator(), ActOnIdExpression(), ActOnModuleImport(), ActOnNameClassifiedAsNonType(), ActOnPopScope(), ActOnVariableDeclarator(), AddClassMessageCompletions(), AddInitializerToDecl(), addMethodsToPool(), ApplyAPINotesType(), applyCocoaAPICheck(), BuildExceptionDeclaration(), BuildFunctionType(), BuildLambdaExpr(), CheckAssignmentConstraints(), CheckAssignmentOperands(), clang::checkCollectionLiteralElement(), CheckCompareOperands(), CheckCompleteVariableDeclaration(), CheckConditionalOperands(), CheckFieldDecl(), CheckFunctionCall(), CheckImplicitConversion(), CheckKeyForObjCARCConversion(), CheckObjCCollectionLiteralElement(), CheckPlaceholderExpr(), CheckPropertyAgainstProtocol(), CheckSingleAssignmentConstraints(), clang::checkSwiftAsyncErrorBlock(), CheckTautologicalComparison(), checkUnsafeAssignLiteral(), ClassifyName(), classifyPointerDeclarator(), CreateBuiltinArraySubscriptExpr(), CXXCheckConditionalOperands(), DeduceVariableDeclarationType(), DefaultVariadicArgumentPromotion(), DiagnoseAssignmentAsCondition(), DiagnoseAssignmentResult(), DiagnoseCStringFormatDirectiveInObjCAPI(), DiagnoseFloatingImpCast(), DiagnoseMismatchedSelectors(), diagnoseObjCARCConversion(), diagnoseObjCLiteralComparison(), DiagnoseUnusedOfDecl(), emitBadConversionNotes(), FinishCXXForRangeStmt(), FinishForRangeVarDecl(), GatherArgumentsForCall(), GetTypeForDeclaratorCast(), handleFormatArgAttr(), handleFormatAttrCommon(), handleFunctionTypeAttr(), hasIsEqualMethod(), HelperIsMethodInObjCType(), HelperToDiagnoseMismatchedMethodsInGlobalPool(), Initialize(), clang::InitializationSequence::InitializeFrom(), InstantiateAttrs(), clang::isErrorParameter(), isMethodDeclaredInRootProtocol(), isObjCPointerConversion(), IsStandardConversion(), LookupDirectMethodInGlobalPool(), LookupMemberExpr(), LookupMethodInReceiverType(), LookupObjCInterfaceDeclForLiteral(), mergeObjCMethodDecls(), MergeTypedefNameDecl(), moveMethodToBackOfGlobalList(), PerformImplicitConversion(), PerformImplicitConversion(), ProcessDeclAttribute(), clang::ASTReader::ReadMethodPool(), clang::TreeTransform< AdjustConstraints >::RebuildCXXForRangeStmt(), clang::TreeTransform< AdjustConstraints >::RebuildObjCArrayLiteral(), clang::TreeTransform< AdjustConstraints >::RebuildObjCAtCatchStmt(), clang::TreeTransform< AdjustConstraints >::RebuildObjCAtFinallyStmt(), clang::TreeTransform< AdjustConstraints >::RebuildObjCAtSynchronizedOperand(), clang::TreeTransform< AdjustConstraints >::RebuildObjCAtSynchronizedStmt(), clang::TreeTransform< AdjustConstraints >::RebuildObjCAtThrowStmt(), clang::TreeTransform< AdjustConstraints >::RebuildObjCAtTryStmt(), clang::TreeTransform< AdjustConstraints >::RebuildObjCAutoreleasePoolStmt(), clang::TreeTransform< AdjustConstraints >::RebuildObjCBoxedExpr(), clang::TreeTransform< AdjustConstraints >::RebuildObjCDictionaryLiteral(), clang::TreeTransform< AdjustConstraints >::RebuildObjCExceptionDecl(), clang::TreeTransform< AdjustConstraints >::RebuildObjCForCollectionStmt(), clang::TreeTransform< AdjustConstraints >::RebuildObjCSubscriptRefExpr(), Sema(), ShouldDiagnoseAvailabilityOfDecl(), tryObjCWritebackConversion(), and ValidateObjCLiteralInterfaceDecl().

◆ OpenACC()

SemaOpenACC & clang::Sema::OpenACC ( )
inline

Definition at line 1498 of file Sema.h.

Referenced by ActOnArraySubscriptExpr(), ActOnEndOfTranslationUnit(), ActOnFunctionDeclarator(), ActOnVariableDeclarator(), AddInitializerToDecl(), BuildCXXThrow(), MarkExprReferenced(), mergeDeclAttribute(), clang::Parser::ParseOpenACCDirectiveStmt(), clang::TreeTransform< AdjustConstraints >::RebuildArraySectionExpr(), clang::TreeTransform< AdjustConstraints >::RebuildOpenACCAsteriskSizeExpr(), clang::TreeTransform< AdjustConstraints >::RebuildOpenACCAtomicConstruct(), clang::TreeTransform< AdjustConstraints >::RebuildOpenACCCacheConstruct(), clang::TreeTransform< AdjustConstraints >::RebuildOpenACCCombinedConstruct(), clang::TreeTransform< AdjustConstraints >::RebuildOpenACCComputeConstruct(), clang::TreeTransform< AdjustConstraints >::RebuildOpenACCDataConstruct(), clang::TreeTransform< AdjustConstraints >::RebuildOpenACCEnterDataConstruct(), clang::TreeTransform< AdjustConstraints >::RebuildOpenACCExitDataConstruct(), clang::TreeTransform< AdjustConstraints >::RebuildOpenACCHostDataConstruct(), clang::TreeTransform< AdjustConstraints >::RebuildOpenACCInitConstruct(), clang::TreeTransform< AdjustConstraints >::RebuildOpenACCLoopConstruct(), clang::TreeTransform< AdjustConstraints >::RebuildOpenACCSetConstruct(), clang::TreeTransform< AdjustConstraints >::RebuildOpenACCShutdownConstruct(), clang::TreeTransform< AdjustConstraints >::RebuildOpenACCUpdateConstruct(), and clang::TreeTransform< AdjustConstraints >::RebuildOpenACCWaitConstruct().

◆ OpenCL()

◆ OpenMP()

SemaOpenMP & clang::Sema::OpenMP ( )
inline

Definition at line 1508 of file Sema.h.

Referenced by ActOnArraySubscriptExpr(), ActOnCallExpr(), ActOnDeclarator(), ActOnDecompositionDeclarator(), ActOnEndOfTranslationUnit(), actOnOMPReductionKindClause(), ActOnStartOfFunctionDef(), ActOnStartOfLambdaDefinition(), BuildArrayType(), buildCapture(), buildCapturedStmtCaptureList(), BuildCXXForRangeStmt(), BuildFieldReferenceExpr(), buildImplicitMap(), BuildVAArgExpr(), captureInBlock(), captureInCapturedRegion(), CheckFunctionDeclaration(), DiagnoseUseOfDecl(), FinalizeDeclaratorGroup(), getEmissionStatus(), getNonOdrUseReasonInCurrentContext(), HandleDeclarator(), instantiateOMPDeclareSimdDeclAttr(), instantiateOMPDeclareVariantAttr(), isNonNegativeIntegerValue(), isOpenMPDeviceDelayedContext(), MarkExprReferenced(), MarkVarDeclODRUsed(), MarkVTableUsed(), parseDeclareSimdClauses(), PopFunctionScopeInfo(), ProcessDeclAttribute(), processImplicitMapsWithDefaultMappers(), ProcessOpenMPDoacrossClauseCommon(), PushCapturedRegionScope(), PushFunctionScope(), clang::TreeTransform< AdjustConstraints >::RebuildArraySectionExpr(), clang::TreeTransform< AdjustConstraints >::RebuildOMPAffinityClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPAlignClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPAlignedClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPAllocateClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPAllocatorClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPArrayShapingExpr(), clang::TreeTransform< AdjustConstraints >::RebuildOMPAtClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPBindClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPCanonicalLoop(), clang::TreeTransform< AdjustConstraints >::RebuildOMPCollapseClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPCopyinClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPCopyprivateClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPDefaultClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPDefaultmapClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPDependClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPDepobjClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPDestroyClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPDetachClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPDeviceClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPDistScheduleClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPDoacrossClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPDynGroupprivateClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPExclusiveClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPExecutableDirective(), clang::TreeTransform< AdjustConstraints >::RebuildOMPFilterClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPFinalClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPFirstprivateClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPFlushClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPFromClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPFullClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPGrainsizeClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPHasDeviceAddrClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPHintClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPHoldsClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPIfClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPInclusiveClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPInformationalDirective(), clang::TreeTransform< AdjustConstraints >::RebuildOMPInitClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPInReductionClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPIsDevicePtrClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPIteratorExpr(), clang::TreeTransform< AdjustConstraints >::RebuildOMPLastprivateClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPLinearClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPLoopRangeClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPMapClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPMessageClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPNocontextClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPNontemporalClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPNovariantsClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPNowaitClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPNumTasksClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPNumTeamsClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPNumThreadsClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPOrderClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPOrderedClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPPartialClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPPermutationClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPPriorityClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPPrivateClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPProcBindClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPReductionClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPSafelenClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPScheduleClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPSeverityClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPSharedClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPSimdlenClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPSizesClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPTaskReductionClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPThreadLimitClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPToClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPTransparentClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPUseClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPUseDeviceAddrClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPUseDevicePtrClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPUsesAllocatorsClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPXAttributeClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPXBareClause(), clang::TreeTransform< AdjustConstraints >::RebuildOMPXDynCGroupMemClause(), clang::TreeTransform< AdjustConstraints >::RebuildOpenMPTransparentClause(), Sema(), setBranchProtectedScope(), targetDiag(), tryCaptureVariable(), and ~Sema().

◆ OutermostDeclarationWithDelayedImmediateInvocations()

std::optional< ExpressionEvaluationContextRecord::InitializationContext > clang::Sema::OutermostDeclarationWithDelayedImmediateInvocations ( ) const
inline

Definition at line 8238 of file Sema.h.

References ExprEvalContexts, and PotentiallyEvaluated.

Referenced by BuildCXXDefaultArgExpr(), and BuildCXXDefaultInitExpr().

◆ parentEvaluationContext() [1/2]

◆ parentEvaluationContext() [2/2]

const ExpressionEvaluationContextRecord & clang::Sema::parentEvaluationContext ( ) const
inline

Definition at line 6968 of file Sema.h.

References parentEvaluationContext(), and Sema().

◆ ParsedFreeStandingDeclSpec() [1/2]

Decl * Sema::ParsedFreeStandingDeclSpec ( Scope * S,
AccessSpecifier AS,
DeclSpec & DS,
const ParsedAttributesView & DeclAttrs,
MultiTemplateParamsArg TemplateParams,
bool IsExplicitInstantiation,
RecordDecl *& AnonRecord,
SourceLocation EllipsisLoc = {} )

ParsedFreeStandingDeclSpec - This method is invoked when a declspec with no declarator (e.g.

"struct foo;") is parsed. It also accepts template parameters to cope with template friend declarations.

Definition at line 5221 of file SemaDecl.cpp.

References ActOnDocumentableDecl(), ActOnFriendTypeDecl(), BuildAnonymousStructOrUnion(), BuildMicrosoftCAnonymousStruct(), clang::C23, clang::cast(), Context, clang::CPlusPlus, clang::FixItHint::CreateRemoval(), CurContext, clang::SemaBase::Diag(), DiagnoseFunctionSpecifiers(), clang::ParsedAttributesView::empty(), clang::Enum, clang::OpaquePtr< PtrTy >::get(), clang::Type::getAsRecordDecl(), clang::DeclSpec::getAtomicSpecLoc(), clang::DeclSpec::getAttributes(), clang::DeclSpec::getBeginLoc(), clang::DeclSpec::getConstexprSpecifier(), clang::DeclSpec::getConstexprSpecLoc(), clang::DeclSpec::getConstSpecLoc(), GetDiagnosticTypeSpecifierID(), clang::DeclSpec::getInlineSpecLoc(), getLangOpts(), clang::DeclSpec::getModulePrivateSpecLoc(), clang::DeclSpec::getRepAsDecl(), clang::DeclSpec::getRepAsType(), clang::DeclSpec::getRestrictSpecLoc(), clang::DeclSpec::getSourceRange(), clang::DeclSpec::getSpecifierName(), clang::DeclSpec::getStorageClassSpec(), clang::DeclSpec::getStorageClassSpecLoc(), clang::DeclSpec::getThreadStorageClassSpec(), clang::DeclSpec::getThreadStorageClassSpecLoc(), clang::DeclSpec::getTypeQualifiers(), clang::DeclSpec::getTypeSpecType(), clang::DeclSpec::getUnalignedSpecLoc(), handleTagNumbering(), clang::DeclSpec::hasConstexprSpecifier(), clang::isa(), clang::DeclSpec::isExternInLinkageSpec(), clang::DeclSpec::isFriendSpecified(), clang::DeclSpec::isInlineSpecified(), clang::SourceLocation::isInvalid(), clang::Decl::isInvalidDecl(), clang::DeclSpec::isMissingDeclaratorOk(), clang::DeclSpec::isModulePrivateSpecified(), clang::DeclSpec::SCS_mutable, clang::DeclSpec::SCS_typedef, clang::DeclSpec::SCS_unspecified, clang::DeclSpec::TQ_atomic, clang::DeclSpec::TQ_const, clang::DeclSpec::TQ_restrict, clang::DeclSpec::TQ_unaligned, clang::DeclSpec::TQ_volatile, clang::DeclSpec::TST_class, clang::DeclSpec::TST_enum, clang::DeclSpec::TST_error, clang::DeclSpec::TST_interface, clang::DeclSpec::TST_struct, clang::DeclSpec::TST_typename, and clang::DeclSpec::TST_union.

◆ ParsedFreeStandingDeclSpec() [2/2]

Decl * Sema::ParsedFreeStandingDeclSpec ( Scope * S,
AccessSpecifier AS,
DeclSpec & DS,
const ParsedAttributesView & DeclAttrs,
RecordDecl *& AnonRecord )

ParsedFreeStandingDeclSpec - This method is invoked when a declspec with no declarator (e.g.

"struct foo;") is parsed.

Definition at line 4996 of file SemaDecl.cpp.

References ParsedFreeStandingDeclSpec().

Referenced by ParsedFreeStandingDeclSpec().

◆ ParseLifetimeCaptureByAttr()

◆ ParseTypedefDecl()

◆ PerformContextualImplicitConversion()

ExprResult Sema::PerformContextualImplicitConversion ( SourceLocation Loc,
Expr * From,
ContextualImplicitConverter & Converter )

Perform a contextual implicit conversion.

Attempt to convert the given expression to a type which is accepted by the given converter.

This routine will attempt to convert an expression of class type to a type accepted by the specified converter. In C++11 and before, the class must have a single non-explicit conversion function converting to a matching type. In C++1y, there can be multiple such conversion functions, but only one target type.

Parameters
LocThe source location of the construct that requires the conversion.
FromThe expression we're converting from.
ConverterUsed to control and diagnose the conversion process.
Returns
The expression, converted to an integral or enumeration type if successful.

Definition at line 6875 of file SemaOverload.cpp.

References clang::UnresolvedSetImpl::addDecl(), clang::OverloadCandidateSet::BestViableFunction(), clang::cast(), CheckPlaceholderExpr(), collectViableConversionCandidates(), Conversions, clang::CPlusPlus, clang::CPlusPlus14, clang::OverloadCandidateSet::CSK_Normal, DefaultLvalueConversion(), diagnoseAmbiguousConversion(), clang::Sema::ContextualImplicitConverter::diagnoseIncomplete(), clang::Sema::ContextualImplicitConverter::diagnoseNoMatch(), diagnoseNoViableConversion(), clang::ExprError(), finishContextualImplicitConversion(), clang::Found, clang::ActionResult< PtrTy, Compress >::get(), clang::CXXConversionDecl::getConversionType(), getLangOpts(), clang::QualType::getNonReferenceType(), clang::Stmt::getSourceRange(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::Expr::getType(), clang::NamedDecl::getUnderlyingDecl(), clang::QualType::getUnqualifiedType(), clang::Expr::hasPlaceholderType(), isCompleteType(), clang::CXXConversionDecl::isExplicit(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Expr::isTypeDependent(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::DeclAccessPair::make(), clang::Sema::ContextualImplicitConverter::match(), clang::OR_Ambiguous, clang::OR_Deleted, clang::OR_No_Viable_Function, clang::OR_Success, recordConversion(), RequireCompleteType(), Sema(), clang::UnresolvedSetImpl::size(), clang::Sema::ContextualImplicitConverter::Suppress, and clang::T.

Referenced by ActOnCXXDelete(), BuildCXXNew(), BuiltinRotateGeneric(), CheckSwitchCondition(), and VerifyIntegerConstantExpression().

◆ PerformContextuallyConvertToBool()

◆ PerformContextuallyConvertToObjCPointer()

ExprResult Sema::PerformContextuallyConvertToObjCPointer ( Expr * From)

PerformContextuallyConvertToObjCPointer - Perform a contextual conversion of the expression From to an Objective-C pointer type.

Returns a valid but null ExprResult if no conversion sequence exists.

Definition at line 6656 of file SemaOverload.cpp.

References checkPlaceholderForOverload(), Context, clang::Converting, clang::ExprError(), clang::ImplicitConversionSequence::isBad(), PerformImplicitConversion(), and TryContextuallyConvertToObjCPointer().

◆ PerformCopyInitialization()

ExprResult Sema::PerformCopyInitialization ( const InitializedEntity & Entity,
SourceLocation EqualLoc,
ExprResult Init,
bool TopLevelOfInitList = false,
bool AllowExplicit = false )

◆ PerformDependentDiagnostics()

void Sema::PerformDependentDiagnostics ( const DeclContext * Pattern,
const MultiLevelTemplateArgumentList & TemplateArgs )

◆ performFunctionEffectAnalysis()

void clang::Sema::performFunctionEffectAnalysis ( TranslationUnitDecl * TU)

Definition at line 1514 of file SemaFunctionEffects.cpp.

References Diags, and hasUncompilableErrorOccurred().

Referenced by ActOnEndOfTranslationUnit().

◆ PerformImplicitConversion() [1/3]

ExprResult Sema::PerformImplicitConversion ( Expr * From,
QualType ToType,
AssignmentAction Action,
bool AllowExplicit = false )

PerformImplicitConversion - Perform an implicit conversion of the expression From to the type ToType.

Returns the converted expression. Flavor is the kind of conversion we're performing, used in the error message. If AllowExplicit, explicit user-defined conversions are permitted.

Definition at line 1883 of file SemaOverload.cpp.

References checkPlaceholderForOverload(), clang::ExprError(), clang::Stmt::getBeginLoc(), getLangOpts(), clang::Expr::getType(), clang::ObjC, ObjC(), clang::Passing, PerformImplicitConversion(), clang::Sending, and TryImplicitConversion().

◆ PerformImplicitConversion() [2/3]

ExprResult Sema::PerformImplicitConversion ( Expr * From,
QualType ToType,
const ImplicitConversionSequence & ICS,
AssignmentAction Action,
CheckedConversionKind CCK = CheckedConversionKind::Implicit )

PerformImplicitConversion - Perform an implicit conversion of the expression From to the type ToType using the pre-computed implicit conversion sequence ICS.

Returns the converted expression. Action is the kind of conversion we're performing, used in the error message.

Definition at line 4590 of file SemaExprCXX.cpp.

References clang::UserDefinedConversionSequence::After, clang::ImplicitConversionSequence::AmbiguousConversion, clang::ImplicitConversionSequence::BadConversion, clang::UserDefinedConversionSequence::Before, BuildCXXCastArgument(), clang::cast(), CheckAssignmentConstraints(), clang::Compatible, Context, clang::UserDefinedConversionSequence::ConversionFunction, clang::Converting, clang::ImplicitConversionSequence::DiagnoseAmbiguousConversion(), DiagnoseAssignmentResult(), clang::ImplicitConversionSequence::EllipsisConversion, clang::UserDefinedConversionSequence::EllipsisConversion, clang::ExprError(), clang::ForBuiltinOverloadedOp, clang::UserDefinedConversionSequence::FoundConversionFunction, clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::Expr::getExprLoc(), clang::ImplicitConversionSequence::getKind(), clang::QualType::getNonReferenceType(), clang::FunctionDecl::getParamDecl(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::UserDefinedConversionSequence::HadMultipleCandidates, clang::Incompatible, clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Type::isRecordType(), clang::SemaBase::PDiag(), PerformImplicitConversion(), clang::ImplicitConversionSequence::Standard, clang::ImplicitConversionSequence::StandardConversion, clang::ImplicitConversionSequence::StaticObjectArgumentConversion, clang::ImplicitConversionSequence::UserDefined, and clang::ImplicitConversionSequence::UserDefinedConversion.

Referenced by ActOnCXXDelete(), BuildConvertedConstantExpression(), buildCounterInit(), buildCounterUpdate(), BuildCXXNew(), CheckDestructor(), checkOpenMPLoop(), CheckSingleAssignmentConstraints(), CreateOverloadedArraySubscriptExpr(), CreateOverloadedBinOp(), CreateOverloadedUnaryOp(), findOMPAllocatorHandleT(), clang::InitializationSequence::Perform(), PerformContextuallyConvertToBool(), PerformContextuallyConvertToObjCPointer(), PerformImplicitConversion(), PerformImplicitConversion(), and widenIterationCount().

◆ PerformImplicitConversion() [3/3]

ExprResult Sema::PerformImplicitConversion ( Expr * From,
QualType ToType,
const StandardConversionSequence & SCS,
AssignmentAction Action,
CheckedConversionKind CCK )

PerformImplicitConversion - Perform an implicit conversion of the expression From to the type ToType by following the standard conversion sequence SCS.

Returns the converted expression. Flavor is the context in which we're performing this conversion, for use in error messages.

Definition at line 4706 of file SemaExprCXX.cpp.

References adjustVectorType(), Ambiguous, clang::Assigning, BuildCXXConstructExpr(), clang::cast(), clang::Type::castAs(), clang::Type::castAsEnumDecl(), clang::Casting, CheckDerivedToBaseConversion(), CheckExceptionSpecCompatibility(), CheckMemberPointerConversion(), clang::SemaObjC::CheckObjCConversion(), CheckPlaceholderExpr(), CheckPointerConversion(), CheckTransparentUnionArgumentConstraints(), clang::Compatible, clang::Complete, CompleteConstructorCall(), Context, clang::Converting, clang::StandardConversionSequence::CopyConstructor, clang::CPlusPlus11, clang::ImplicitCastExpr::Create(), clang::CStyleCast, DefaultLvalueConversion(), clang::StandardConversionSequence::DeprecatedStringLiteralToCharPtr, clang::SemaBase::Diag(), diagnoseNullableToNonnullConversion(), DiagnoseUseOfDecl(), DifferentPointee, clang::StandardConversionSequence::Dimension, Downcast, clang::SemaObjC::EmitRelatedResultTypeNote(), clang::ExprError(), clang::StandardConversionSequence::First, FixOverloadedFunctionReference(), clang::Found, clang::StandardConversionSequence::FoundCopyConstructor, clang::FunctionalCast, clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), clang::Type::getAs(), getASTContext(), clang::Stmt::getBeginLoc(), clang::ArrayParameterType::getConstantArrayType(), clang::Expr::getExprLoc(), getLangOpts(), clang::QualType::getNonLValueExprType(), clang::QualType::getNonReferenceType(), clang::Expr::getObjectKind(), clang::Type::getPointeeType(), getPointeeType(), clang::QualType::getQualifiers(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::QualType::getUnqualifiedType(), clang::Expr::getValueKind(), clang::AtomicType::getValueType(), clang::Qualifiers::hasUnaligned(), HLSL(), clang::ICK_Array_To_Pointer, clang::ICK_Block_Pointer_Conversion, clang::ICK_Boolean_Conversion, clang::ICK_C_Only_Conversion, clang::ICK_Compatible_Conversion, clang::ICK_Complex_Conversion, clang::ICK_Complex_Promotion, clang::ICK_Complex_Real, clang::ICK_Derived_To_Base, clang::ICK_Fixed_Point_Conversion, clang::ICK_Floating_Conversion, clang::ICK_Floating_Integral, clang::ICK_Floating_Promotion, clang::ICK_Function_Conversion, clang::ICK_Function_To_Pointer, clang::ICK_HLSL_Array_RValue, clang::ICK_HLSL_Matrix_Splat, clang::ICK_HLSL_Matrix_Truncation, clang::ICK_HLSL_Vector_Splat, clang::ICK_HLSL_Vector_Truncation, clang::ICK_Identity, clang::ICK_Incompatible_Pointer_Conversion, clang::ICK_Integral_Conversion, clang::ICK_Integral_Promotion, clang::ICK_Lvalue_To_Rvalue, clang::ICK_Num_Conversion_Kinds, clang::ICK_Pointer_Conversion, clang::ICK_Pointer_Member, clang::ICK_Qualification, clang::ICK_RVV_Vector_Conversion, clang::ICK_SVE_Vector_Conversion, clang::ICK_TransparentUnionConversion, clang::ICK_Vector_Conversion, clang::ICK_Vector_Splat, clang::ICK_Writeback_Conversion, clang::ICK_Zero_Event_Conversion, clang::ICK_Zero_Queue_Conversion, ImpCastExprToType(), Inaccessible, clang::StandardConversionSequence::IncompatibleObjC, clang::Initializing, clang::Qualifiers::isAddressSpaceSupersetOf(), clang::Type::isArrayParameterType(), clang::Type::isBlockPointerType(), clang::Type::isBooleanType(), clang::Type::isBuiltinType(), isCast(), clang::Type::isConstantMatrixType(), clang::EnumDecl::isFixed(), clang::Type::isFixedPointType(), clang::Type::isFloatingType(), clang::Type::isHalfType(), clang::Type::isIntegerType(), clang::Type::isIntegralType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Expr::isNullPointerConstant(), clang::Type::isObjCObjectPointerType(), clang::Type::isPointerType(), clang::Expr::isPRValue(), clang::Type::isRealFloatingType(), clang::Type::isReferenceType(), clang::Type::isVectorType(), NotDerived, clang::Expr::NPC_ValueDependentIsNull, ObjC(), clang::OK_ObjCProperty, clang::Passing, clang::Passing_CFAudited, clang::SemaObjC::PrepareCastToObjCObjectPointer(), prepareMatrixSplat(), prepareVectorSplat(), ResolveAddressOfOverloadedFunction(), clang::Returning, ScalarTypeToBooleanCastKind(), clang::StandardConversionSequence::Second, clang::Sending, Success, TemporaryMaterializationConversion(), clang::StandardConversionSequence::Third, Virtual, and clang::VK_PRValue.

◆ PerformImplicitObjectArgumentInitialization()

ExprResult Sema::PerformImplicitObjectArgumentInitialization ( Expr * From,
NestedNameSpecifier Qualifier,
NamedDecl * FoundDecl,
CXXMethodDecl * Method )

PerformObjectArgumentInitialization - Perform initialization of the implicit object parameter for the given Method with the given expression.

Definition at line 6138 of file SemaOverload.cpp.

References clang::ImplicitConversionSequence::Bad, clang::BadConversionSequence::bad_qualifiers, clang::Expr::Classify(), Context, CreateMaterializeTemporaryExpr(), Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::Qualifiers::getCVRQualifiers(), clang::Type::getPointeeType(), clang::QualType::getQualifiers(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::getValueKind(), clang::ICK_Derived_To_Base, ImpCastExprToType(), clang::ImplicitConversionSequence::isBad(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), clang::Expr::isPRValue(), clang::Expr::Classification::isRValue(), clang::BadConversionSequence::Kind, clang::BadConversionSequence::lvalue_ref_to_rvalue, clang::Expr::Classification::makeSimpleLValue(), clang::Method, clang::BadConversionSequence::no_conversion, PerformObjectMemberConversion(), clang::RQ_RValue, clang::BadConversionSequence::rvalue_ref_to_lvalue, clang::StandardConversionSequence::Second, clang::ImplicitConversionSequence::Standard, clang::BadConversionSequence::too_few_initializers, clang::BadConversionSequence::too_many_initializers, TryObjectArgumentInitialization(), and clang::BadConversionSequence::unrelated_class.

Referenced by BuildCallToMemberFunction(), BuildCallToObjectOfClassType(), BuildCXXMemberCallExpr(), BuildOverloadedArrowExpr(), convertArgsForAvailabilityChecks(), CreateOverloadedArraySubscriptExpr(), CreateOverloadedBinOp(), and CreateOverloadedUnaryOp().

◆ PerformMemberExprBaseConversion()

ExprResult Sema::PerformMemberExprBaseConversion ( Expr * Base,
bool IsArrow )

Perform conversions on the LHS of a member access expression.

Definition at line 1208 of file SemaExprMember.cpp.

References CheckPlaceholderExpr(), and DefaultFunctionArrayLvalueConversion().

Referenced by LookupMemberExpr(), and clang::TreeTransform< AdjustConstraints >::RebuildMemberExpr().

◆ PerformMoveOrCopyInitialization()

ExprResult Sema::PerformMoveOrCopyInitialization ( const InitializedEntity & Entity,
const NamedReturnInfo & NRInfo,
Expr * Value,
bool SupressSimplerImplicitMoves = false )

Perform the initialization of a potentially-movable value, which is the result of return value.

This routine implements C++20 [class.copy.elision]p3, which attempts to treat returned lvalues as rvalues in certain cases (to prefer move construction), then falls back to treating them as lvalues if that failed.

Definition at line 3542 of file SemaStmt.cpp.

References Context, clang::CPlusPlus, clang::CPlusPlus11, clang::CPlusPlus23, clang::ImplicitCastExpr::Create(), clang::InitializationKind::CreateCopy(), getLangOpts(), clang::Value::getType(), InitializationSequence, clang::Sema::NamedReturnInfo::isMoveEligible(), clang::ImplicitCastExpr::OnStack, clang::OR_Deleted, clang::OR_Success, PerformCopyInitialization(), clang::Seq, VerifyInitializationSequenceCXX98(), and clang::VK_XValue.

Referenced by ActOnCapScopeReturnStmt(), BuildCXXThrow(), BuildReturnStmt(), and checkEscapingByref().

◆ PerformObjectMemberConversion()

ExprResult Sema::PerformObjectMemberConversion ( Expr * From,
NestedNameSpecifier Qualifier,
NamedDecl * FoundDecl,
NamedDecl * Member )

Cast a base object to a member's actual type.

There are two relevant checks:

C++ [class.access.base]p7:

If a class member access operator [...] is used to access a non-static data member or non-static member function, the reference is ill-formed if the left operand [...] cannot be implicitly converted to a pointer to the naming class of the right operand.

C++ [expr.ref]p7:

If E2 is a non-static data member or a non-static member function, the program is ill-formed if the class of which E2 is directly a member is an ambiguous base (11.8) of the naming class (11.9.3) of E2.

Note that the latter check does not consider access; the access of the "real" base class is checked as appropriate when checking the access of the member name.

Definition at line 3006 of file SemaExpr.cpp.

References clang::Type::castAs(), CheckDerivedToBaseConversion(), Context, clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::QualType::getAddressSpace(), clang::Type::getAs(), clang::SourceRange::getBegin(), clang::Type::getPointeeType(), clang::QualType::getQualifiers(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::getValueKind(), ImpCastExprToType(), clang::isa(), clang::Type::isDependentType(), IsDerivedFrom(), clang::Type::isRecordType(), clang::Member, clang::Method, clang::Qualifiers::setAddressSpace(), and clang::NestedNameSpecifier::Type.

Referenced by BuildFieldReferenceExpr(), PerformImplicitObjectArgumentInitialization(), and clang::TreeTransform< AdjustConstraints >::RebuildMemberExpr().

◆ PerformPendingInstantiations()

◆ PerformQualificationConversion()

◆ popCodeSynthesisContext()

◆ PopCompoundScope()

void Sema::PopCompoundScope ( )

◆ PopDeclContext()

◆ PopExpressionEvaluationContext()

◆ PopFunctionScopeInfo()

Sema::PoppedFunctionScopePtr Sema::PopFunctionScopeInfo ( const sema::AnalysisBasedWarnings::Policy * WP = nullptr,
Decl * D = nullptr,
QualType BlockType = QualType() )

Pop a function (or block or lambda or captured region) scope from the stack.

Parameters
WPThe warning policy to use for CFG-based warnings, or null if such warnings should not be produced.
DThe declaration corresponding to this function scope, if producing CFG-based warnings.
BlockTypeThe type of the block expression, if D is a BlockDecl.

Definition at line 2449 of file Sema.cpp.

References AnalysisWarnings, clang::SemaBase::Diag(), FunctionScopes, clang::inferNoReturnAttr(), LangOpts, markEscapingByrefs(), and OpenMP().

Referenced by ActOnBlockError(), ActOnBlockStmtExpr(), ActOnCapturedRegionEnd(), ActOnCapturedRegionError(), ActOnFinishCXXInClassMemberInitializer(), ActOnFinishFunctionBody(), ActOnFinishTopLevelStmtDecl(), ActOnLambdaError(), and BuildLambdaExpr().

◆ PopParsingClass()

void clang::Sema::PopParsingClass ( ParsingClassState state)
inline

Definition at line 6576 of file Sema.h.

References clang::Sema::DelayedDiagnostics::popUndelayed().

◆ PopParsingDeclaration()

◆ PopPragmaVisibility()

void Sema::PopPragmaVisibility ( bool IsNamespaceEnd,
SourceLocation EndLoc )

PopPragmaVisibility - Pop the top element of the visibility stack; used for '#pragma GCC visibility' and visibility attributes on namespaces.

Definition at line 1549 of file SemaAttr.cpp.

References clang::SemaBase::Diag(), FreeVisContext(), NoVisibility, and VisContext.

Referenced by ActOnFinishNamespaceDef(), and ActOnPragmaVisibility().

◆ PopSatisfactionStackEntry()

void clang::Sema::PopSatisfactionStackEntry ( )
inline

Definition at line 14844 of file Sema.h.

◆ PPC()

SemaPPC & clang::Sema::PPC ( )
inline

◆ PreferredConditionType()

QualType clang::Sema::PreferredConditionType ( ConditionKind K) const
inline

Definition at line 7997 of file Sema.h.

References Context, and Switch.

Referenced by ActOnCondition().

◆ PrepareBuiltinElementwiseMathOneArgCall()

◆ prepareMatrixSplat()

ExprResult Sema::prepareMatrixSplat ( QualType MatrixTy,
Expr * SplattedExpr )

◆ PrepareScalarCast()

◆ prepareVectorSplat()

◆ PrintContextStack() [1/2]

void clang::Sema::PrintContextStack ( )
inline

Definition at line 13684 of file Sema.h.

References getDefaultDiagFunc(), and PrintContextStack().

Referenced by EmitDiagnostic(), and PrintContextStack().

◆ PrintContextStack() [2/2]

◆ PrintInstantiationStack() [1/2]

void clang::Sema::PrintInstantiationStack ( )
inline

Definition at line 13688 of file Sema.h.

References getDefaultDiagFunc(), and PrintInstantiationStack().

Referenced by PrintContextStack(), and PrintInstantiationStack().

◆ PrintInstantiationStack() [2/2]

void Sema::PrintInstantiationStack ( InstantiationContextDiagFuncRef DiagFunc)

Prints the current instantiation stack through a series of notes.

Definition at line 901 of file SemaTemplateInstantiate.cpp.

References clang::Sema::DefaultedFunctionKind::asComparison(), clang::Sema::DefaultedFunctionKind::asSpecialMember(), clang::Sema::CodeSynthesisContext::BuildingBuiltinDumpStructCall, clang::Sema::CodeSynthesisContext::BuildingDeductionGuides, clang::cast(), CodeSynthesisContexts, clang::Sema::CodeSynthesisContext::ConstraintNormalization, clang::Sema::CodeSynthesisContext::ConstraintsCheck, clang::Sema::CodeSynthesisContext::ConstraintSubstitution, Context, convertCallArgsToString(), clang::CPlusPlus11, clang::Sema::CodeSynthesisContext::DeclaringImplicitEqualityComparison, clang::Sema::CodeSynthesisContext::DeclaringSpecialMember, clang::Sema::CodeSynthesisContext::DeducedTemplateArgumentSubstitution, clang::Sema::CodeSynthesisContext::DefaultFunctionArgumentInstantiation, clang::Sema::CodeSynthesisContext::DefaultTemplateArgumentChecking, clang::Sema::CodeSynthesisContext::DefaultTemplateArgumentInstantiation, clang::Sema::CodeSynthesisContext::DefiningSynthesizedFunction, Diags, clang::Sema::CodeSynthesisContext::ExceptionSpecEvaluation, clang::Sema::CodeSynthesisContext::ExceptionSpecInstantiation, clang::Sema::CodeSynthesisContext::ExplicitTemplateArgumentSubstitution, clang::Function, getDefaultedFunctionKind(), getLangOpts(), clang::NamedDecl::getName(), getPrintingPolicy(), getTemplateArgumentBindingsText(), clang::TemplateDecl::getTemplateParameters(), clang::Sema::CodeSynthesisContext::InitializingStructuredBinding, clang::isa(), clang::Sema::DefaultedFunctionKind::isComparison(), clang::Sema::DefaultedFunctionKind::isSpecialMember(), clang::SourceLocation::isValid(), clang::Sema::CodeSynthesisContext::LambdaExpressionSubstitution, clang::Sema::CodeSynthesisContext::MarkingClassDllexported, clang::Sema::CodeSynthesisContext::Memoization, clang::Sema::CodeSynthesisContext::NestedRequirementConstraintsCheck, OS, clang::Sema::CodeSynthesisContext::ParameterMappingSubstitution, clang::Sema::CodeSynthesisContext::PartialOrderingTTP, clang::SemaBase::PDiag(), clang::NamedDecl::printName(), clang::Sema::CodeSynthesisContext::PriorTemplateArgumentSubstitution, clang::Sema::CodeSynthesisContext::RequirementInstantiation, clang::Sema::CodeSynthesisContext::RequirementParameterInstantiation, clang::Sema::CodeSynthesisContext::RewritingOperatorAsSpaceship, clang::Template, clang::Sema::CodeSynthesisContext::TemplateInstantiation, and clang::Sema::CodeSynthesisContext::TypeAliasTemplateInstantiation.

◆ PrintPragmaAttributeInstantiationPoint() [1/2]

void clang::Sema::PrintPragmaAttributeInstantiationPoint ( )
inline

◆ PrintPragmaAttributeInstantiationPoint() [2/2]

void Sema::PrintPragmaAttributeInstantiationPoint ( InstantiationContextDiagFuncRef DiagFunc)

Definition at line 1228 of file SemaAttr.cpp.

References clang::SemaBase::PDiag(), and PragmaAttributeCurrentTargetDecl.

◆ PrintStats()

void Sema::PrintStats ( ) const

Print out statistics about the semantic analysis.

Definition at line 670 of file Sema.cpp.

References AnalysisWarnings, BumpAlloc, getSFINAEContext(), and int.

Referenced by clang::ParseAST().

◆ ProcessAccessDeclAttributeList()

bool Sema::ProcessAccessDeclAttributeList ( AccessSpecDecl * ASDecl,
const ParsedAttributesView & AttrList )

Annotation attributes are the only attributes allowed after an access specifier.

Definition at line 8271 of file SemaDeclAttr.cpp.

References clang::SemaBase::Diag(), and ProcessDeclAttribute().

Referenced by ActOnAccessSpecifier().

◆ ProcessAPINotes()

◆ ProcessDeclAttributeDelayed()

void Sema::ProcessDeclAttributeDelayed ( Decl * D,
const ParsedAttributesView & AttrList )

Helper for delayed processing TransparentUnion or BPFPreserveAccessIndexAttr attribute.

Definition at line 8257 of file SemaDeclAttr.cpp.

References BPF(), clang::cast(), clang::SemaBPF::handlePreserveAIRecord(), handleTransparentUnionAttr(), and clang::Decl::hasAttr().

◆ ProcessDeclAttributeList()

◆ ProcessDeclAttributes()

◆ ProcessPragmaExport()

◆ ProcessPragmaWeak()

◆ ProcessStmtAttributes()

void Sema::ProcessStmtAttributes ( Stmt * Stmt,
const ParsedAttributes & InAttrs,
SmallVectorImpl< const Attr * > & OutAttrs )

Process the attributes before creating an attributed statement.

Returns the semantic attributes that have been processed.

Definition at line 741 of file SemaStmtAttr.cpp.

References CheckForDuplicateLoopAttrs(), CheckForIncompatibleAttributes(), ProcessStmtAttribute(), and clang::ParsedAttributesView::Range.

Referenced by ActOnAttributedStmt().

◆ propagateDLLAttrToBaseClassTemplate()

◆ PseudoObject()

SemaPseudoObject & clang::Sema::PseudoObject ( )
inline

Definition at line 1518 of file Sema.h.

Referenced by BuildBinOp(), BuildUnaryOp(), and CheckPlaceholderExpr().

◆ PushBlockScope()

void Sema::PushBlockScope ( Scope * BlockScope,
BlockDecl * Block )

◆ PushCapturedRegionScope()

void Sema::PushCapturedRegionScope ( Scope * RegionScope,
CapturedDecl * CD,
RecordDecl * RD,
CapturedRegionKind K,
unsigned OpenMPCaptureLevel = 0 )

◆ pushCodeSynthesisContext()

◆ PushCompoundScope()

void Sema::PushCompoundScope ( bool IsStmtExpr)

Definition at line 2483 of file Sema.cpp.

References getCurFPFeatures(), and getCurFunction().

Referenced by ActOnStartOfCompoundStmt(), and ActOnStartTopLevelStmtDecl().

◆ PushDeclContext()

◆ PushExpressionEvaluationContext() [1/2]

◆ PushExpressionEvaluationContext() [2/2]

◆ PushExpressionEvaluationContextForFunction()

◆ PushFunctionScope()

void Sema::PushFunctionScope ( )

◆ PushLambdaScope()

LambdaScopeInfo * Sema::PushLambdaScope ( )

◆ PushNamespaceVisibilityAttr()

void Sema::PushNamespaceVisibilityAttr ( const VisibilityAttr * Attr,
SourceLocation Loc )

PushNamespaceVisibilityAttr - Note that we've entered a namespace with a visibility attribute.

Definition at line 1540 of file SemaAttr.cpp.

References NoVisibility, and PushPragmaVisibility().

Referenced by ActOnStartNamespaceDef().

◆ PushOnScopeChains()

void Sema::PushOnScopeChains ( NamedDecl * D,
Scope * S,
bool AddToContext = true )

Add this decl to the scope shadowed decl chains.

Definition at line 1559 of file SemaDecl.cpp.

References clang::Scope::AddDecl(), clang::cast(), clang::CPlusPlus, CurContext, clang::NamedDecl::declarationReplaces(), clang::DeclContext::Encloses(), clang::NamedDecl::getDeclName(), clang::Scope::getEntity(), clang::Scope::getFnParent(), getLangOpts(), clang::Scope::getParent(), clang::DeclContext::getRedeclContext(), IdResolver, clang::isa(), clang::Scope::isDeclScope(), clang::DeclarationName::isEmpty(), clang::Decl::isOutOfLine(), clang::DeclContext::isTransparentContext(), clang::Scope::RemoveDecl(), and warnOnReservedIdentifier().

Referenced by ActOnAliasDeclaration(), ActOnBlockArguments(), ActOnDecompositionDeclarator(), ActOnEnumConstant(), ActOnExceptionDeclarator(), ActOnFinishConceptDefinition(), ActOnFriendFunctionDecl(), ActOnLambdaClosureParameters(), ActOnLambdaExpressionAfterIntroducer(), ActOnNamespaceAliasDef(), ActOnStartConceptDefinition(), ActOnStartCXXMemberDeclarations(), ActOnStartNamespaceDef(), ActOnStartOfFunctionDef(), ActOnStartOfLambdaDefinition(), ActOnStartRequiresExpr(), ActOnStartTrailingRequiresClause(), ActOnTag(), ActOnUsingDeclaration(), ActOnUsingEnumDeclaration(), addImplicitTypedef(), buildImplicitMapper(), BuildUsingShadowDecl(), CheckClassTemplate(), DeclApplyPragmaWeak(), DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), HandleDeclarator(), HandleField(), HandleMSProperty(), ImplicitlyDefineFunction(), Initialize(), InjectAnonymousStructOrUnionMembers(), LazilyCreateBuiltin(), and LookupOrCreateLabel().

◆ PushParsingClass()

ParsingClassState clang::Sema::PushParsingClass ( )
inline

Definition at line 6572 of file Sema.h.

References clang::Sema::DelayedDiagnostics::pushUndelayed().

◆ PushParsingDeclaration()

ParsingDeclState clang::Sema::PushParsingDeclaration ( sema::DelayedDiagnosticPool & pool)
inline

Definition at line 1411 of file Sema.h.

References clang::Sema::DelayedDiagnostics::push().

◆ PushSatisfactionStackEntry()

void clang::Sema::PushSatisfactionStackEntry ( const NamedDecl * D,
const llvm::FoldingSetNodeID & ID )
inline

Definition at line 14838 of file Sema.h.

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

◆ PushUsingDirective()

◆ RebuildExprInCurrentInstantiation()

ExprResult Sema::RebuildExprInCurrentInstantiation ( Expr * E)

Definition at line 11496 of file SemaTemplate.cpp.

References clang::Expr::getExprLoc().

Referenced by RebuildDeclaratorInCurrentInstantiation().

◆ RebuildLambdaScopeInfo()

LambdaScopeInfo * Sema::RebuildLambdaScopeInfo ( CXXMethodDecl * CallOperator)

◆ RebuildNestedNameSpecifierInCurrentInstantiation()

◆ RebuildTemplateParamsInCurrentInstantiation()

◆ RebuildTypeInCurrentInstantiation()

TypeSourceInfo * Sema::RebuildTypeInCurrentInstantiation ( TypeSourceInfo * T,
SourceLocation Loc,
DeclarationName Name )

Rebuilds a type within the context of the current instantiation.

The type T is part of the type of an out-of-line member definition of a class template (or class template partial specialization) that was parsed and constructed before we entered the scope of the class template (or partial specialization thereof). This routine will rebuild that type now that we have entered the declarator's scope, which may produce different canonical types, e.g.,

template<typename T>
struct X {
typedef T* pointer;
pointer data();
};
template<typename T>
typename X<T>::pointer X<T>::data() { ... }

Here, the type "typename X<T>::pointer" will be created as a DependentNameType, since we do not know that we can look into X<T> when we parsed the type. This function will rebuild the type, performing the lookup of "pointer" in X<T> and returning an ElaboratedType whose canonical type is the same as the canonical type of T*, allowing the return types of the out-of-line definition and the declaration to match.

Definition at line 11486 of file SemaTemplate.cpp.

References clang::T.

Referenced by RebuildDeclaratorInCurrentInstantiation(), and RebuildTemplateParamsInCurrentInstantiation().

◆ RecordParsingTemplateParameterDepth()

void Sema::RecordParsingTemplateParameterDepth ( unsigned Depth)

This is used to inform Sema what the current TemplateParameterDepth is during Parsing.

Currently it is used to pass on the depth when parsing generic lambda 'auto' parameters.

Definition at line 2362 of file Sema.cpp.

References getCurLambda().

◆ redelayDiagnostics()

void Sema::redelayDiagnostics ( sema::DelayedDiagnosticPool & pool)

Given a set of delayed diagnostics, re-emit them as if they had been delayed in the current context instead of in the given pool.

Essentially, this just moves them to the current pool.

Definition at line 8623 of file SemaDeclAttr.cpp.

References clang::Sema::DelayedDiagnostics::getCurrentPool(), and clang::sema::DelayedDiagnosticPool::steal().

◆ referenceDLLExportedClassMethods()

void Sema::referenceDLLExportedClassMethods ( )

◆ RefersToMemberWithReducedAlignment()

void Sema::RefersToMemberWithReducedAlignment ( Expr * E,
llvm::function_ref< void(Expr *, RecordDecl *, FieldDecl *, CharUnits)> Action )

◆ RegisterLocallyScopedExternCDecl()

void Sema::RegisterLocallyScopedExternCDecl ( NamedDecl * ND,
Scope * S )

Register the given locally-scoped extern "C" declaration so that it can be found later for redeclarations.

We include any extern "C" declaration that is not visible in the translation unit here, not just function-scope declarations.

Definition at line 6819 of file SemaDecl.cpp.

References Context, clang::CPlusPlus, getLangOpts(), clang::Decl::getLexicalDeclContext(), clang::DeclContext::getRedeclContext(), and clang::DeclContext::isTranslationUnit().

Referenced by ActOnFunctionDeclarator(), ActOnVariableDeclarator(), and LazilyCreateBuiltin().

◆ RegisterTypeTagForDatatype()

void Sema::RegisterTypeTagForDatatype ( const IdentifierInfo * ArgumentKind,
uint64_t MagicValue,
QualType Type,
bool LayoutCompatible,
bool MustBeNull )

Register a magic integral constant to be used as a type tag.

Definition at line 16109 of file SemaChecking.cpp.

Referenced by FinalizeDeclaration().

◆ ReplaceAutoType()

QualType Sema::ReplaceAutoType ( QualType TypeWithAuto,
QualType Replacement )

Completely replace the auto in TypeWithAuto by Replacement.

This does not retain any auto type sugar.

Definition at line 5409 of file SemaTemplateDeduction.cpp.

◆ ReplaceAutoTypeSourceInfo()

TypeSourceInfo * Sema::ReplaceAutoTypeSourceInfo ( TypeSourceInfo * TypeWithAuto,
QualType Replacement )

Definition at line 5416 of file SemaTemplateDeduction.cpp.

Referenced by InventTemplateParameter().

◆ RequireCompleteDeclContext()

bool Sema::RequireCompleteDeclContext ( CXXScopeSpec & SS,
DeclContext * DC )

Require that the context specified by SS be complete.

If SS refers to a type, this routine checks whether the type is complete enough (or can be made complete enough) for name lookup into the DeclContext. A type that is not yet completed can be considered "complete enough" if it is a class/struct/union/enum that is currently being defined. Or, if we have a type that names a class template specialization that is not a complete type, we will attempt to instantiate that class template.

Definition at line 178 of file SemaCXXScopeSpec.cpp.

References Context, clang::SourceRange::getBegin(), clang::TagDecl::getDefinitionOrSelf(), clang::CXXScopeSpec::getLastQualifierNameLoc(), clang::CXXScopeSpec::getRange(), clang::TagDecl::isBeingDefined(), clang::DeclContext::isDependentContext(), clang::SourceLocation::isInvalid(), RequireCompleteEnumDecl(), RequireCompleteType(), and clang::CXXScopeSpec::SetInvalid().

Referenced by ActOnCXXEnterDeclaratorScope(), ActOnFriendFunctionDecl(), ActOnTag(), BuildCXXNestedNameSpecifier(), BuildUsingDeclaration(), CheckClassTemplate(), CheckTypenameType(), CheckUsingDeclQualifier(), getConstructorName(), getDestructorName(), getTypeName(), HandleDeclarator(), LookupParsedName(), and LookupTemplateName().

◆ RequireCompleteEnumDecl()

◆ RequireCompleteExprType() [1/3]

bool Sema::RequireCompleteExprType ( Expr * E,
CompleteTypeKind Kind,
TypeDiagnoser & Diagnoser )

Ensure that the type of the given expression is complete.

This routine checks whether the expression E has a complete type. If the expression refers to an instantiable construct, that instantiation is performed as needed to complete its type. Furthermore Sema::RequireCompleteType is called for the expression's type (or in the case of a reference type, the referred-to type).

Parameters
EThe expression whose type is required to be complete.
KindSelects which completeness rules should be applied.
DiagnoserThe object that will emit a diagnostic if the type is incomplete.
Returns
true if the type of E is incomplete and diagnosed, false otherwise.

Definition at line 9239 of file SemaType.cpp.

References getCompletedType(), clang::Expr::getExprLoc(), and RequireCompleteType().

Referenced by CheckConditionalOperand(), LookupInlineAsmIdentifier(), RequireCompleteExprType(), RequireCompleteExprType(), and RequireCompleteSizedExprType().

◆ RequireCompleteExprType() [2/3]

bool Sema::RequireCompleteExprType ( Expr * E,
unsigned DiagID )

Definition at line 9245 of file SemaType.cpp.

References Default, and RequireCompleteExprType().

◆ RequireCompleteExprType() [3/3]

template<typename... Ts>
bool clang::Sema::RequireCompleteExprType ( Expr * E,
unsigned DiagID,
const Ts &... Args )
inline

Definition at line 15375 of file Sema.h.

References Default, and RequireCompleteExprType().

◆ RequireCompleteSizedExprType()

template<typename... Ts>
bool clang::Sema::RequireCompleteSizedExprType ( Expr * E,
unsigned DiagID,
const Ts &... Args )
inline

Definition at line 8273 of file Sema.h.

References Normal, and RequireCompleteExprType().

Referenced by CheckUnaryExprOrTypeTraitOperand().

◆ RequireCompleteSizedType()

◆ RequireCompleteType() [1/5]

bool Sema::RequireCompleteType ( SourceLocation Loc,
QualType T,
CompleteTypeKind Kind,
TypeDiagnoser & Diagnoser )

Ensure that the type T is a complete type.

This routine checks whether the type T is complete in any context where a complete type is required. If T is a complete type, returns false. If T is a class template specialization, this routine then attempts to perform class template instantiation. If instantiation fails, or if T is incomplete and cannot be completed, issues the diagnostic diag (giving it the type T) and returns true.

Parameters
LocThe location in the source that the incomplete type diagnostic should refer to.
TThe type that this routine is examining for completeness.
KindSelects which completeness rules should be applied.
Returns
true if T is incomplete and a diagnostic was emitted, false otherwise.

Definition at line 9250 of file SemaType.cpp.

References Consumer, and clang::T.

Referenced by ActOnCXXDelete(), ActOnEndOfTranslationUnit(), ActOnFields(), ActOnGCCAsmStmt(), ActOnInitializerError(), actOnOMPReductionKindClause(), ActOnStartCXXMemberReference(), ActOnStartOfFunctionDef(), ActOnUninitializedDecl(), AddInitializerToDecl(), BuildAtomicExpr(), BuildAtomicType(), BuildBuiltinOffsetOf(), BuildCallToObjectOfClassType(), BuildCompoundLiteralExpr(), BuildCXXForRangeStmt(), BuildCXXTypeConstructExpr(), BuildCXXTypeId(), BuildCXXTypeId(), BuildExceptionDeclaration(), buildLambdaScopeReturnType(), BuildOverloadedArrowExpr(), BuildResolvedCallExpr(), BuildVAArgExpr(), BuiltinDumpStruct(), BuiltinIsBaseOf(), BuiltinLaunder(), BuiltinTriviallyRelocate(), CheckAddressOfOperand(), CheckBaseSpecifier(), CheckCallReturnType(), CheckCommaOperands(), CheckComparisonCategoryType(), CheckCompleteParameterTypesForMangler(), CheckCXXThrowOperand(), CheckDeleteOperator(), CheckExplicitlyDefaultedComparison(), CheckFieldDecl(), CheckForModifiableLvalue(), checkHLSLSpirvTypeOperand(), checkIncorrectVTablePointerAuthenticationAttribute(), checkMemberDecomposition(), CheckOverridingFunctionReturnType(), CheckParmsForFunctionDef(), CheckPointerToMemberOperands(), CheckSpecifiedExceptionType(), checkTypeMappable(), CheckUnaryTypeTraitTypeCompleteness(), checkUnknownAnyCast(), ComputeDefaultedSpecialMemberExceptionSpec(), ConvertParamDefaultArgument(), CopyObject(), DefaultVariadicArgumentPromotion(), clang::InitializationSequence::Diagnose(), DiagnoseMultipleUserDefinedConversion(), EvaluateBooleanTypeTrait(), FindAllocationFunctions(), FindInstantiatedDecl(), GatherArgumentsForCall(), GetDecompositionElementCount(), getStdTrait(), GetVTablePointer(), handlePreferredTypeAttr(), IgnoredValueConversions(), lookupCoroutineHandleType(), LookupInlineAsmField(), LookupMemberExpr(), LookupMemberExprInRecord(), lookupPromiseType(), PerformContextualImplicitConversion(), RequireCompleteDeclContext(), RequireCompleteExprType(), RequireCompleteSizedType(), RequireCompleteType(), RequireCompleteType(), RequireCompleteType(), RequireCompleteType(), RequireLiteralType(), RequireStructuralType(), and TemporaryMaterializationConversion().

◆ RequireCompleteType() [2/5]

bool Sema::RequireCompleteType ( SourceLocation Loc,
QualType T,
CompleteTypeKind Kind,
unsigned DiagID )

Definition at line 9592 of file SemaType.cpp.

References RequireCompleteType(), and clang::T.

◆ RequireCompleteType() [3/5]

bool clang::Sema::RequireCompleteType ( SourceLocation Loc,
QualType T,
TypeDiagnoser & Diagnoser )
inline

Definition at line 15479 of file Sema.h.

References Default, RequireCompleteType(), and clang::T.

◆ RequireCompleteType() [4/5]

bool clang::Sema::RequireCompleteType ( SourceLocation Loc,
QualType T,
unsigned DiagID )
inline

Definition at line 15483 of file Sema.h.

References Default, RequireCompleteType(), and clang::T.

◆ RequireCompleteType() [5/5]

template<typename... Ts>
bool clang::Sema::RequireCompleteType ( SourceLocation Loc,
QualType T,
unsigned DiagID,
const Ts &... Args )
inline

Definition at line 15488 of file Sema.h.

References RequireCompleteType(), and clang::T.

◆ RequireLiteralType() [1/3]

bool Sema::RequireLiteralType ( SourceLocation Loc,
QualType T,
TypeDiagnoser & Diagnoser )

Ensure that the type T is a literal type.

This routine checks whether the type T is a literal type. If T is an incomplete type, an attempt is made to complete it. If T is a literal type, or AllowIncompleteType is true and T is an incomplete type, returns false. Otherwise, this routine issues the diagnostic PD (giving it the type T), along with notes explaining why the type is not a literal type, and returns true.

Parameters
LocThe location in the source that the non-literal type diagnostic should refer to.
TThe type that this routine is examining for literalness.
DiagnoserEmits a diagnostic if T is not a literal type.
Returns
true if T is not a literal type and a diagnostic was emitted, false otherwise.

Definition at line 9615 of file SemaType.cpp.

References clang::Type::castAsCXXRecordDecl(), Context, clang::CPlusPlus17, clang::CPlusPlus20, clang::Destructor, clang::SemaBase::Diag(), clang::Sema::TypeDiagnoser::diagnose(), getLangOpts(), getLiteralDiagFromTagKind(), clang::Decl::getLocation(), clang::IgnoreTrivialABI, isCompleteType(), clang::Type::isRecordType(), clang::FunctionDecl::isUserProvided(), clang::Type::isVoidType(), RequireCompleteType(), SpecialMemberIsTrivial(), and clang::T.

Referenced by CheckLiteralType(), CheckVariableDeclarationType(), RequireLiteralType(), RequireLiteralType(), and RequireStructuralType().

◆ RequireLiteralType() [2/3]

bool Sema::RequireLiteralType ( SourceLocation Loc,
QualType T,
unsigned DiagID )

Definition at line 9704 of file SemaType.cpp.

References RequireLiteralType(), and clang::T.

◆ RequireLiteralType() [3/3]

template<typename... Ts>
bool clang::Sema::RequireLiteralType ( SourceLocation Loc,
QualType T,
unsigned DiagID,
const Ts &... Args )
inline

Definition at line 15444 of file Sema.h.

References RequireLiteralType(), and clang::T.

◆ RequireNonAbstractType() [1/2]

◆ RequireNonAbstractType() [2/2]

template<typename... Ts>
bool clang::Sema::RequireNonAbstractType ( SourceLocation Loc,
QualType T,
unsigned DiagID,
const Ts &... Args )
inline

Definition at line 6264 of file Sema.h.

References RequireNonAbstractType(), and clang::T.

◆ RequireStructuralType()

bool Sema::RequireStructuralType ( QualType T,
SourceLocation Loc )

Require the given type to be a structural type, and diagnose if it is not.

Returns
true if an error was produced.

Definition at line 1351 of file SemaTemplate.cpp.

References clang::AS_public, Context, clang::CPlusPlus20, clang::SemaBase::Diag(), getLangOpts(), RequireCompleteType(), RequireLiteralType(), and clang::T.

Referenced by CheckNonTypeTemplateParameterType().

◆ resetFPOptions()

void clang::Sema::resetFPOptions ( FPOptions FPO)
inline

Definition at line 11369 of file Sema.h.

References CurFPFeatures, FpPragmaStack, clang::FPOptions::getChangesFrom(), and LangOpts.

◆ ResolveAddressOfOverloadedFunction()

FunctionDecl * Sema::ResolveAddressOfOverloadedFunction ( Expr * AddressOfExpr,
QualType TargetType,
bool Complain,
DeclAccessPair & Found,
bool * pHadMultipleCandidates = nullptr )

ResolveAddressOfOverloadedFunction - Try to resolve the address of an overloaded function (C++ [over.over]), where From is an expression with overloaded function type and ToType is the type we're trying to resolve to.

For example:

int f(double);
int f(int);
int (*pfd)(double) = f; // selects f(double)
__device__ double

This routine returns the resulting FunctionDecl if it could be resolved, and NULL otherwise. When Complain is true, this routine will emit diagnostics if there is an error.

Definition at line 13953 of file SemaOverload.cpp.

References CheckAddressOfMemberAccess(), Context, clang::Expr::getExprLoc(), clang::Expr::getType(), and ResolveExceptionSpec().

Referenced by CheckSingleAssignmentConstraints(), CheckTemplateArgument(), clang::InitializationSequence::Diagnose(), clang::InitializationSequence::InitializeFrom(), IsStandardConversion(), PerformImplicitConversion(), ResolveOverloadedFunctionForReferenceBinding(), TryListConversion(), and TryReferenceInit().

◆ resolveAddressOfSingleOverloadCandidate()

FunctionDecl * Sema::resolveAddressOfSingleOverloadCandidate ( Expr * E,
DeclAccessPair & FoundResult )

Given an expression that refers to an overloaded function, try to resolve that function to a single function that can have its address taken.

This will modify Pair iff it returns non-null.

This routine can only succeed if from all of the candidates in the overload set for SrcExpr that can have their addresses taken, there is one candidate that is more constrained than the rest.

Definition at line 13993 of file SemaOverload.cpp.

References checkAddressOfFunctionIsAvailable(), clang::CUDA, CUDA(), clang::OverloadExpr::decls_begin(), clang::OverloadExpr::decls_end(), clang::OverloadExpr::FindResult::Expression, clang::OverloadExpr::find(), getCurFunctionDecl(), getLangOpts(), getMoreConstrainedFunction(), getMorePartialOrderingConstrained(), and clang::Result.

Referenced by resolveAndFixAddressOfSingleOverloadCandidate(), and ResolveOverloadForDeduction().

◆ resolveAndFixAddressOfSingleOverloadCandidate()

bool Sema::resolveAndFixAddressOfSingleOverloadCandidate ( ExprResult & SrcExpr,
bool DoFunctionPointerConversion = false )

Given an overloaded function, tries to turn it into a non-overloaded function reference using resolveAddressOfSingleOverloadCandidate.

This will perform access checks, diagnose the use of the resultant decl, and, if requested, potentially perform a function-to-pointer decay.

Returns false if resolveAddressOfSingleOverloadCandidate fails. Otherwise, returns true. This may emit diagnostics and return true.

Definition at line 14085 of file SemaOverload.cpp.

References CheckAddressOfMemberAccess(), Context, DefaultFunctionArrayConversion(), DiagnoseUseOfDecl(), FixOverloadedFunctionReference(), clang::Found, clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getExprLoc(), clang::Expr::getType(), clang::Type::isFunctionType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), and resolveAddressOfSingleOverloadCandidate().

Referenced by CheckPlaceholderExpr().

◆ ResolveAndFixSingleFunctionTemplateSpecialization()

◆ ResolveExceptionSpec()

◆ ResolveSingleFunctionTemplateSpecialization()

FunctionDecl * Sema::ResolveSingleFunctionTemplateSpecialization ( OverloadExpr * ovl,
bool Complain = false,
DeclAccessPair * Found = nullptr,
TemplateSpecCandidateSet * FailedTSC = nullptr,
bool ForTypeDeduction = false )

Given an expression that refers to an overloaded function, try to resolve that overloaded function expression down to a single function.

This routine can only resolve template-ids that refer to a single function template, where that template-id refers to a single template whose template arguments are either provided by the template-id or have defaults, as described in C++0x [temp.arg.explicit]p3.

If no template-ids are found, no diagnostics are emitted and NULL is returned.

Definition at line 14112 of file SemaOverload.cpp.

References clang::TemplateSpecCandidateSet::addCandidate(), completeFunctionType(), Context, clang::OverloadExpr::copyTemplateArgumentsInto(), clang::OverloadExpr::decls_begin(), clang::OverloadExpr::decls_end(), DeduceTemplateArguments(), Diag(), FunctionTemplate, clang::Expr::getExprLoc(), clang::OverloadExpr::getName(), clang::OverloadExpr::getNameLoc(), clang::ValueDecl::getType(), clang::OverloadExpr::hasExplicitTemplateArgs(), isSameOrCompatibleFunctionType(), clang::MakeDeductionFailureInfo(), NoteAllOverloadCandidates(), clang::Result, clang::TemplateSpecCandidate::set(), clang::Specialization, and clang::Success.

Referenced by CheckAddressOfOperand(), handleCleanupAttr(), handleRestrictAttr(), ResolveAndFixSingleFunctionTemplateSpecialization(), and ResolveOverloadForDeduction().

◆ RestoreNestedNameSpecifierAnnotation()

void Sema::RestoreNestedNameSpecifierAnnotation ( void * Annotation,
SourceRange AnnotationRange,
CXXScopeSpec & SS )

Given an annotation pointer for a nested-name-specifier, restore the nested-name-specifier structure.

Parameters
AnnotationThe annotation pointer, produced by SaveNestedNameSpecifierAnnotation().
AnnotationRangeThe source range corresponding to the annotation.
SSThe nested-name-specifier that will be updated with the contents of the annotation pointer.

Definition at line 958 of file SemaCXXScopeSpec.cpp.

References clang::CXXScopeSpec::Adopt(), and clang::CXXScopeSpec::SetInvalid().

◆ RISCV()

◆ runWithSufficientStackSpace()

void Sema::runWithSufficientStackSpace ( SourceLocation Loc,
llvm::function_ref< void()> Fn )

◆ SatisfactionStackContains()

bool clang::Sema::SatisfactionStackContains ( const NamedDecl * D,
const llvm::FoldingSetNodeID & ID ) const
inline

Definition at line 14846 of file Sema.h.

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

Referenced by DiagRecursiveConstraintEval().

◆ SaveNestedNameSpecifierAnnotation()

void * Sema::SaveNestedNameSpecifierAnnotation ( CXXScopeSpec & SS)

Given a C++ nested-name-specifier, produce an annotation value that the parser can use later to reconstruct the given nested-name-specifier.

Parameters
SSA nested-name-specifier.
Returns
A pointer containing all of the information in the nested-name-specifier SS.

Definition at line 944 of file SemaCXXScopeSpec.cpp.

References Context, clang::CXXScopeSpec::getScopeRep(), clang::CXXScopeSpec::isEmpty(), clang::CXXScopeSpec::isInvalid(), clang::CXXScopeSpec::location_data(), clang::CXXScopeSpec::location_size(), and memcpy().

◆ ScalarTypeToBooleanCastKind()

CastKind Sema::ScalarTypeToBooleanCastKind ( QualType ScalarTy)
static

◆ SelectBestMethod()

◆ SetCtorInitializers()

◆ SetDeclDefaulted()

◆ SetDeclDeleted()

◆ SetDelegatingInitializer()

bool Sema::SetDelegatingInitializer ( CXXConstructorDecl * Constructor,
CXXCtorInitializer * Initializer )

◆ setExceptionMode()

void Sema::setExceptionMode ( SourceLocation Loc,
LangOptions::FPExceptionModeKind FPE )

Called to set exception behavior for floating point operations.

Definition at line 1503 of file SemaAttr.cpp.

References clang::FPOptionsOverride::applyOverrides(), CurFPFeatureOverrides(), CurFPFeatures, FpPragmaStack, getLangOpts(), and PSK_Set.

Referenced by ActOnPragmaFPExceptions().

◆ SetFunctionBodyKind()

void Sema::SetFunctionBodyKind ( Decl * D,
SourceLocation Loc,
FnBodyKind BodyKind,
StringLiteral * DeletedMessage = nullptr )

Definition at line 18663 of file SemaDeclCXX.cpp.

References Default, Delete, Other, SetDeclDefaulted(), and SetDeclDeleted().

◆ setFunctionHasBranchIntoScope()

void Sema::setFunctionHasBranchIntoScope ( )

Definition at line 2499 of file Sema.cpp.

References FunctionScopes.

Referenced by ActOnGCCAsmStmt(), ActOnGotoStmt(), and ActOnStartOfSwitchStmt().

◆ setFunctionHasBranchProtectedScope()

◆ setFunctionHasIndirectGoto()

void Sema::setFunctionHasIndirectGoto ( )

Definition at line 2509 of file Sema.cpp.

References FunctionScopes.

Referenced by ActOnIndirectGotoStmt().

◆ setFunctionHasMustTail()

void Sema::setFunctionHasMustTail ( )

Definition at line 2514 of file Sema.cpp.

References FunctionScopes.

Referenced by BuildAttributedStmt().

◆ SetLateTemplateParser()

void clang::Sema::SetLateTemplateParser ( LateTemplateParserCB * LTP,
void * P )
inline

Definition at line 1334 of file Sema.h.

References LateTemplateParser, and OpaqueParser.

◆ SetMemberAccessSpecifier()

bool Sema::SetMemberAccessSpecifier ( NamedDecl * MemberDecl,
NamedDecl * PrevMemberDecl,
AccessSpecifier LexicalAS )

SetMemberAccessSpecifier - Set the access specifier of a member.

Returns true on error (when the previous member decl access specifier is different from the new member decl access specifier).

Definition at line 35 of file SemaAccess.cpp.

References clang::AS_none, clang::SemaBase::Diag(), clang::Decl::getAccess(), clang::Decl::getLocation(), and clang::Decl::setAccess().

Referenced by ActOnTag(), and CheckClassTemplate().

◆ SetParamDefaultArgument()

void Sema::SetParamDefaultArgument ( ParmVarDecl * Param,
Expr * DefaultArg,
SourceLocation EqualLoc )

Definition at line 309 of file SemaDeclCXX.cpp.

References UnparsedDefaultArgInstantiations.

Referenced by ActOnParamDefaultArgument().

◆ setTagNameForLinkagePurposes()

◆ ShouldDeleteSpecialMember()

bool Sema::ShouldDeleteSpecialMember ( CXXMethodDecl * MD,
CXXSpecialMemberKind CSM,
InheritedConstructorInfo * ICI = nullptr,
bool Diagnose = false )

Determine if a special member function should have a deleted definition when it is defaulted.

Determine whether a defaulted special member function should be defined as deleted, as specified in C++11 [class.ctor]p5, C++11 [class.copy]p11, C++11 [class.copy]p23, and C++11 [class.dtor]p5.

Definition at line 9874 of file SemaDeclCXX.cpp.

References Context, clang::CopyAssignment, clang::CopyConstructor, clang::CXXRecordDecl::ctors(), clang::CUDA, CUDA(), clang::DefaultConstructor, clang::Destructor, Diag(), Diagnose, FindDeallocationFunction(), getLangOpts(), clang::Decl::getLocation(), clang::CXXMethodDecl::getParent(), getSpecialMember(), clang::CXXRecordDecl::hasUserDeclaredMoveAssignment(), clang::CXXRecordDecl::hasUserDeclaredMoveConstructor(), clang::TagDecl::isDependentType(), clang::Decl::isImplicit(), clang::Decl::isInvalidDecl(), clang::CXXRecordDecl::isLambda(), clang::CXXMethodDecl::isMoveAssignmentOperator(), clang::CXXMethodDecl::isVirtual(), clang::CXXRecordDecl::lambdaIsDefaultConstructibleAndAssignable(), LangOpts, clang::CXXRecordDecl::methods(), clang::LangOptionsBase::MSVC2015, clang::No, and ShouldUseTypeAwareOperatorNewOrDelete().

Referenced by ActOnFields(), CheckExplicitlyDefaultedSpecialMember(), DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), DiagnoseDeletedDefaultedFunction(), findInheritingConstructor(), and NoteDeletedInheritingConstructor().

◆ ShouldDiagnoseAvailabilityOfDecl()

std::pair< AvailabilityResult, const NamedDecl * > Sema::ShouldDiagnoseAvailabilityOfDecl ( const NamedDecl * D,
std::string * Message,
ObjCInterfaceDecl * ClassReceiver )

The diagnostic we should emit for D, and the declaration that originated it, or AR_Available.

Parameters
DThe declaration to check.
MessageIf non-null, this will be populated with the message from the availability attribute that is selected.
ClassReceiverIf we're checking the method of a class message send, the class. Otherwise nullptr.

Definition at line 94 of file SemaAvailability.cpp.

References clang::AR_Available, getASTContext(), clang::Decl::getAvailability(), clang::Init, clang::isa(), clang::ObjCInterfaceDecl::lookupInstanceMethod(), ObjC(), clang::Result, and clang::T.

Referenced by DiagnoseAvailabilityOfDecl(), and InstantiateClassTemplateSpecialization().

◆ ShouldEnterDeclaratorScope()

◆ shouldIgnoreInHostDeviceCheck()

bool Sema::shouldIgnoreInHostDeviceCheck ( FunctionDecl * Callee)

Definition at line 21117 of file SemaDecl.cpp.

References CUDA(), clang::Global, clang::SemaCUDA::IdentifyTarget(), and LangOpts.

◆ shouldLinkDependentDeclWithPrevious()

bool Sema::shouldLinkDependentDeclWithPrevious ( Decl * D,
Decl * OldDecl )

Checks if the new declaration declared in dependent context must be put in the same redeclaration chain as the specified declaration.

Parameters
DDeclaration that is checked.
PrevDeclPrevious declaration found with proper lookup method for the same declaration name.
Returns
True if D must be added to the redeclaration chain which PrevDecl belongs to.

Definition at line 11336 of file SemaDecl.cpp.

References canFullyTypeCheckRedeclaration(), clang::Decl::getDeclContext(), clang::Decl::getFriendObjectKind(), clang::Decl::getLexicalDeclContext(), clang::DeclContext::isDependentContext(), and clang::DeclContext::isFileContext().

Referenced by CheckFunctionDeclaration().

◆ shouldSkipAnonEnumBody()

SkipBodyInfo Sema::shouldSkipAnonEnumBody ( Scope * S,
IdentifierInfo * II,
SourceLocation IILoc )

Determine whether the body of an anonymous enumeration should be skipped.

Parameters
IIThe name of the first enumerator.

Definition at line 20439 of file SemaDecl.cpp.

References clang::cast(), clang::CPlusPlus, forRedeclarationInCurContext(), clang::NamedDecl::getDeclName(), getLangOpts(), hasVisibleDefinition(), LookupOrdinaryName, LookupSingleName(), and clang::sema::Skip.

◆ ShouldSplatAltivecScalarInCast()

bool Sema::ShouldSplatAltivecScalarInCast ( const VectorType * VecTy)

◆ ShouldUseTypeAwareOperatorNewOrDelete()

TypeAwareAllocationMode Sema::ShouldUseTypeAwareOperatorNewOrDelete ( ) const

◆ ShouldWarnIfUnusedFileScopedDecl()

◆ SpecialMemberIsTrivial()

bool Sema::SpecialMemberIsTrivial ( CXXMethodDecl * MD,
CXXSpecialMemberKind CSM,
TrivialABIHandling TAH = TrivialABIHandling::IgnoreTrivialABI,
bool Diagnose = false )

Determine whether a defaulted or deleted special member function is trivial, as specified in C++11 [class.ctor]p5, C++11 [class.copy]p12, C++11 [class.copy]p25, and C++11 [class.dtor]p5.

Definition at line 10302 of file SemaDeclCXX.cpp.

References clang::CXXRecordDecl::bases(), checkTrivialClassMembers(), checkTrivialSubobjectCall(), clang::Qualifiers::Const, Context, clang::CopyAssignment, clang::CopyConstructor, clang::DefaultConstructor, clang::Destructor, Diag(), Diagnose, clang::Type::getAs(), clang::CXXBaseSpecifier::getBeginLoc(), clang::QualType::getCVRQualifiers(), clang::Decl::getLocation(), clang::FunctionDecl::getMinRequiredArguments(), clang::FunctionDecl::getNonObjectParameter(), clang::FunctionDecl::getNumParams(), clang::CXXRecordDecl::getNumVBases(), clang::FunctionDecl::getParamDecl(), clang::CXXMethodDecl::getParent(), clang::ReferenceType::getPointeeType(), clang::ParmVarDecl::getSourceRange(), clang::ValueDecl::getType(), clang::Invalid, clang::QualType::isConstQualified(), clang::CXXRecordDecl::isDynamicClass(), clang::FunctionDecl::isUserProvided(), clang::FunctionDecl::isVariadic(), clang::CXXBaseSpecifier::isVirtual(), clang::CXXMethodDecl::isVirtual(), clang::CXXRecordDecl::methods(), clang::MoveAssignment, clang::MoveConstructor, TSK_BaseClass, and clang::CXXRecordDecl::vbases_begin().

Referenced by CheckCompletedCXXClass(), checkTrivialSubobjectCall(), DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), and RequireLiteralType().

◆ SPIRV()

SemaSPIRV & clang::Sema::SPIRV ( )
inline

Definition at line 1528 of file Sema.h.

◆ SubstAutoType()

QualType Sema::SubstAutoType ( QualType TypeWithAuto,
QualType Replacement )

Substitute Replacement for auto in TypeWithAuto.

Definition at line 5380 of file SemaTemplateDeduction.cpp.

References Context.

Referenced by CheckExplicitlyDefaultedComparison(), DeduceTemplateArguments(), and MergeFunctionDecl().

◆ SubstAutoTypeDependent()

◆ SubstAutoTypeSourceInfo()

TypeSourceInfo * Sema::SubstAutoTypeSourceInfo ( TypeSourceInfo * TypeWithAuto,
QualType Replacement )

Substitute Replacement for auto in TypeWithAuto.

Definition at line 5387 of file SemaTemplateDeduction.cpp.

References Context.

Referenced by DeduceTemplateSpecializationFromInitializer().

◆ SubstAutoTypeSourceInfoDependent()

◆ SubstBaseSpecifiers()

bool Sema::SubstBaseSpecifiers ( CXXRecordDecl * Instantiation,
CXXRecordDecl * Pattern,
const MultiLevelTemplateArgumentList & TemplateArgs )

Perform substitution on the base class specifiers of the given class template specialization.

Produces a diagnostic and returns true on error, returns false and attaches the instantiated base classes to the class template specialization if successful.

Definition at line 3319 of file SemaTemplateInstantiate.cpp.

References AttachBaseSpecifiers(), clang::CXXRecordDecl::bases(), CheckBaseSpecifier(), Context, clang::UnexpandedInfo::Expand, clang::UnexpandedInfo::ExpandUnderForgetSubstitions, clang::Invalid, clang::UnexpandedInfo::NumExpansions, PreparePackForExpansion(), clang::Decl::setInvalidDecl(), and SubstType().

◆ SubstConceptTemplateArguments()

◆ SubstConstraintExpr()

ExprResult Sema::SubstConstraintExpr ( Expr * E,
const MultiLevelTemplateArgumentList & TemplateArgs )

Definition at line 4364 of file SemaTemplateInstantiate.cpp.

References SubstExpr().

◆ SubstConstraintExprWithoutSatisfaction()

ExprResult Sema::SubstConstraintExprWithoutSatisfaction ( Expr * E,
const MultiLevelTemplateArgumentList & TemplateArgs )

◆ SubstCXXIdExpr()

ExprResult Sema::SubstCXXIdExpr ( Expr * E,
const MultiLevelTemplateArgumentList & TemplateArgs )

Substitute an expression as if it is a address-of-operand, which makes it act like a CXXIdExpression rather than an attempt to call.

Definition at line 4353 of file SemaTemplateInstantiate.cpp.

◆ SubstDecl()

◆ SubstDeclarationNameInfo()

DeclarationNameInfo Sema::SubstDeclarationNameInfo ( const DeclarationNameInfo & NameInfo,
const MultiLevelTemplateArgumentList & TemplateArgs )

Do template substitution on declaration name info.

Definition at line 4529 of file SemaTemplateInstantiate.cpp.

References clang::DeclarationNameInfo::getLoc(), and clang::DeclarationNameInfo::getName().

Referenced by FindInstantiatedDecl().

◆ SubstDefaultArgument()

◆ SubstDefaultTemplateArgumentIfAvailable()

TemplateArgumentLoc Sema::SubstDefaultTemplateArgumentIfAvailable ( TemplateDecl * Template,
SourceLocation TemplateKWLoc,
SourceLocation TemplateNameLoc,
SourceLocation RAngleLoc,
Decl * Param,
ArrayRef< TemplateArgument > SugaredConverted,
ArrayRef< TemplateArgument > CanonicalConverted,
bool & HasDefaultArg )

If the given template parameter has a default template argument, substitute into that default template argument and return the corresponding template argument.

Definition at line 5438 of file SemaTemplate.cpp.

References clang::cast(), Context, clang::TemplateTemplateParmDecl::getDefaultArgument(), clang::TemplateArgumentLoc::getTemplateNameLoc(), hasReachableDefaultArgument(), clang::TemplateName::isNull(), SubstDefaultTemplateArgument(), and clang::Template.

Referenced by CheckTemplateArgumentList(), and ConvertDeducedTemplateArguments().

◆ SubstExceptionSpec() [1/2]

◆ SubstExceptionSpec() [2/2]

bool Sema::SubstExceptionSpec ( SourceLocation Loc,
FunctionProtoType::ExceptionSpecInfo & ESI,
SmallVectorImpl< QualType > & ExceptionStorage,
const MultiLevelTemplateArgumentList & Args )

Definition at line 2888 of file SemaTemplateInstantiate.cpp.

◆ SubstExpr()

◆ SubstExprs()

bool Sema::SubstExprs ( ArrayRef< Expr * > Exprs,
bool IsCall,
const MultiLevelTemplateArgumentList & TemplateArgs,
SmallVectorImpl< Expr * > & Outputs )

Substitute the given template arguments into a list of expressions, expanding pack expansions if required.

Parameters
ExprsThe list of expressions to substitute into.
IsCallWhether this is some form of call, in which case default arguments will be dropped.
TemplateArgsThe set of template arguments to substitute.
OutputsWill receive all of the substituted arguments.
Returns
true if an error occurred, false otherwise.

Definition at line 4504 of file SemaTemplateInstantiate.cpp.

Referenced by instantiateDependentAnnotationAttr().

◆ SubstFunctionDeclType()

TypeSourceInfo * Sema::SubstFunctionDeclType ( TypeSourceInfo * T,
const MultiLevelTemplateArgumentList & TemplateArgs,
SourceLocation Loc,
DeclarationName Entity,
CXXRecordDecl * ThisContext,
Qualifiers ThisTypeQuals,
bool EvaluateConstraints = true )

A form of SubstType intended specifically for instantiating the type of a FunctionDecl.

Its purpose is solely to force the instantiation of default-argument expressions and to avoid instantiating an exception-specification.

Definition at line 2842 of file SemaTemplateInstantiate.cpp.

References CodeSynthesisContexts, Context, clang::TypeLoc::getAs(), clang::TypeLoc::getFullDataSize(), clang::TypeLocBuilder::getTypeSourceInfo(), clang::TypeLoc::IgnoreParens(), NeedsInstantiationAsFunctionType(), clang::TypeLocBuilder::reserve(), clang::Result, and clang::T.

◆ SubstInitializer()

ExprResult Sema::SubstInitializer ( Expr * E,
const MultiLevelTemplateArgumentList & TemplateArgs,
bool CXXDirectInit )

◆ SubstituteExplicitTemplateArguments()

TemplateDeductionResult Sema::SubstituteExplicitTemplateArguments ( FunctionTemplateDecl * FunctionTemplate,
TemplateArgumentListInfo & ExplicitTemplateArgs,
SmallVectorImpl< DeducedTemplateArgument > & Deduced,
SmallVectorImpl< QualType > & ParamTypes,
QualType * FunctionType,
sema::TemplateDeductionInfo & Info )

Substitute the explicitly-provided template arguments into the given function template according to C++ [temp.arg.explicit].

Parameters
FunctionTemplatethe function template into which the explicit template arguments will be substituted.
ExplicitTemplateArgsthe explicitly-specified template arguments.
Deducedthe deduced template arguments, which will be populated with the converted and checked explicit template arguments.
ParamTypeswill be populated with the instantiated function parameters.
FunctionTypeif non-NULL, the result type of the function template will also be instantiated and the pointed-to value will be updated with the instantiated function type.
Infoif substitution fails for any reason, this object will be populated with more information about the failure.
Returns
TemplateDeductionResult::Success if substitution was successful, or some failure condition.

Definition at line 3546 of file SemaTemplateDeduction.cpp.

References clang::TemplateArgumentList::asArray(), BuildFunctionType(), clang::Sema::CheckTemplateArgumentInfo::CanonicalConverted, CheckTemplateArgumentList(), Context, clang::CPlusPlus11, clang::TemplateArgumentList::CreateCopy(), CUDA(), CurrentInstantiationScope, clang::SemaBase::Diag(), clang::Sema::CodeSynthesisContext::ExplicitTemplateArgumentSubstitution, clang::FunctionProtoType::ExtProtoInfo::ExtParameterInfos, clang::Function, FunctionTemplate, clang::TemplateArgumentList::get(), clang::getExpandedPackSize(), clang::FunctionProtoType::getExtParameterInfosOrNull(), clang::FunctionProtoType::getExtProtoInfo(), clang::TemplateArgument::getKind(), getLangOpts(), clang::sema::TemplateDeductionInfo::getLocation(), clang::TemplateParameterList::getParam(), clang::Sema::ExtParameterInfoBuilder::getPointerOrNull(), clang::FunctionType::getReturnType(), clang::FunctionProtoType::hasTrailingReturn(), clang::InstantiationDepth, clang::InvalidExplicitArguments, clang::Sema::InstantiatingTemplate::isInvalid(), clang::QualType::isNull(), isSFINAEContext(), isUnevaluatedContext(), clang::Type::isVoidType(), makeTemplateParameter(), clang::Method, clang::TemplateArgument::Pack, clang::TemplateArgument::pack_begin(), clang::TemplateArgument::pack_size(), clang::sema::TemplateDeductionInfo::Param, clang::sema::TemplateDeductionInfo::setExplicitArgs(), clang::TemplateArgumentList::size(), clang::TemplateArgumentListInfo::size(), clang::TemplateParameterList::size(), clang::SubstitutionFailure, SubstParmTypes(), SubstType(), clang::Success, and clang::Sema::CheckTemplateArgumentInfo::SugaredConverted.

◆ SubstNestedNameSpecifierLoc()

NestedNameSpecifierLoc Sema::SubstNestedNameSpecifierLoc ( NestedNameSpecifierLoc NNS,
const MultiLevelTemplateArgumentList & TemplateArgs )

◆ SubstParmTypes()

bool Sema::SubstParmTypes ( SourceLocation Loc,
ArrayRef< ParmVarDecl * > Params,
const FunctionProtoType::ExtParameterInfo * ExtParamInfos,
const MultiLevelTemplateArgumentList & TemplateArgs,
SmallVectorImpl< QualType > & ParamTypes,
SmallVectorImpl< ParmVarDecl * > * OutParams,
ExtParameterInfoBuilder & ParamInfos )

Substitute the given template arguments into the given set of parameters, producing the set of parameter types that would be generated from such a substitution.

Definition at line 3151 of file SemaTemplateInstantiate.cpp.

References CodeSynthesisContexts.

Referenced by SubstituteExplicitTemplateArguments().

◆ SubstParmVarDecl()

ParmVarDecl * Sema::SubstParmVarDecl ( ParmVarDecl * D,
const MultiLevelTemplateArgumentList & TemplateArgs,
int indexAdjustment,
UnsignedOrNone NumExpansions,
bool ExpectParameterPack,
bool EvaluateConstraints = true )

◆ SubstSpaceshipAsEqualEqual()

◆ SubstStmt()

StmtResult Sema::SubstStmt ( Stmt * S,
const MultiLevelTemplateArgumentList & TemplateArgs )

Definition at line 4303 of file SemaTemplateInstantiate.cpp.

Referenced by InstantiateFunctionDefinition().

◆ SubstTemplateArgument()

bool Sema::SubstTemplateArgument ( const TemplateArgumentLoc & Input,
const MultiLevelTemplateArgumentList & TemplateArgs,
TemplateArgumentLoc & Output,
SourceLocation Loc = {},
const DeclarationName & Entity = {} )

◆ SubstTemplateArguments()

bool Sema::SubstTemplateArguments ( ArrayRef< TemplateArgumentLoc > Args,
const MultiLevelTemplateArgumentList & TemplateArgs,
TemplateArgumentListInfo & Outputs )

◆ SubstTemplateArgumentsInParameterMapping()

bool Sema::SubstTemplateArgumentsInParameterMapping ( ArrayRef< TemplateArgumentLoc > Args,
SourceLocation BaseLoc,
const MultiLevelTemplateArgumentList & TemplateArgs,
TemplateArgumentListInfo & Out )

Definition at line 4331 of file SemaTemplateInstantiate.cpp.

◆ SubstTemplateName()

TemplateName Sema::SubstTemplateName ( SourceLocation TemplateKWLoc,
NestedNameSpecifierLoc & QualifierLoc,
TemplateName Name,
SourceLocation NameLoc,
const MultiLevelTemplateArgumentList & TemplateArgs )

Definition at line 4537 of file SemaTemplateInstantiate.cpp.

Referenced by SubstDefaultTemplateArgument().

◆ SubstTemplateParams()

◆ SubstType() [1/3]

QualType Sema::SubstType ( QualType T,
const MultiLevelTemplateArgumentList & TemplateArgs,
SourceLocation Loc,
DeclarationName Entity,
bool * IsIncompleteSubstitution = nullptr )

Deprecated form of the above.

Definition at line 2798 of file SemaTemplateInstantiate.cpp.

References CodeSynthesisContexts, and clang::T.

◆ SubstType() [2/3]

◆ SubstType() [3/3]

TypeSourceInfo * Sema::SubstType ( TypeSourceInfo * T,
const MultiLevelTemplateArgumentList & TemplateArgs,
SourceLocation Loc,
DeclarationName Entity,
bool AllowDeducedTST = false )

Perform substitution on the type T with a given set of template arguments.

This routine substitutes the given template arguments into the type T and produces the instantiated type.

Parameters
Tthe type into which the template arguments will be substituted. If this type is not dependent, it will be returned immediately.
Argsthe template arguments that will be substituted for the top-level template parameters within T.
Locthe location in the source code where this substitution is being performed. It will typically be the location of the declarator (if we're instantiating the type of some declaration) or the location of the type in the source code (if, e.g., we're instantiating the type of a cast expression).
Entitythe name of the entity associated with a declaration being instantiated (if any). May be empty to indicate that there is no such entity (if, e.g., this is a type that occurs as part of a cast expression) or that the entity has no name (e.g., an unnamed function parameter).
AllowDeducedTSTWhether a DeducedTemplateSpecializationType is acceptable as the top level type of the result.
IsIncompleteSubstitutionIf provided, the pointee will be set whenever substitution would perform a replacement with a null or non-existent template argument.
Returns
If the instantiation succeeds, the instantiated type. Otherwise, produces diagnostics and returns a NULL type.

Definition at line 2749 of file SemaTemplateInstantiate.cpp.

References CodeSynthesisContexts, and clang::T.

Referenced by CheckDeductionConsistency(), CheckTemplateArgument(), CheckTemplateIdType(), CompleteVarTemplateSpecializationDecl(), ConvertDeducedTemplateArgument(), FinishTemplateArgumentDeduction(), HandleDependentAccessCheck(), instantiateDependentAlignedAttr(), InstantiateMemInitializers(), PreparePackForExpansion(), SubstBaseSpecifiers(), SubstituteExplicitTemplateArguments(), and SubstParmVarDecl().

◆ SubstTypeConstraint()

◆ SwapSatisfactionStack()

void clang::Sema::SwapSatisfactionStack ( llvm::SmallVectorImpl< SatisfactionStackEntryTy > & NewSS)
inline

Definition at line 14877 of file Sema.h.

◆ Swift()

SemaSwift & clang::Sema::Swift ( )
inline

Definition at line 1538 of file Sema.h.

Referenced by InstantiateAttrs(), mergeDeclAttribute(), and ProcessDeclAttribute().

◆ SYCL()

◆ SystemZ()

SemaSystemZ & clang::Sema::SystemZ ( )
inline

Definition at line 1543 of file Sema.h.

◆ targetDiag() [1/2]

SemaDiagnosticBuilder clang::Sema::targetDiag ( SourceLocation Loc,
const PartialDiagnostic & PD,
const FunctionDecl * FD = nullptr )
inline

Definition at line 1131 of file Sema.h.

References clang::PartialDiagnostic::getDiagID(), and targetDiag().

◆ targetDiag() [2/2]

◆ TemplateParameterListsAreEqual() [1/2]

bool Sema::TemplateParameterListsAreEqual ( const TemplateCompareNewDeclInfo & NewInstFrom,
TemplateParameterList * New,
const NamedDecl * OldInstFrom,
TemplateParameterList * Old,
bool Complain,
TemplateParameterListEqualKind Kind,
SourceLocation TemplateArgLoc = SourceLocation() )

Determine whether the given template parameter lists are equivalent.

Parameters
NewThe new template parameter list, typically written in the source code as part of a new template declaration.
OldThe old template parameter list, typically found via name lookup of the template declared with this template parameter list.
ComplainIf true, this routine will produce a diagnostic if the template parameter lists are not equivalent.
Kinddescribes how we are to match the template parameter lists.
TemplateArgLocIf this source location is valid, then we are actually checking the template parameter list of a template argument (New) against the template parameter list of its corresponding template template parameter (Old). We produce slightly different diagnostics in this scenario.
Returns
True if the template parameter lists are equal, false otherwise.

Definition at line 8350 of file SemaTemplate.cpp.

References AreConstraintExpressionsEqual(), clang::TemplateParameterList::begin(), clang::SemaBase::Diag(), Diagnose, DiagnoseTemplateParameterListArityMismatch(), clang::TemplateParameterList::end(), clang::Stmt::getBeginLoc(), clang::TemplateParameterList::getRequiresClause(), clang::TemplateParameterList::getTemplateLoc(), MatchTemplateParameterKind(), New, clang::TemplateParameterList::size(), and TPL_TemplateParamsEquivalent.

Referenced by ActOnAliasDeclaration(), CheckClassTemplate(), getMoreSpecialized(), getMoreSpecializedTemplate(), IsOverloadOrOverrideImpl(), MatchTemplateParameterKind(), MatchTemplateParametersToScopeSpecifier(), MergeVarDecl(), and TemplateParameterListsAreEqual().

◆ TemplateParameterListsAreEqual() [2/2]

bool clang::Sema::TemplateParameterListsAreEqual ( TemplateParameterList * New,
TemplateParameterList * Old,
bool Complain,
TemplateParameterListEqualKind Kind,
SourceLocation TemplateArgLoc = SourceLocation() )
inline

Definition at line 12266 of file Sema.h.

References New, and TemplateParameterListsAreEqual().

◆ TemporaryMaterializationConversion()

ExprResult Sema::TemporaryMaterializationConversion ( Expr * E)

◆ TooManyArguments()

bool clang::Sema::TooManyArguments ( size_t NumParams,
size_t NumArgs,
bool PartialOverloading = false )
inlinestatic

To be used for checking whether the arguments being passed to function exceeds the number of parameters expected for it.

Definition at line 8178 of file Sema.h.

Referenced by checkDirectCallValidity().

◆ TransformToPotentiallyEvaluated() [1/2]

◆ TransformToPotentiallyEvaluated() [2/2]

◆ translateTemplateArguments()

◆ tryBuildStdTypeIdentity()

QualType Sema::tryBuildStdTypeIdentity ( QualType Type,
SourceLocation Loc )

Looks for the std::type_identity template and instantiates it with Type, or returns a null type if type_identity has not been declared.

Returns
The instantiated template, or null if std::type_identity is not declared

Definition at line 12388 of file SemaDeclCXX.cpp.

References BuildStdClassTemplate(), LookupStdClassTemplate(), and StdTypeIdentity.

Referenced by BuildTypeAwareUsualDelete(), and FindAllocationFunctions().

◆ tryCaptureVariable() [1/2]

bool Sema::tryCaptureVariable ( ValueDecl * Var,
SourceLocation Loc,
TryCaptureKind Kind,
SourceLocation EllipsisLoc,
bool BuildAndDiagnose,
QualType & CaptureType,
QualType & DeclRefType,
const unsigned *const FunctionScopeIndexToStopAt )

Try to capture the given variable.

Parameters
VarThe variable to capture.
LocThe location at which the capture occurs.
KindThe kind of capture, which may be implicit (for either a block or a lambda), or explicit by-value or by-reference (for a lambda).
EllipsisLocThe location of the ellipsis, if one is provided in an explicit lambda capture.
BuildAndDiagnoseWhether we are actually supposed to add the captures or diagnose errors. If false, this routine merely check whether the capture can occur without performing the capture itself or complaining if the variable cannot be captured.
CaptureTypeWill be set to the type of the field used to capture this variable in the innermost block or lambda. Only valid when the variable can be captured.
DeclRefTypeWill be set to the type of a reference to the capture from within the current scope. Only valid when the variable can be captured.
FunctionScopeIndexToStopAtIf non-null, it points to the index of the FunctionScopeInfo stack beyond which we do not attempt to capture. This is useful when enclosing lambdas must speculatively capture variables that may or may not be used in certain specializations of a nested generic lambda.
Returns
true if an error occurred (i.e., the variable cannot be captured) and false if the capture succeeded.

Definition at line 19438 of file SemaExpr.cpp.

References clang::QualType::addConst(), clang::sema::LambdaScopeInfo::AfterParameterList, buildLambdaCaptureFixit(), clang::sema::LambdaScopeInfo::CallOperator, captureInBlock(), captureInCapturedRegion(), captureInLambda(), captureVariablyModifiedType(), CapturingFunctionScopes, clang::cast(), Context, clang::CR_OpenMP, CurContext, clang::SemaBase::Diag(), diagnoseUncapturableValueReferenceOrBinding(), clang::DeclContext::Equals(), clang::Explicit, FunctionScopes, clang::TypeDecl::getBeginLoc(), clang::Decl::getCanonicalDecl(), clang::sema::CapturingScopeInfo::getCapture(), clang::Decl::getDeclContext(), clang::getLambdaAwareParentOfDeclContext(), getLangOpts(), clang::Decl::getLocation(), clang::QualType::getNonReferenceType(), clang::DeclContext::getParent(), getParentOfCapturingContextOrNull(), clang::ValueDecl::getPotentiallyDecomposedVarDecl(), clang::ValueDecl::getType(), clang::QualType::getUnqualifiedType(), clang::sema::CapturingScopeInfo::ImpCap_None, clang::sema::CapturingScopeInfo::ImpCaptureStyle, clang::Implicit, clang::Invalid, clang::isa(), clang::QualType::isConstQualified(), clang::DeclContext::isFunctionOrMethod(), clang::isGenericLambdaCallOperatorSpecialization(), clang::SemaOpenMP::isOpenMPGlobalCapturedDecl(), clang::SemaOpenMP::isOpenMPPrivateDecl(), clang::SemaOpenMP::isOpenMPTargetCapturedDecl(), clang::DeclContext::isRequiresExprBody(), isVariableAlreadyCapturedInScopeInfo(), isVariableCapturable(), clang::Type::isVariablyModifiedType(), clang::sema::LambdaScopeInfo::Lambda, LangOpts, clang::sema::Capture::markUsed(), and OpenMP().

Referenced by ActOnLambdaExpressionAfterIntroducer(), buildLoopVarFunc(), CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), DoMarkBindingDeclReferenced(), getCapturedDeclRefType(), clang::getStackIndexOfNearestEnclosingCaptureCapableLambda(), MarkVarDeclODRUsed(), NeedToCaptureVariable(), and tryCaptureVariable().

◆ tryCaptureVariable() [2/2]

bool Sema::tryCaptureVariable ( ValueDecl * Var,
SourceLocation Loc,
TryCaptureKind Kind = TryCaptureKind::Implicit,
SourceLocation EllipsisLoc = SourceLocation() )

Try to capture the given variable.

Definition at line 19747 of file SemaExpr.cpp.

References tryCaptureVariable().

◆ tryConvertExprToType()

ExprResult Sema::tryConvertExprToType ( Expr * E,
QualType Ty )

◆ tryExprAsCall()

bool Sema::tryExprAsCall ( Expr & E,
QualType & ZeroArgCallReturnTy,
UnresolvedSetImpl & NonTemplateOverloads )

Figure out if an expression could be turned into a call.

Use this when trying to recover from an error where the programmer may have written just the name of a function instead of actually calling it.

Parameters
E- The expression to examine.
ZeroArgCallReturnTy- If the expression can be turned into a call with no arguments, this parameter is set to the type returned by such a call; otherwise, it is set to an empty QualType.
OverloadSet- If the expression is an overloaded function name, this parameter is populated with the decls of the various overloads.

Definition at line 2646 of file Sema.cpp.

References Ambiguous, BuildCallToMemberFunction(), Context, clang::OverloadExpr::decls_begin(), clang::OverloadExpr::decls_end(), clang::OverloadExpr::FindResult::Expression, clang::OverloadExpr::find(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Type::getPointeeType(), clang::FunctionType::getReturnType(), clang::Expr::getType(), clang::OverloadExpr::FindResult::HasFormOfMemberPointer, clang::Expr::IgnoreParens(), clang::QualType::isNull(), clang::Expr::isTypeDependent(), clang::ActionResult< PtrTy, Compress >::isUsable(), and clang::OverloadSet.

Referenced by DiagnoseAlwaysNonNullPointer(), and tryToRecoverWithCall().

◆ TryFunctionConversion()

bool Sema::TryFunctionConversion ( QualType FromType,
QualType ToType,
QualType & ResultTy ) const

Same as IsFunctionConversion, but if this would return true, it sets ResultTy to ToType.

Definition at line 1906 of file SemaOverload.cpp.

References IsFunctionConversion().

Referenced by checkPointerTypesForAssignment(), isSameOrCompatibleFunctionType(), and IsStandardConversion().

◆ TryImplicitConversion()

ImplicitConversionSequence Sema::TryImplicitConversion ( Expr * From,
QualType ToType,
bool SuppressUserConversions,
AllowedExplicit AllowExplicit,
bool InOverloadResolution,
bool CStyle,
bool AllowObjCWritebackConversion )

◆ tryLookupCtorInitMemberDecl()

ValueDecl * Sema::tryLookupCtorInitMemberDecl ( CXXRecordDecl * ClassDecl,
CXXScopeSpec & SS,
ParsedType TemplateTypeTy,
IdentifierInfo * MemberOrBase )

◆ tryLookupUnambiguousFieldDecl()

ValueDecl * Sema::tryLookupUnambiguousFieldDecl ( RecordDecl * ClassDecl,
const IdentifierInfo * MemberOrBase )

◆ tryResolveExplicitSpecifier()

◆ tryToFixVariablyModifiedVarType()

bool Sema::tryToFixVariablyModifiedVarType ( TypeSourceInfo *& TInfo,
QualType & T,
SourceLocation Loc,
unsigned FailedFoldDiagID )

Attempt to fold a variable-sized type to a constant-sized type, returning true if we were successful.

Definition at line 6793 of file SemaDecl.cpp.

References Context, clang::SemaBase::Diag(), clang::TypeSourceInfo::getType(), clang::T, toString(), and TryToFixInvalidVariablyModifiedTypeSourceInfo().

Referenced by ActOnVariableDeclarator(), BuildCompoundLiteralExpr(), and CheckFieldDecl().

◆ tryToRecoverWithCall()

bool Sema::tryToRecoverWithCall ( ExprResult & E,
const PartialDiagnostic & PD,
bool ForceComplain = false,
bool(* IsPlausibleResult )(QualType) = nullptr )

◆ UnifySection() [1/2]

◆ UnifySection() [2/2]

bool Sema::UnifySection ( StringRef SectionName,
int SectionFlags,
SourceLocation PragmaSectionLocation )

Definition at line 822 of file SemaAttr.cpp.

References Context, clang::SemaBase::Diag(), and clang::ASTContext::PSF_Implicit.

◆ UnmarkAsLateParsedTemplate()

void Sema::UnmarkAsLateParsedTemplate ( FunctionDecl * FD)

Definition at line 11621 of file SemaTemplate.cpp.

References clang::FunctionDecl::setLateTemplateParsed().

◆ updateAttrsForLateParsedTemplate()

void Sema::updateAttrsForLateParsedTemplate ( const Decl * Pattern,
Decl * Inst )

Update instantiation attributes after template was late parsed.

Some attributes are evaluated based on the body of template. If it is late parsed, such attributes cannot be evaluated when declaration is instantiated. This function is used to update instantiation attributes when template definition is ready.

Definition at line 1057 of file SemaTemplateInstantiateDecl.cpp.

References clang::Decl::addAttr(), clang::Decl::attrs(), getASTContext(), and clang::Decl::hasAttr().

Referenced by InstantiateFunctionDefinition().

◆ UpdateExceptionSpec()

◆ UseArgumentDependentLookup()

bool Sema::UseArgumentDependentLookup ( const CXXScopeSpec & SS,
const LookupResult & R,
bool HasTrailingLParen )

◆ usesPartialOrExplicitSpecialization()

◆ UsualArithmeticConversions()

◆ UsualUnaryConversions()

ExprResult Sema::UsualUnaryConversions ( Expr * E)

UsualUnaryConversions - Performs various conversions that are common to most operators (C99 6.3).

The conversions of array and function types are sometimes suppressed. For example, the array->pointer conversion doesn't apply if the array is an argument to the sizeof or address (&) operators. In these instances, this routine should not be called.

Definition at line 834 of file SemaExpr.cpp.

References Context, DefaultFunctionArrayLvalueConversion(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Expr::getType(), ImpCastExprToType(), clang::Type::isIntegralOrUnscopedEnumerationType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::QualType::isNull(), and UsualUnaryFPConversions().

Referenced by ActOnConditionalOp(), BuildVAArgExpr(), BuiltinCallWithStaticChain(), BuiltinCountZeroBitsGeneric(), CheckConditionalOperands(), CheckIndirectionOperand(), CheckLogicalOperands(), CheckShiftOperands(), checkSizelessVectorShift(), CheckSwitchCondition(), checkVectorShift(), CreateBuiltinBinOp(), CreateBuiltinUnaryOp(), DefaultArgumentPromotion(), and UsualArithmeticConversions().

◆ UsualUnaryFPConversions()

◆ ValidateFormatString()

bool Sema::ValidateFormatString ( FormatStringType FST,
const StringLiteral * Str )

Verify that one format string (as understood by attribute(format)) is self-consistent; for instance, that it doesn't have multiple positional arguments referring to the same argument in incompatible ways.

Diagnose if it isn't.

Definition at line 9653 of file SemaChecking.cpp.

References clang::FreeBSDKPrintf, clang::Kprintf, clang::NSString, clang::OSLog, clang::OSTrace, and clang::Printf.

Referenced by handleFormatMatchesAttr().

◆ ValueIsRunOfOnes()

bool Sema::ValueIsRunOfOnes ( CallExpr * TheCall,
unsigned ArgNum )

Returns true if the argument consists of one contiguous run of 1s with any number of 0s on either side.

The 1s are allowed to wrap from LSB to MSB, so 0x000FFF0, 0x0000FFFF, 0xFF0000FF, 0x0 are all runs. 0x0F0F0000 is not, since all 1s are not contiguous.

Definition at line 3749 of file SemaChecking.cpp.

References BuiltinConstantArg(), clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::Stmt::getSourceRange(), clang::Expr::isTypeDependent(), clang::Expr::isValueDependent(), and clang::Result.

◆ VerifyBitField()

◆ VerifyIntegerConstantExpression() [1/4]

ExprResult clang::Sema::VerifyIntegerConstantExpression ( Expr * E,
AllowFoldKind CanFold = AllowFoldKind::No )
inline

Definition at line 7768 of file Sema.h.

References clang::No, and VerifyIntegerConstantExpression().

◆ VerifyIntegerConstantExpression() [2/4]

ExprResult Sema::VerifyIntegerConstantExpression ( Expr * E,
llvm::APSInt * Result,
unsigned DiagID,
AllowFoldKind CanFold = AllowFoldKind::No )

◆ VerifyIntegerConstantExpression() [3/4]

ExprResult Sema::VerifyIntegerConstantExpression ( Expr * E,
llvm::APSInt * Result,
VerifyICEDiagnoser & Diagnoser,
AllowFoldKind CanFold = AllowFoldKind::No )

VerifyIntegerConstantExpression - Verifies that an expression is an ICE, and reports the appropriate diagnostics.

Returns false on success. Can optionally return the value of the expression.

Definition at line 17608 of file SemaExpr.cpp.

References clang::APValue, Context, clang::CPlusPlus, clang::CPlusPlus11, clang::ConstantExpr::Create(), DefaultLvalueConversion(), clang::Expr::EvalStatus::Diag, clang::SemaBase::Diag(), clang::Sema::VerifyICEDiagnoser::diagnoseFold(), clang::Sema::VerifyICEDiagnoser::diagnoseNotICE(), clang::Sema::VerifyICEDiagnoser::diagnoseNotICEType(), clang::Expr::EvaluateAsRValue(), clang::Expr::EvaluateKnownConstIntCheckOverflow(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Stmt::getBeginLoc(), clang::APValue::getInt(), getLangOpts(), clang::Decl::getLocation(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::Expr::EvalStatus::HasSideEffects, clang::Expr::EvalStatus::HasUndefinedBehavior, clang::isa(), clang::Type::isEnumeralType(), clang::APValue::isInt(), clang::Expr::isIntegerConstantExpr(), clang::Type::isIntegralOrUnscopedEnumerationType(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::No, clang::Note, PerformContextualImplicitConversion(), clang::Result, Sema(), clang::Sema::VerifyICEDiagnoser::Suppress, clang::T, and clang::Expr::EvalResult::Val.

Referenced by ActOnCaseExpr(), ActOnChooseExpr(), ActOnCXXNew(), AddAlignedAttr(), AddAlignValueAttr(), BuildBitIntType(), BuildCodeAlignAttr(), BuildStaticAssertDeclaration(), CheckArrayDesignatorExpr(), checkArraySize(), CheckCXXBooleanCondition(), CheckEnumConstant(), CheckLoopHintExpr(), CheckTemplateArgument(), isTupleLike(), VerifyBitField(), VerifyIntegerConstantExpression(), VerifyIntegerConstantExpression(), and VerifyIntegerConstantExpression().

◆ VerifyIntegerConstantExpression() [4/4]

ExprResult Sema::VerifyIntegerConstantExpression ( Expr * E,
llvm::APSInt * Result = nullptr,
AllowFoldKind CanFold = AllowFoldKind::No )

◆ warnOnCTypeHiddenInCPlusPlus()

◆ WarnOnPendingNoDerefs()

void Sema::WarnOnPendingNoDerefs ( ExpressionEvaluationContextRecord & Rec)

◆ warnOnReservedIdentifier()

◆ Wasm()

SemaWasm & clang::Sema::Wasm ( )
inline

Definition at line 1548 of file Sema.h.

Referenced by mergeDeclAttribute(), and ProcessDeclAttribute().

◆ WeakTopLevelDecls()

SmallVectorImpl< Decl * > & clang::Sema::WeakTopLevelDecls ( )
inline

WeakTopLevelDeclDecls - access to #pragma weak-generated Decls.

Definition at line 4900 of file Sema.h.

References WeakTopLevelDecl.

Referenced by clang::ParseAST().

◆ X86()

SemaX86 & clang::Sema::X86 ( )
inline

Definition at line 1553 of file Sema.h.

Referenced by handleInterruptAttr(), handleTargetClonesAttr(), and ProcessDeclAttribute().

◆ ASTDeclReader

friend class ASTDeclReader
friend

Definition at line 1565 of file Sema.h.

References ASTDeclReader.

Referenced by ASTDeclReader.

◆ ASTReader

friend class ASTReader
friend

Definition at line 1564 of file Sema.h.

References ASTReader.

Referenced by ASTReader.

◆ ASTWriter

friend class ASTWriter
friend

Definition at line 1566 of file Sema.h.

References ASTWriter, and Sema().

Referenced by ASTWriter.

◆ InitializationSequence

◆ Parser

friend class Parser
friend

Definition at line 1562 of file Sema.h.

References Parser.

Referenced by Parser.

Member Data Documentation

◆ AggregateDeductionCandidates

llvm::DenseMap<unsigned, CXXDeductionGuideDecl *> clang::Sema::AggregateDeductionCandidates

Definition at line 9038 of file Sema.h.

Referenced by DeclareAggregateDeductionGuideFromInitList().

◆ AlignPackIncludeStack

SmallVector<AlignPackIncludeState, 8> clang::Sema::AlignPackIncludeStack

Definition at line 2040 of file Sema.h.

Referenced by AddAlignmentAttributesForRecord(), and DiagnoseNonDefaultPragmaAlignPack().

◆ AlignPackStack

◆ AllEffectsToVerify

FunctionEffectKindSet clang::Sema::AllEffectsToVerify

The union of all effects present on DeclsWithEffectsToVerify.

Conditions are all null.

Definition at line 15658 of file Sema.h.

Referenced by addDeclWithEffects().

◆ AnalysisWarnings

◆ APINotes

api_notes::APINotesManager clang::Sema::APINotes

Definition at line 1292 of file Sema.h.

Referenced by captureSwiftVersionIndependentAPINotes(), ProcessAPINotes(), and Sema().

◆ ArgPackSubstIndex

UnsignedOrNone clang::Sema::ArgPackSubstIndex

The current index into pack expansion arguments that will be used for substitution of parameter packs.

The pack expansion index will be none to indicate that parameter packs should be instantiated as themselves. Otherwise, the index specifies which argument within the parameter pack will be used for substitution.

Definition at line 13652 of file Sema.h.

Referenced by clang::Sema::ArgPackSubstIndexRAII::ArgPackSubstIndexRAII(), CheckConstraintSatisfaction(), FindInstantiatedDecl(), getPackIndex(), getPackSubstitutedTemplateArgument(), and Sema().

◆ BSSSegStack

PragmaStack<StringLiteral *> clang::Sema::BSSSegStack

Definition at line 2043 of file Sema.h.

Referenced by ActOnPragmaMSSeg(), CheckCompleteVariableDeclaration(), and Sema().

◆ BumpAlloc

llvm::BumpPtrAllocator clang::Sema::BumpAlloc

Definition at line 1233 of file Sema.h.

Referenced by CreateParsedType(), LookupSpecialMember(), and PrintStats().

◆ CachedFunctionScope

std::unique_ptr<sema::FunctionScopeInfo> clang::Sema::CachedFunctionScope

Definition at line 1220 of file Sema.h.

Referenced by PushFunctionScope().

◆ CapturingFunctionScopes

unsigned clang::Sema::CapturingFunctionScopes = 0

Track the number of currently active capturing scopes.

Definition at line 1231 of file Sema.h.

Referenced by PushBlockScope(), PushCapturedRegionScope(), PushLambdaScope(), and tryCaptureVariable().

◆ Cleanup

◆ CodeSegStack

◆ CodeSynthesisContextLookupModules

SmallVector<Module *, 16> clang::Sema::CodeSynthesisContextLookupModules

Extra modules inspected when performing a lookup during a template instantiation.

Computed lazily.

Definition at line 13608 of file Sema.h.

Referenced by getLookupModules(), and popCodeSynthesisContext().

◆ CodeSynthesisContexts

◆ CollectStats

bool clang::Sema::CollectStats

Flag indicating whether or not to collect detailed statistics.

Definition at line 1218 of file Sema.h.

Referenced by LifetimeSafetyTUAnalysis(), clang::ParseAST(), and Sema().

◆ ConstSegStack

PragmaStack<StringLiteral *> clang::Sema::ConstSegStack

Definition at line 2044 of file Sema.h.

Referenced by ActOnPragmaMSSeg(), CheckCompleteVariableDeclaration(), and Sema().

◆ Consumer

◆ Context

ASTContext& clang::Sema::Context

Definition at line 1288 of file Sema.h.

Referenced by ActOnAccessSpecifier(), ActOnAddrLabel(), ActOnAliasDeclaration(), ActOnArraySubscriptExpr(), ActOnArrayTypeTrait(), ActOnBlockArguments(), ActOnBlockStart(), ActOnBlockStmtExpr(), ActOnBreakStmt(), ActOnBuiltinOffsetOf(), ActOnCapScopeReturnStmt(), ActOnCapturedRegionStart(), ActOnCapturedRegionStart(), ActOnCaseStmt(), ActOnCharacterConstant(), ActOnChooseExpr(), ActOnClassTemplateSpecialization(), ActOnCleanupAttr(), ActOnComment(), ActOnCompoundLiteral(), ActOnCompoundRequirement(), ActOnCompoundStmt(), ActOnConditionalOp(), ActOnContinueStmt(), ActOnConversionDeclarator(), ActOnCXXBoolLiteral(), ActOnCXXCatchBlock(), ActOnCXXDelete(), ActOnCXXFoldExpr(), ActOnCXXForRangeStmt(), ActOnCXXGlobalScopeSpecifier(), ActOnCXXMemberDeclarator(), ActOnCXXNestedNameSpecifier(), ActOnCXXNestedNameSpecifierDecltype(), ActOnCXXNestedNameSpecifierIndexedPack(), ActOnCXXNew(), ActOnCXXNullPtrLiteral(), ActOnCXXParenListInitExpr(), ActOnCXXTryBlock(), ActOnCXXTypeConstructExpr(), ActOnCXXTypeid(), ActOnCXXUuidof(), ActOnDeclStmt(), ActOnDecltypeExpression(), ActOnDecompositionDeclarator(), ActOnDefaultStmt(), actOnDelayedExceptionSpecification(), ActOnDependentIdExpression(), ActOnDependentMemberExpr(), ActOnDependentTag(), ActOnDesignatedInitializer(), ActOnDocumentableDecls(), ActOnDoStmt(), ActOnEffectExpression(), ActOnEmbedExpr(), ActOnEmptyDeclaration(), ActOnEndOfDeferStmt(), ActOnEndOfTranslationUnit(), ActOnEnumBody(), ActOnExceptionDeclarator(), ActOnExplicitInstantiation(), ActOnExplicitInstantiation(), ActOnExplicitInstantiation(), ActOnFields(), ActOnFileScopeAsmDecl(), ActOnFinishFullExpr(), ActOnFinishFunctionBody(), ActOnFinishFunctionDeclarationDeclarator(), ActOnFinishKNRParamDeclarations(), ActOnFinishSEHFinallyBlock(), ActOnFinishSwitchStmt(), ActOnForStmt(), ActOnFriendFunctionDecl(), ActOnFriendTypeDecl(), ActOnFunctionDeclarator(), ActOnGCCAsmStmt(), ActOnGlobalModuleFragmentDecl(), ActOnGNUNullExpr(), ActOnGotoStmt(), ActOnIdExpression(), ActOnIfStmt(), ActOnIndirectGotoStmt(), ActOnInitializerError(), ActOnIntegerConstant(), ActOnLabelStmt(), ActOnLambdaClosureQualifiers(), ActOnLastBitfield(), ActOnMemInitializer(), ActOnMemInitializers(), ActOnModuleDecl(), ActOnModuleImport(), ActOnMSAsmStmt(), ActOnMSDependentExistsStmt(), ActOnMSVCUnknownTypeName(), ActOnNamespaceAliasDef(), ActOnNoexceptSpec(), ActOnNonTypeTemplateParameter(), ActOnNullStmt(), ActOnNumericConstant(), actOnOMPReductionKindClause(), ActOnParamDeclarator(), ActOnParenExpr(), ActOnParenListExpr(), ActOnPragmaDetectMismatch(), ActOnPragmaMSComment(), ActOnPragmaMSSeg(), ActOnPragmaOptionsAlign(), ActOnPragmaPack(), ActOnPragmaRedefineExtname(), ActOnPragmaUnused(), ActOnPragmaWeakID(), ActOnPrivateModuleFragmentDecl(), ActOnPseudoDestructorExpr(), ActOnPseudoDestructorExpr(), ActOnRequiresExpr(), ActOnSEHExceptBlock(), ActOnSEHLeaveStmt(), ActOnSEHTryBlock(), ActOnSizeofParameterPackExpr(), ActOnSourceLocExpr(), ActOnStartConceptDefinition(), ActOnStartCXXMemberDeclarations(), ActOnStartCXXMemberReference(), ActOnStartExportDecl(), ActOnStartLinkageSpecification(), ActOnStartNamespaceDef(), ActOnStartOfFunctionDef(), ActOnStartOfLambdaDefinition(), ActOnStartOfSwitchStmt(), ActOnStartRequiresExpr(), ActOnStartTopLevelStmtDecl(), ActOnStringLiteral(), ActOnSuperScopeSpecifier(), ActOnTag(), ActOnTagFinishDefinition(), ActOnTagFinishSkippedDefinition(), ActOnTagTemplateIdType(), ActOnTemplatedFriendTag(), ActOnTemplateIdType(), ActOnTemplateName(), ActOnTemplateParameterList(), ActOnTemplateTemplateParameter(), ActOnTranslationUnitScope(), ActOnTypedefNameDecl(), ActOnTypenameType(), ActOnTypenameType(), ActOnTypeParameter(), ActOnTypeRequirement(), ActOnTypeTrait(), ActOnUnevaluatedStringLiteral(), ActOnUninitializedDecl(), ActOnUsingDirective(), ActOnUsingEnumDeclaration(), ActOnVariableDeclarator(), ActOnVarTemplateSpecialization(), ActOnWhileStmt(), AddAlignedAttr(), AddAlignedAttr(), AddAlignmentAttributesForRecord(), AddAlignValueAttr(), AddAllocAlignAttr(), AddAssumeAlignedAttr(), addBlockPointerConversion(), AddBuiltinAssignmentOperatorCandidates(), AddBuiltinCandidate(), AddBuiltinOperatorCandidates(), AddConversionCandidate(), AddFunctionCandidates(), addFunctionPointerConversion(), AddImplicitlyDeclaredMembersToClass(), AddImplicitMSFunctionNoBuiltinAttr(), addImplicitTypedef(), AddInitializerToDecl(), AddKnownFunctionAttributes(), AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction(), addLifetimeBoundToImplicitThis(), AddMemberOperatorCandidates(), AddMethodTemplateCandidateImmediately(), AddModeAttr(), AddMsStructLayoutForRecord(), addNoClusterAttr(), AddOptnoneAttributeIfNoConflicts(), AddOverloadCandidate(), AddOverriddenMethods(), AddPropertyAttrs(), AddPushedVisibilityAttribute(), AddSectionMSAllocText(), AddSuperSendCompletion(), AddSurrogateCandidate(), AddTemplateConversionCandidateImmediately(), AddTemplateParametersToLambdaCallOperator(), addThisCompletion(), AdjustAddressSpaceForBuiltinOperandType(), adjustBlockReturnsToEnum(), adjustCCAndNoReturn(), AdjustDestructorExceptionSpec(), AdjustFunctionParmAndArgTypesForDeduction(), adjustMemberFunctionCC(), AnalyzeBitFieldAssignment(), AnalyzeComparison(), AnalyzeImplicitConversions(), ApplyAPINotesType(), applyAPINotesType(), ApplyNullability(), applyNullability(), clang::applyObjCTypeArgs(), applyOMPAllocateAttribute(), AreConstraintExpressionsEqual(), areMultiversionVariantFunctionsCompatible(), areVectorTypesSameSize(), AttachBaseSpecifiers(), AttachTypeConstraint(), clang::OverloadCandidateSet::BestViableFunction(), BuildAddressSpaceAttr(), BuildAddressSpaceIndex(), BuildAnonymousStructOrUnion(), BuildArrayType(), BuildArrayTypeTrait(), BuildAsTypeExpr(), BuildAtomicExpr(), BuildAtomicType(), BuildAttributedStmt(), BuildBaseInitializer(), BuildBinOp(), BuildBitIntType(), BuildBlockForLambdaConversion(), BuildBlockPointerType(), BuildBuiltinBitCastExpr(), BuildBuiltinCallExpr(), BuildBuiltinOffsetOf(), BuildCallExpr(), BuildCallToMemberFunction(), BuildCallToObjectOfClassType(), BuildCaptureField(), buildCoawaitCalls(), BuildCodeAlignAttr(), BuildCompoundLiteralExpr(), BuildConvertedConstantExpression(), BuildCookedLiteralOperatorCall(), BuildCoreturnStmt(), BuildCoroutineBodyStmt(), buildCoroutinePromise(), BuildCountAttributedArrayOrPointerType(), buildCounterInit(), buildCounterUpdate(), BuildCoyieldExpr(), BuildCStyleCastExpr(), BuildCXXAssumeExpr(), BuildCXXCastArgument(), BuildCXXConstructExpr(), BuildCXXConstructExpr(), BuildCXXDefaultArgExpr(), BuildCXXDefaultInitExpr(), BuildCXXFoldExpr(), BuildCXXForRangeStmt(), BuildCXXFunctionalCastExpr(), BuildCXXMemberCallExpr(), BuildCXXNamedCast(), BuildCXXNestedNameSpecifier(), BuildCXXNew(), BuildCXXNoexceptExpr(), BuildCXXThisExpr(), BuildCXXThrow(), BuildCXXTypeConstructExpr(), BuildCXXTypeId(), BuildCXXTypeId(), BuildCXXUuidof(), BuildCXXUuidof(), BuildDeclarationNameExpr(), BuildDeclarationNameExpr(), BuildDeclaratorGroup(), buildDeclareReductionRef(), BuildDeclRefExpr(), BuildDeclRefExpr(), buildDeclRefExpr(), BuildDecltypeType(), BuildDelegatingInitializer(), BuildDependentDeclRefExpr(), BuildEmptyCXXFoldExpr(), BuildExceptionDeclaration(), BuildExpressionFromDeclTemplateArgument(), BuildExpressionFromIntegralTemplateArgumentValue(), BuildExpressionFromNonTypeTemplateArgumentValue(), BuildExpressionTrait(), BuildExprRequirement(), BuildExprRequirement(), BuildExtVectorType(), BuildFieldReferenceExpr(), BuildFloatingLiteral(), BuildFunctionType(), BuildIfStmt(), BuildImplicitBaseInitializer(), BuildImplicitMemberInitializer(), BuildInitList(), BuildLambdaExpr(), buildLambdaInitCaptureInitialization(), BuildLiteralOperatorCall(), BuildMatrixType(), BuildMemberExpr(), BuildMemberInitializer(), BuildMemberPointerType(), BuildMemberReferenceExpr(), buildMemcpyForAssignmentOp(), BuildMemInitializer(), BuildMicrosoftCAnonymousStruct(), BuildModuleInclude(), BuildMSDependentExistsStmt(), BuildMSPropertyRefExpr(), BuildNestedRequirement(), BuildNestedRequirement(), BuildOperatorCoawaitLookupExpr(), BuildOverloadedArrowExpr(), BuildOverloadedCallExpr(), buildOverloadedCallSet(), BuildPackIndexingExpr(), BuildPackIndexingType(), BuildParenType(), BuildParmVarDeclForTypedef(), BuildPointerType(), BuildPossibleImplicitMemberExpr(), buildPostUpdate(), BuildPredefinedExpr(), BuildPseudoDestructorExpr(), BuildQualifiedDeclarationNameExpr(), BuildQualifiedType(), BuildReadPipeType(), BuildReferenceType(), BuildResolvedCallExpr(), BuildResolvedCoawaitExpr(), BuildReturnStmt(), buildSingleCopyAssign(), buildSingleCopyAssignRecursively(), BuildSourceLocExpr(), BuildStaticAssertDeclaration(), BuildStdClassTemplate(), BuildStmtExpr(), BuildSynthesizedThreeWayComparison(), BuildTemplateIdExpr(), BuildTypeAwareUsualDelete(), BuildTypeConstraint(), buildTypeForLambdaCallOperator(), BuildTypeofExprType(), BuildTypeRequirement(), BuildTypeRequirement(), BuildTypeTrait(), BuildUnaryTransformType(), BuildUnresolvedCoawaitExpr(), buildUserDefinedMapperRef(), BuildUsingDeclaration(), BuildUsingEnumDeclaration(), BuildUsingPackDecl(), BuildUsingShadowDecl(), BuildVAArgExpr(), buildVarDecl(), buildVarDecl(), BuildVariableInstantiation(), BuildVectorLiteral(), BuildVectorType(), BuildWritePipeType(), BuiltinAlignment(), builtinAllocaAddrSpace(), BuiltinCallWithStaticChain(), BuiltinChangeCVRQualifiers(), BuiltinChangeSignedness(), builtinCommonTypeImpl(), BuiltinConstantArg(), BuiltinDecay(), BuiltinDumpStruct(), BuiltinInvoke(), BuiltinIsBaseOf(), BuiltinIsWithinLifetime(), BuiltinLaunder(), BuiltinMaskedGather(), BuiltinMaskedLoad(), BuiltinMaskedScatter(), BuiltinMaskedStore(), BuiltinRemoveExtent(), BuiltinRemoveReference(), BuiltinShuffleVector(), CallExprUnaryConversions(), canConvertIntToOtherIntTy(), canConvertIntTyToFloatTy(), canPassInRegisters(), canThrow(), CaptureHasSideEffects(), captureInBlock(), captureInCapturedRegion(), captureInLambda(), CastForMoving(), castForMoving(), ChangeIntegralSignedness(), CheckAdditionOperands(), checkAddressOfFunctionIsAvailable(), CheckAddressOfMemberAccess(), CheckAddressOfOperand(), CheckAlignasUnderalignment(), CheckAllocatedType(), CheckAllocationAccess(), checkAPINotesReplacementType(), checkARCPropertyImpl(), checkArithmeticOrEnumeralCompare(), checkArithmeticOrEnumeralThreeWayCompare(), clang::checkArmStreamingBuiltin(), checkArrayElementAlignment(), checkArraySize(), CheckAsmLValue(), CheckAssignmentConstraints(), CheckAssignmentOperands(), CheckAttrTarget(), CheckBaseSpecifier(), CheckBindingsCount(), checkBlockPointerTypesForAssignment(), CheckBoolLikeConversion(), CheckBoolSelect(), checkBuiltinArgument(), checkBuiltinInferAllocToken(), checkBuiltinTemplateIdType(), checkBuiltinVectorMathArgTypes(), checkBuiltinVectorMathMixedEnums(), checkBuiltinVerboseTrap(), CheckC23ConstexprInitConversion(), CheckC23ConstexprInitStringLiteral(), CheckC23ConstexprVarType(), checkCall(), CheckCallingConvAttr(), CheckCaseExpression(), CheckCastAlign(), checkClassLevelDLLAttribute(), CheckClassTemplate(), CheckCompareOperands(), CheckComparisonCategoryType(), CheckCompatibleReinterpretCast(), CheckCompletedCoroutineBody(), CheckCompletedCXXClass(), CheckCompleteDecompositionDeclaration(), CheckCompleteDestructorVariant(), CheckCompleteVariableDeclaration(), checkComplexDecomposition(), CheckConceptRedefinition(), CheckConceptTemplateId(), checkConditionalBlockPointerCompatibility(), checkConditionalNullPointer(), checkConditionalObjectPointersCompatibility(), CheckConditionalOperands(), checkConditionalPointerCompatibility(), checkConstantPointerAuthKey(), CheckConstraintExpression(), CheckConstraintSatisfaction(), CheckConstructor(), CheckConstructorAccess(), CheckConstructorDeclarator(), CheckConversionDeclarator(), CheckCXXThrowOperand(), CheckDeducedArgumentConstraints(), CheckDeducedPlaceholderConstraints(), CheckDeductionConsistency(), CheckDeductionGuideDeclarator(), CheckDependentFunctionTemplateSpecialization(), CheckDerivedToBaseConversion(), CheckDestructor(), CheckDestructorAccess(), CheckDestructorDeclarator(), checkDLLAttributeRedeclaration(), CheckEnableIf(), checkEnumArithmeticConversions(), CheckEnumConstant(), CheckEnumRedeclaration(), checkEnumTypesInSwitchStmt(), CheckEquivalentExceptionSpec(), clang::CheckEquivalentExceptionSpecImpl(), checkEscapingByref(), checkExceptionSpecification(), CheckExplicitlyDefaultedComparison(), CheckExplicitlyDefaultedSpecialMember(), CheckExtVectorCast(), CheckExtVectorComponent(), CheckFieldDecl(), CheckFloatComparison(), CheckForConstantInitializer(), CheckForIncompatibleAttributes(), CheckFormatString(), checkFormatStringExpr(), CheckForModifiableLvalue(), checkForMultipleExportedDefaultConstructors(), CheckForNullPointerDereference(), CheckForNullPointerDereference(), CheckForReference(), CheckFriendAccess(), CheckFunctionCall(), CheckFunctionDeclaration(), checkFunctionOrMethodParameterIndex(), CheckFunctionReturnType(), CheckFunctionTemplateSpecialization(), checkGlobalOrExternCConflict(), CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), CheckImplicitConversion(), checkIncorrectVTablePointerAuthenticationAttribute(), checkIndirectCopyRestoreSource(), checkInheritableAttr(), clang::CheckInvalidVLENandLMUL(), CheckKeyForObjCARCConversion(), CheckLiteralOperatorDeclaration(), checkLiteralOperatorTemplateParameterList(), CheckLiteralType(), CheckLogicalOperands(), CheckLookupAccess(), CheckMain(), CheckMaskedBuiltinArgs(), CheckMatrixElementwiseOperands(), CheckMatrixMultiplyOperands(), CheckMemberAccess(), checkMemberDecomposition(), CheckMemberOperatorAccess(), CheckMemberPointerConversion(), CheckMemberSpecialization(), CheckMethodOverrideParam(), CheckMethodOverrideReturn(), CheckModifiableLValue(), CheckMoveOnConstruction(), CheckMSVCRTEntryPoint(), CheckMultiVersionAdditionalDecl(), CheckMultiVersionValue(), CheckNonNullExpr(), CheckNontrivialField(), CheckNonTypeTemplateParameterType(), checkNullabilityConsistency(), CheckNullabilityTypeSpecifier(), CheckObjCBridgeCFCast(), CheckObjCBridgeNSCast(), CheckObjCCollectionLiteralElement(), checkObjCKindOfType(), checkObjCPointerTypesForAssignment(), clang::checkOpenCLEnqueueLocalSizeArgs(), checkOpenMPLoop(), CheckOperatorDeleteDeclaration(), CheckOperatorNewDeclaration(), CheckOperatorNewDeleteTypes(), CheckOriginalCallArgDeduction(), CheckOverridingFunctionAttributes(), CheckOverridingFunctionReturnType(), CheckPackExpansion(), CheckPackExpansion(), CheckPackExpansion(), CheckParameter(), clang::checkPipePacketType(), CheckPlaceholderExpr(), checkPointerAuthDiscriminatorArg(), checkPointerAuthKey(), checkPointerAuthValue(), CheckPointerConversion(), CheckPointerToMemberOperands(), checkPointerTypesForAssignment(), checkPreviousOMPAllocateAttribute(), CheckProtocolMethodDefs(), CheckPtrComparisonWithNullChar(), CheckRealImagOperand(), CheckRegparmAttr(), CheckScalarOrVector(), CheckScalarOrVectorOrMatrix(), checkSimdlenSafelenSpecified(), CheckSingleAssignmentConstraints(), CheckSizelessVectorOperands(), checkSizelessVectorShift(), CheckSpanLikeType(), CheckSpecializationInstantiationRedecl(), CheckSpecifiedExceptionType(), CheckStaticArrayArgument(), CheckStringInit(), CheckStructuredBindingMemberAccess(), CheckSubtractionOperands(), CheckSufficientAllocSize(), clang::checkSwiftAsyncErrorBlock(), checkTargetAttr(), CheckTautologicalComparison(), CheckTemplateArgument(), CheckTemplateArgument(), CheckTemplateArgument(), CheckTemplateArgumentAddressOfObjectOrFunction(), CheckTemplateArgumentIsCompatibleWithParameter(), CheckTemplateArgumentList(), CheckTemplateArgumentPointerToMember(), CheckTemplateIdType(), CheckTemplateParameterList(), CheckTemplateTypeArgument(), CheckThreadLocalForLargeAlignment(), checkThreeWayNarrowingConversion(), CheckTransparentUnionArgumentConstraints(), checkTrivialClassMembers(), checkTupleLikeDecomposition(), CheckTypedefForVariablyModifiedType(), checkTypeMappable(), CheckTypenameType(), CheckTypenameType(), checkTypeParamListConsistency(), checkTypeSupport(), checkUInt32Argument(), CheckUnaryExprOrTypeTraitOperand(), CheckUnaryExprOrTypeTraitOperand(), checkUnknownAnyArg(), CheckUnresolvedLookupAccess(), CheckUnresolvedMemberAccess(), CheckUsingShadowDecl(), CheckVariableDeclarationType(), CheckVarTemplateId(), checkVAStartABI(), CheckVectorCast(), CheckVectorCompareOperands(), CheckVectorConditionalTypes(), checkVectorDecomposition(), CheckVectorElementsTraitOperandType(), CheckVectorOperands(), checkVectorResult(), CheckVectorSelect(), checkVectorShift(), CheckWaveActive(), ClassifyName(), CloneDesignatedInitExpr(), CollectFieldInitializer(), compareConversionFunctions(), CompareDerivedToBaseConversions(), CompareImplicitConversionSequences(), CompareQualificationConversions(), CompareReferenceRelationship(), CompareStandardConversionSequences(), clang::ConversionFixItGenerator::compareTypesSimple(), completeExprArrayBound(), computeDeclContext(), ComputeDefaultedSpecialMemberExceptionSpec(), ConstantFoldAttrArgs(), convertArgsForAvailabilityChecks(), ConvertArgumentsForCall(), convertArgumentToType(), convertCallArgsToString(), ConvertDeclSpecToType(), ConvertDeclToDeclGroup(), ConvertDeducedTemplateArgument(), ConvertDeducedTemplateArguments(), ConvertMaskedBuiltinArgs(), ConvertParamDefaultArgument(), convertVector(), ConvertVectorExpr(), copyAttrFromTypedefToDecl(), copyAttrIfPresent(), CopyObject(), CreateAnnotationAttr(), CreateBuiltin(), CreateBuiltinArraySubscriptExpr(), CreateBuiltinBinOp(), CreateBuiltinMatrixSingleSubscriptExpr(), CreateBuiltinMatrixSubscriptExpr(), CreateBuiltinUnaryOp(), CreateCapturedStmtRecordDecl(), createClusterDimsAttr(), clang::CodeCompletionResult::CreateCodeCompletionString(), createFieldForHostLayoutStruct(), CreateFunctionRefExpr(), CreateGenericSelectionExpr(), CreateLambdaCallOperator(), createLambdaClosureType(), createLambdaInitCaptureVarDecl(), CreateLaunchBoundsAttr(), CreateMaterializeTemporaryExpr(), CreateNewFunctionDecl(), CreateOverloadedArraySubscriptExpr(), CreateOverloadedBinOp(), CreateOverloadedUnaryOp(), CreateRecoveryExpr(), clang::CodeCompleteConsumer::OverloadCandidate::CreateSignatureString(), createSubstDiag(), createSubstDiagAt(), CreateUnaryExprOrTypeTraitExpr(), CreateUnaryExprOrTypeTraitExpr(), CreateUnresolvedLookupExpr(), CXXCheckConditionalOperands(), CXXRecordMembersNamed(), DeclApplyPragmaWeak(), DeclareGlobalAllocationFunction(), DeclareGlobalNewDelete(), DeclareImplicitCopyAssignment(), DeclareImplicitCopyConstructor(), DeclareImplicitDefaultConstructor(), DeclareImplicitDestructor(), DeclareImplicitMoveAssignment(), DeclareImplicitMoveConstructor(), DecomposeUnqualifiedId(), DeduceAutoType(), deduceClosureReturnType(), DeduceFromInitializerList(), DeduceFunctionTypeFromReturnExpr(), DeduceNonTypeTemplateArgument(), DeduceNonTypeTemplateArgument(), DeduceNullPtrTemplateArgument(), deduceOpenCLAddressSpace(), DeduceReturnType(), DeduceTemplateArguments(), DeduceTemplateArguments(), DeduceTemplateArguments(), DeduceTemplateArgumentsByTypeMatch(), DeduceTemplateArgumentsFromType(), DeduceTemplateSpecArguments(), DeduceTemplateSpecializationFromInitializer(), deduceVarTypeFromInitializer(), DefaultArgumentPromotion(), defaultedSpecialMemberIsConstexpr(), DefaultFunctionArrayConversion(), DefaultLvalueConversion(), DefineDefaultedComparison(), DefineImplicitCopyAssignment(), DefineImplicitCopyConstructor(), DefineImplicitDefaultConstructor(), DefineImplicitDestructor(), DefineImplicitLambdaToBlockPointerConversion(), DefineImplicitLambdaToFunctionPointerConversion(), DefineImplicitMoveAssignment(), DefineImplicitMoveConstructor(), DefineInheritingConstructor(), DefineUsedVTables(), DelayDependentAccess(), clang::InitializationSequence::Diagnose(), DiagnoseAmbiguousLookup(), diagnoseArgDependentDiagnoseIfAttrs(), diagnoseArgIndependentDiagnoseIfAttrs(), diagnoseArithmeticOnTwoFunctionPointers(), diagnoseArrayStarInParamType(), DiagnoseAssignmentEnum(), DiagnoseAssignmentResult(), DiagnoseAvailabilityOfDecl(), DiagnoseBadAccess(), DiagnoseBadConversion(), DiagnoseBadDeduction(), DiagnoseBadDivideOrRemainderValues(), DiagnoseBadShiftValues(), DiagnoseBaseOrMemInitializerOrder(), DiagnoseCommaOperator(), DiagnoseConditionalForNull(), DiagnoseDirectIsaAccess(), DiagnoseDivisionSizeofPointerOrArray(), DiagnoseEmptyLookup(), DiagnoseEqualityWithExtraParens(), DiagnoseExceptionUse(), DiagnoseFloatingImpCast(), DiagnoseForRangeConstVariableCopies(), DiagnoseForRangeReferenceVariableCopies(), DiagnoseIntInBoolContext(), DiagnoseInvalidExplicitObjectParameterInLambda(), DiagnoseInvalidRedeclaration(), DiagnoseIsEmptyReason(), DiagnoseIsFinalReason(), diagnoseListInit(), diagnoseMissingImport(), diagnoseMissingTemplateArguments(), DiagnoseNarrowingInInitList(), DiagnoseNonAbstractReason(), DiagnoseNonAssignableReason(), DiagnoseNonConstructibleReason(), DiagnoseNontrivial(), diagnoseObjCARCConversion(), DiagnoseObjCImplementedDeprecations(), diagnoseOpenCLTypes(), diagnoseQualifiedDeclaration(), DiagnoseSentinelCalls(), DiagnoseSizeOfParametersAndReturnValue(), DiagnoseStaticAssertDetails(), diagnoseTautologicalComparison(), DiagnoseTwoPhaseOperatorLookup(), DiagnoseUninitializedUse(), DiagnoseUninstantiableTemplate(), DiagnoseUniqueObjectDuplication(), DiagnoseUnknownAttribute(), DiagnoseUnknownTemplateName(), DiagnoseUnknownTypeName(), DiagnoseUnusedDecl(), DiagnoseUseOfDecl(), diagnoseVarDeclTypeMismatch(), diagnoseWellFormedUnsatisfiedConstraintExpr(), diagOpenCLBuiltinTypeError(), DiagRecursiveConstraintEval(), DiscardingCFIUncheckedCallee(), DiscardMisalignedMemberAddress(), DoEmitAvailabilityWarning(), doesUsualArrayDeleteWantSize(), DoMarkPotentialCapture(), DoMarkVarDeclReferenced(), EmitDiagnostic(), emitReplacement(), EvaluateAsStringImpl(), EvaluateBooleanTypeTrait(), EvaluateConvertedConstantExpression(), ExpandAnonymousFieldDesignator(), ExpandFunctionLocalPredefinedMacros(), ExtendNestedNameSpecifier(), ExtractUnqualifiedFunctionType(), FillInlineAsmIdentifierInfo(), FilterLookupForScope(), filterNonConflictingPreviousTypedefDecls(), FinalizeDeclaration(), FinalizeDeclaratorGroup(), FinalizeVarWithDestructor(), FindAllocationFunctions(), FindAssociatedClassesAndNamespaces(), FindBaseInitializer(), clang::findCapturingExpr(), FindCompositePointerType(), findConstantBaseAndOffset(), FindDeallocationFunction(), FindDeallocationFunctionForDestructor(), findDecomposableBaseClass(), findDeleteForPromise(), findFailedBooleanCondition(), findInheritingConstructor(), FindInstantiatedDecl(), FindLabeledBreakContinueScope(), findLocallyScopedExternCDecl(), clang::DeclSpec::Finish(), FinishTemplateArgumentDeduction(), FinishTemplateArgumentDeduction(), FinishTemplateArgumentDeduction(), fitsInto(), FixOverloadedFunctionReference(), FormatStringHasSArg(), funcHasParameterSizeMangling(), FunctionParamTypesAreEqual(), GatherArgumentsForCall(), getAmbiguousPathsDisplayString(), getAndVerifyMatrixDimension(), getASTContext(), getBaseMessageSendResultType(), getCCForDeclaratorChunk(), getCompletionPrintingPolicy(), getConstructorName(), getCopyElisionCandidate(), getCurrentMangleNumberContext(), getCurrentThisType(), GetDeclSpecTypeForDeclarator(), getDecltypeForExpr(), GetDecompositionElementCount(), getDestructorName(), getDestructorTypeForDecltype(), getDummyLambdaType(), getFixedEnumPromtion(), GetFullTypeForDeclarator(), getGenericLambdaTemplateParameterList(), getIdentityTemplateArgumentLoc(), getImplicitMethodEPI(), getInheritingConstructorName(), getLambdaConversionFunctionCallConv(), getLambdaConversionFunctionResultType(), getLocationOfStringLiteralByte(), getMoreSpecialized(), getMoreSpecializedPartialSpecialization(), getMoreSpecializedPartialSpecialization(), getMoreSpecializedTemplate(), getNamedReturnInfo(), getNamedReturnInfo(), GetNameFromUnqualifiedId(), getNonOdrUseReasonInCurrentContext(), getNSNumberFactoryMethod(), getOpenCLEnumType(), getOpenCLKernelParameterType(), getOpenCLTypedefType(), GetOrCreateMSAsmLabel(), getOrCreateStdNamespace(), getParamType(), getPatternForClassTemplateSpecialization(), getPresumedAlignmentOfPointer(), getPrintingPolicy(), getPrintingPolicy(), GetSignedSizelessVectorType(), GetSignedVectorType(), getStdAlignValT(), getStdBadAlloc(), getStdNamespace(), getStdTrait(), getSuperIdentifier(), getTemplateArgumentPackExpansionPattern(), getTemplateInstantiationArgs(), getTrivialIntegralTemplateArgument(), getTrivialTemplateArgumentLoc(), getTupleLikeElementType(), GetTypeForDeclaratorCast(), getTypeName(), GetTypeOfFunction(), GetTypeSourceInfoForDeclarator(), getTypeSourceInfoForStdAlignValT(), getVariadicCallType(), GetVTablePointer(), GloballyUniqueObjectMightBeAccidentallyDuplicated(), handleAbiTagAttr(), handleAcquireCapabilityAttr(), handleAcquiredAfterAttr(), handleAcquiredBeforeAttr(), handleAcquireHandleAttr(), HandleAddressSpaceTypeAttribute(), handleAliasAttr(), handleAlignedAttr(), handleAllocSizeAttr(), handleAlwaysInlineAttr(), handleAnalyzerNoReturnAttr(), HandleAnnotateTypeAttr(), handleAPINotedRetainCountAttribute(), handleArgumentWithTypeTagAttr(), HandleArmSveVectorBitsTypeAttr(), handleAssertCapabilityAttr(), handleAtomicAttr(), handleAttrWithMessage(), handleAvailabilityAttr(), handleBTFDeclTagAttr(), HandleBTFTypeTagAttribute(), handleBuiltinAliasAttr(), handleCallableWhenAttr(), handleCallbackAttr(), handleCallConvAttr(), handleCalledOnceAttr(), handleCapabilityAttr(), handleCFGuardAttr(), handleCFIUncheckedCalleeAttr(), handleCleanupAttr(), handleClusterDimsAttr(), handleCodeModelAttr(), handleCommonAttr(), handleComplexConversion(), handleComplexFloatConversion(), handleComplexIntConversion(), handleConstantAttr(), handleConstructorAttr(), handleConsumableAttr(), handleCPUSpecificAttr(), handleCXXAssumeAttr(), handleDeclspecThreadAttr(), handleDelayedForbiddenType(), handleDependencyAttr(), HandleDependentAccessCheck(), handleDeprecatedAttr(), handleDestructorAttr(), handleDeviceAttr(), handleDiagnoseAsBuiltinAttr(), handleDiagnoseIfAttr(), handleDLLAttr(), handleEnableIfAttr(), handleEnforceTCBAttr(), handleEnumExtensibilityAttr(), clang::SemaSwift::handleError(), handleExcludeFromExplicitInstantiationAttr(), handleExternalSourceSymbolAttr(), handleFallThroughAttr(), HandleField(), handleFixedPointConversion(), handleFloatConversion(), handleFormatArgAttr(), handleFormatAttrCommon(), handleFunctionReturnThunksAttr(), handleFunctionTypeAttr(), HandleFunctionTypeMismatch(), handleGCCStructAttr(), handleGlobalAttr(), handleGNUInlineAttr(), handleGridConstantAttr(), handleGuardedByAttr(), handleHandleAttr(), handleHLSLControlFlowHint(), handleHLSLLoopHintAttr(), handleIFuncAttr(), HandleImmediateInvocations(), handleInitPriorityAttr(), handleIntegerConversion(), handleIntegerVectorBinOpConversion(), handleInterruptAttr(), handleIntToFloatConversion(), handleLambdaNumbering(), handleLayoutVersion(), handleLifetimeCategoryAttr(), handleLikely(), handleLockReturnedAttr(), handleLocksExcludedAttr(), handleLoopHintAttr(), handleMallocSpanAttr(), handleManagedAttr(), handleMinVectorWidthAttr(), handleModularFormat(), handleMSConstexprAttr(), handleMSConstexprAttr(), handleMSPointerTypeQualifierAttr(), HandleMSProperty(), handleMSStructAttr(), handleMustTailAttr(), handleNakedAttr(), HandleNeonVectorTypeAttr(), handleNoBuiltinAttr(), handleNoClusterAttr(), handleNoConvergentAttr(), handleNoDebugAttr(), handleNoEscapeAttr(), handleNoInlineAttr(), handleNoMergeAttr(), handleNoMergeAttr(), handleNonBlockingNonAllocatingTypeAttr(), handleNonNullAttr(), handleNonNullAttrParameter(), handleNonStringAttr(), handleNoRandomizeLayoutAttr(), handleNoReturnAttr(), handleNoSanitizeAddressAttr(), handleNoSanitizeAttr(), handleNoSanitizeMemoryAttr(), handleNoSanitizeThreadAttr(), handleNoSpecializations(), handleNoUniqueAddressAttr(), handleObjCGCTypeAttr(), handleObjCOwnershipTypeAttr(), HandleOpenCLAccessAttr(), handleOpenCLUnrollHint(), handleOwnershipAttr(), handlePackedAttr(), handleParamTypestateAttr(), handlePassObjectSizeAttr(), handlePatchableFunctionEntryAttr(), handlePreferredName(), handlePreferredTypeAttr(), handlePtGuardedByAttr(), handlePtGuardedVarAttr(), HandlePtrAuthQualifier(), handleRandomizeLayoutAttr(), handlerCanCatch(), handleReentrantCapabilityAttr(), handleReleaseCapabilityAttr(), handleRequiresCapabilityAttr(), handleRestrictAttr(), handleReturnsNonNullAttr(), handleReturnTypestateAttr(), HandleRISCVRVVVectorBitsTypeAttr(), handleSentinelAttr(), handleSetTypestateAttr(), handleSharedAttr(), handleStandardNoReturnAttr(), handleSuppressAttr(), handleSuppressAttr(), HandleSwiftAttr(), handleTagNumbering(), handleTargetAttr(), handleTargetClonesAttr(), handleTargetVersionAttr(), handleTestTypestateAttr(), handleTLSModelAttr(), handleTransparentUnionAttr(), handleTryAcquireCapabilityAttr(), handleTypeTagForDatatypeAttr(), handleUninitializedAttr(), handleUnlikely(), handleUnsafeBufferUsage(), handleUnusedAttr(), handleUuidAttr(), handleVecReturnAttr(), handleVecTypeHint(), handleVisibilityAttr(), handleVTablePointerAuthentication(), handleWarnUnusedResult(), handleWeakImportAttr(), handleWeakRefAttr(), HandleWebAssemblyFuncrefAttr(), handleWorkGroupSize(), handleXRayLogArgsAttr(), handleZeroCallUsedRegsAttr(), hasAcceptableDefinition(), hasDeducibleTemplateParameters(), hasMergedDefinitionInCurrentModule(), HasNonDeletedDefaultedEqualityComparison(), hasUserDefinedMapper(), hasVisibleMergedDefinition(), IgnoredValueConversions(), ImpCastExprToType(), ImplicitlyDefineFunction(), inferARCLifetimeForPointee(), inferARCWriteback(), inferGslOwnerPointerAttribute(), inferGslPointerAttribute(), inferLifetimeBoundAttribute(), inferLifetimeCaptureByAttribute(), clang::inferNoReturnAttr(), inferNullableClassAttribute(), Initialize(), InitializeExplicitObjectArgument(), clang::InitializationSequence::InitializeFrom(), InjectAnonymousStructOrUnionMembers(), InsertOCLBuiltinDeclarationsFromTable(), InstantiateAttrs(), InstantiateAttrsForDecl(), InstantiateClassMembers(), InstantiateDefaultCtorDefaultArgs(), InstantiateEnum(), InstantiateFunctionDefinition(), InstantiateInClassInitializer(), instantiateOMPDeclareVariantAttr(), InstantiateVariableDefinition(), InventAbbreviatedTemplateParameterTypeName(), InventTemplateParameter(), isAbstractType(), isAcceptableNestedNameSpecifier(), isAllowableExplicitConversion(), isArithmeticArgumentPromotion(), clang::isBetterOverloadCandidate(), IsBlockPointerConversion(), IsCXXTriviallyRelocatableType(), isDeductionGuideName(), isDefaultStdCall(), IsDerivedFrom(), IsEligibleForTrivialRelocation(), isEquivalentInternalLinkageDeclaration(), IsFloatingPointConversion(), isForbiddenTypeAllowed(), IsFunctionConversion(), isFunctionDefinitionDiscarded(), IsImplicitBoolFloatConversion(), isImplicitMapperNeeded(), isIncompatibleTypedef(), IsIntegralPromotion(), IsInvalidSMECallConversion(), isLaxVectorConversion(), isLibstdcxxEagerExceptionSpecHack(), IsMatrixConversion(), isMemberAccessibleForDeletion(), IsMemberPointerConversion(), isMicrosoftMissingTypename(), isMoreSpecializedThanPrimary(), isMoreSpecializedThanPrimary(), isNonNegativeIntegerValue(), isNonPlacementDeallocationFunction(), isNullPointerValueTemplateArgument(), isObjCPointerConversion(), IsOverloadOrOverrideImpl(), isPermittedNeonBaseType(), IsPointerConversion(), IsQualificationConversion(), isRelevantAttr(), isSameOrCompatibleFunctionType(), IsSimplyAccessible(), IsStandardConversion(), isStdClassTemplate(), IsStringInit(), IsStringLiteralToNonConstPointerConversion(), isTemplateName(), isTemplateTemplateParameterAtLeastAsSpecializedAs(), isTupleLike(), IsUserDefinedConversion(), isValidInteropVariable(), isValidSectionSpecifier(), isValidVarArgType(), IsVectorConversion(), IsVectorOrMatrixElementConversion(), LazilyCreateBuiltin(), LookupBuiltin(), LookupConstructors(), lookupCoroutineHandleType(), LookupDirect(), LookupGlobalDeallocationFunctions(), LookupInlineAsmField(), LookupInlineAsmVarDeclField(), LookupInSuper(), LookupLiteralOperator(), LookupMemberExpr(), LookupMethodInReceiverType(), clang::LookupNamed(), clang::LookupNamespace(), LookupObjCInterfaceDeclForLiteral(), LookupOrCreateLabel(), LookupOverloadedBinOp(), LookupOverloadedOperatorName(), LookupPredefedObjCSuperType(), lookupPromiseType(), LookupQualifiedName(), LookupSpecialMember(), LookupStdSourceLocationImpl(), makeAttributeArgExpr(), makeClusterDimsArgExpr(), makeLaunchBoundsArgExpr(), makeMergedDefinitionVisible(), makeQualifiedLValueReferenceType(), makeUnavailableInSystemHeader(), MarkBaseDestructorsReferenced(), MarkDeducedTemplateParameters(), MarkFieldDestructorReferenced(), MarkFunctionReferenced(), markUsedForAliasOrIfunc(), MarkUsedTemplateParameters(), MarkUsedTemplateParameters(), MarkUsedTemplateParameters(), MarkUsedTemplateParameters(), MarkVarDeclODRUsed(), MarkVirtualBaseDestructorsReferenced(), MarkVTableUsed(), MatchTemplateParameterKind(), MatchTemplateParametersToScopeSpecifier(), maybeAddDeclWithEffects(), MaybeAddOverrideCalls(), MaybeBindToTemporary(), MaybeCreateExprWithCleanups(), MaybeCreateStmtWithCleanups(), MaybeEmitAmbiguousAtomicConstraintsDiagnostic(), maybeExtendBlockObject(), mergeAlignedAttrs(), mergeAlwaysInlineAttr(), mergeAvailabilityAttr(), mergeBTFDeclTagAttr(), mergeCodeSegAttr(), MergeCompatibleFunctionDecls(), mergeDeclAttribute(), mergeDeclAttributes(), mergeDLLExportAttr(), mergeDLLImportAttr(), mergeErrorAttr(), mergeFormatAttr(), mergeFormatMatchesAttr(), MergeFunctionDecl(), mergeInterfaceMethodToImpl(), mergeInternalLinkageAttr(), mergeInternalLinkageAttr(), mergeMinSizeAttr(), mergeModularFormatAttr(), mergeMSInheritanceAttr(), mergeObjCDirectMembers(), mergeOptimizeNoneAttr(), mergeParamDeclTypes(), mergeSectionAttr(), MergeTypedefNameDecl(), mergeTypeNullabilityForRedecl(), mergeUuidAttr(), MergeVarDeclExceptionSpecs(), MergeVarDeclTypes(), mergeVisibilityAttr(), mergeVisibilityType(), MightInstantiateTo(), NoteAllOverloadCandidates(), NoteSurrogateCandidate(), OpenCLArithmeticConversions(), OpenCLConvertScalarsToVectors(), ParsedFreeStandingDeclSpec(), ParseLifetimeCaptureByAttr(), parseModeAttrArg(), ParseTypedefDecl(), clang::InitializationSequence::Perform(), PerformConstructorInitialization(), PerformContextuallyConvertToBool(), PerformContextuallyConvertToObjCPointer(), PerformImplicitConversion(), PerformImplicitConversion(), PerformImplicitObjectArgumentInitialization(), PerformMoveOrCopyInitialization(), PerformObjectMemberConversion(), PerformPendingInstantiations(), PointerAuthBlendDiscriminator(), PointerAuthSignGenericData(), PreferredConditionType(), PrepareArgumentsForCallToObjectOfClassType(), PrepareScalarCast(), prepareVectorSplat(), PrintInstantiationStack(), ProcessAPINotes(), ProcessAPINotes(), ProcessAPINotes(), ProcessAPINotes(), ProcessAPINotes(), ProcessAPINotes(), ProcessAPINotes(), ProcessAPINotes(), ProcessAPINotes(), ProcessAPINotes(), ProcessAPINotes(), ProcessDeclAttribute(), ProcessDeclAttributeList(), processImplicitMapsWithDefaultMappers(), ProcessOpenMPDoacrossClauseCommon(), ProcessStmtAttribute(), propagateAttribute(), PushCapturedRegionScope(), clang::TreeTransform< AdjustConstraints >::RebuildCXXInheritedCtorInitExpr(), RebuildDeclaratorInCurrentInstantiation(), RebuildNestedNameSpecifierInCurrentInstantiation(), rebuildPotentialResultsAsNonOdrUsed(), clang::TreeTransform< AdjustConstraints >::RebuildTemplateName(), recordConversion(), recoverFromTypeInKnownDependentBase(), ReferenceDllExportedMembers(), RefersToMemberWithReducedAlignment(), RegisterLocallyScopedExternCDecl(), RemoveAddressSpaceFromPtr(), repeatForLambdaConversionFunctionCallingConvs(), RequireCompleteDeclContext(), RequireCompleteEnumDecl(), RequireLiteralType(), RequireNonAbstractType(), RequireStructuralType(), ResolveAddressOfOverloadedFunction(), resolveAllocationOverloadInterior(), resolveAndFixAddressOfSingleOverloadCandidate(), ResolveAndFixSingleFunctionTemplateSpecialization(), resolveAssumedTemplateNameAsType(), resolveBuiltinNewDeleteOverload(), ResolveConstructorOverload(), ResolveOverloadedFunctionForReferenceBinding(), ResolveOverloadForDeduction(), ResolveSingleFunctionTemplateSpecialization(), SaveNestedNameSpecifierAnnotation(), SelectBestMethod(), SelectPropertyForSynthesisFromProtocols(), Sema(), SetCtorInitializers(), SetDelegatingInitializer(), SetElementTypeAsReturnType(), SetEligibleMethods(), SetNestedNameSpecifier(), SetNestedNameSpecifier(), setTagNameForLinkagePurposes(), sharedGetConstructorDestructorAttrExpr(), clang::OverloadCandidateSet::OperatorRewriteInfo::shouldAddReversed(), shouldAddReversedEqEq(), ShouldDeleteSpecialMember(), ShouldDiagnoseAvailabilityInContext(), ShouldDiagnoseSwitchCaseNotInEnum(), shouldInferAvailabilityAttribute(), ShouldRemoveFromUnused(), ShouldTryAgainWithRedefinitionType(), ShouldUseTypeAwareOperatorNewOrDelete(), ShouldWarnIfUnusedFileScopedDecl(), SpecialMemberIsTrivial(), SubstAutoType(), SubstAutoTypeSourceInfo(), SubstBaseSpecifiers(), SubstDefaultArgument(), SubstDefaultTemplateArgumentIfAvailable(), SubstFunctionDeclType(), SubstituteExplicitTemplateArguments(), SubstParmVarDecl(), SubstSpaceshipAsEqualEqual(), SubstType(), threadSafetyCheckIsSmartPointer(), transferARCOwnershipToDeclaratorChunk(), transferARCOwnershipToDeclSpec(), clang::transformOMPMappableExprListClause(), translateTemplateArgument(), TryArrayCopy(), tryCaptureVariable(), TryConstructorInitialization(), TryContextuallyConvertToBool(), TryContextuallyConvertToObjCPointer(), TryDefaultInitialization(), TryDiagnoseProtectedAccess(), tryExprAsCall(), tryGCCVectorConvertAndSplat(), TryImplicitConversion(), TryInitializerListConstruction(), TryListConversion(), TryListInitialization(), tryObjCWritebackConversion(), TryObjectArgumentInitialization(), TryOCLSamplerInitialization(), TryOrBuildParenListInitialization(), TryReferenceInit(), TryReferenceInitialization(), TryReferenceInitializationCore(), TryReferenceListInitialization(), TryRefInitWithConversionFunction(), tryResolveExplicitSpecifier(), clang::ConversionFixItGenerator::tryToFixConversion(), tryToFixVariablyModifiedVarType(), TryUserDefinedConversion(), TryUserDefinedConversion(), TryValueInitialization(), tryVectorConvertAndSplat(), UnifySection(), UnifySection(), unsupportedTypeConversion(), UpdateExceptionSpec(), UsualArithmeticConversions(), UsualUnaryConversions(), UsualUnaryFPConversions(), VerifyBitField(), VerifyIntegerConstantExpression(), verifyValidIntegerConstantExpr(), warnOnReservedIdentifier(), widenIterationCount(), and ~Sema().

◆ CurContext

DeclContext* clang::Sema::CurContext

CurContext - This is the current declaration context of parsing.

Definition at line 1421 of file Sema.h.

Referenced by ActOnAccessSpecifier(), ActOnAliasDeclaration(), ActOnAnnotModuleBegin(), ActOnAnnotModuleEnd(), ActOnAnnotModuleInclude(), ActOnBlockStart(), ActOnCapScopeReturnStmt(), ActOnCapturedRegionStart(), ActOnCapturedRegionStart(), ActOnClassTemplateSpecialization(), ActOnCompoundRequirement(), ActOnCoroutineBodyStart(), ActOnCXXMemberDeclarator(), ActOnDecompositionDeclarator(), ActOnEmptyDeclaration(), ActOnEnumConstant(), ActOnExceptionDeclarator(), ActOnExitFunctionContext(), ActOnExplicitInstantiation(), ActOnFileScopeAsmDecl(), ActOnFinishConceptDefinition(), ActOnFinishCXXMemberDecls(), ActOnFinishFullExpr(), ActOnFinishRequiresExpr(), ActOnFriendFunctionDecl(), ActOnFriendTypeDecl(), ActOnFunctionDeclarator(), ActOnIfStmt(), ActOnLambdaExpressionAfterIntroducer(), ActOnLastBitfield(), ActOnModuleDecl(), ActOnModuleImport(), ActOnMSVCUnknownTypeName(), ActOnNamespaceAliasDef(), actOnOMPReductionKindClause(), ActOnPragmaExport(), ActOnPragmaFloatControl(), ActOnPragmaMSAllocText(), ActOnPragmaMSFunction(), ActOnPragmaMSOptimize(), ActOnReenterFunctionContext(), ActOnSEHTryBlock(), ActOnSourceLocExpr(), ActOnStartConceptDefinition(), ActOnStartCXXMemberDeclarations(), ActOnStartCXXMemberReference(), ActOnStartExportDecl(), ActOnStartLinkageSpecification(), ActOnStartNamespaceDef(), ActOnStartRequiresExpr(), ActOnStartTopLevelStmtDecl(), ActOnTag(), ActOnTagFinishSkippedDefinition(), ActOnTagStartSkippedDefinition(), ActOnTemplatedFriendTag(), ActOnTypedefDeclarator(), ActOnUsingDirective(), ActOnVariableDeclarator(), ActOnVarTemplateSpecialization(), AddClassMessageCompletions(), AddKeywordsToConsumer(), AddOrdinaryNameResults(), AddOverrideResults(), BuildBaseInitializer(), BuildBlockForLambdaConversion(), BuildCallToMemberFunction(), buildCapture(), buildCapture(), BuildCompoundLiteralExpr(), buildCoroutineParameterMoves(), buildCoroutinePromise(), BuildCXXDefaultArgExpr(), BuildCXXDefaultInitExpr(), BuildCXXNestedNameSpecifier(), buildDeclareReductionRef(), BuildDelegatingInitializer(), buildDistanceFunc(), BuildExceptionDeclaration(), BuildFieldReferenceExpr(), BuildLambdaExpr(), buildLoopVarFunc(), BuildMicrosoftCAnonymousStruct(), BuildOverloadedCallExpr(), buildOverloadedCallSet(), BuildPredefinedExpr(), BuildReturnStmt(), buildSingleCopyAssignRecursively(), BuildStaticAssertDeclaration(), buildUserDefinedMapperRef(), BuildUsingDeclaration(), BuildUsingEnumDeclaration(), BuildUsingPackDecl(), BuildUsingShadowDecl(), BuildVAArgExpr(), buildVarDecl(), buildVarDecl(), CanUseDecl(), CheckAccess(), checkAllocateClauses(), checkAndRewriteMustTailAttr(), checkCall(), CheckClassTemplate(), CheckCompareOperands(), CheckConstructorAccess(), checkCoroutineContext(), CheckCXXThisType(), CheckDeductionGuideDeclarator(), CheckExplicitInstantiationScope(), CheckFriendAccess(), CheckFunctionDeclaration(), CheckIfAnyEnclosingLambdasMustCaptureAnyPotentialCaptures(), CheckInheritingConstructorUsingDecl(), CheckMissingFormatAttribute(), CheckMultiVersionAdditionalDecl(), CheckNakedParmReference(), checkNoThrow(), checkOpenMPIterationSpace(), checkOpenMPLoop(), CheckOverload(), CheckTemplateArgument(), CheckTemplateIdType(), CheckTemplateSpecializationScope(), checkTypeMappable(), CheckUsingDeclQualifier(), CheckUsingDeclRedeclaration(), CheckUsingShadowDecl(), CheckVariableDeclarationType(), checkVAStartIsInVariadicFunction(), CheckVectorElementsTraitOperandType(), computeDeclContext(), clang::Sema::ContextRAII::ContextRAII(), ConvertDeducedTemplateArgument(), CreateCapturedStmtRecordDecl(), createLambdaClosureType(), CreateNewFunctionDecl(), DeclApplyPragmaWeak(), DeduceTemplateArguments(), clang::InitializationSequence::Diagnose(), DiagnoseDependentMemberLookup(), DiagnoseEmptyLookup(), DiagnoseExceptionUse(), diagnoseQualifiedDeclaration(), DiagnoseTwoPhaseLookup(), diagnoseUncapturableValueReferenceOrBinding(), DiagnoseUseOfDecl(), DoMarkPotentialCapture(), EnterDeclaratorContext(), clang::PreferredTypeBuilder::enterReturn(), clang::IncrementalAction::ExecuteAction(), ExitDeclaratorContext(), ExpandFunctionLocalPredefinedMacros(), FilterUsingLookup(), FindInstantiatedDecl(), FinishForRangeVarDecl(), finishLinearClauses(), FixDependencyOfIdExpressionsInLambdaWithDependentObjectParameter(), forRedeclarationInCurContext(), getCurBlock(), getCurLambda(), getCurLexicalContext(), getCurrentClass(), getCurrentInstantiationOf(), getCurrentMangleNumberContext(), getCurrentThisType(), GetDeclSpecTypeForDeclarator(), getEnclosingLambdaOrBlock(), getFunctionLevelDeclContext(), getFunctionStorageClass(), GetNameFromUnqualifiedId(), getNullabilityCompletenessCheckFileID(), HandleDeclarator(), hasUncompilableErrorOccurred(), hasUserDefinedMapper(), InstantiateInClassInitializer(), InstantiateMemInitializers(), isCapturingReferenceToHostVarInCUDADeviceLambda(), isCurrentClassNameTypo(), IsInsideALocalClassWithinATemplateFunction(), isLibstdcxxEagerExceptionSpecHack(), isMicrosoftMissingTypename(), isNonNegativeIntegerValue(), isOdrUseContext(), isReferenceToNonConstCapture(), IsSimplyAccessible(), isValidCoroutineContext(), LazilyCreateBuiltin(), LookupExistingLabel(), LookupMethodInReceiverType(), LookupOrCreateLabel(), makeUnavailableInSystemHeader(), mapCodeCompletionContext(), MarkFunctionReferenced(), MarkThisReferenced(), MarkVarDeclODRUsed(), MarkVTableUsed(), MaybeAddOverrideCalls(), MergeTypedefNameDecl(), ParsedFreeStandingDeclSpec(), ParseTypedefDecl(), PopDeclContext(), ProcessOpenMPDoacrossClauseCommon(), PushDeclContext(), PushOnScopeChains(), clang::TreeTransform< AdjustConstraints >::RebuildExceptionDecl(), RebuildLambdaScopeInfo(), recoverFromMSUnqualifiedLookup(), recoverFromTypeInKnownDependentBase(), Sema(), ShouldEnterDeclaratorScope(), SubstParmVarDecl(), tryCaptureVariable(), tryImplicitlyCaptureThisIfImplicitMemberFunctionAccessWithDependentArgs(), TryTypoCorrectionForCall(), and warnAboutAmbiguousFunction().

◆ CurFPFeatures

◆ CurInitSeg

StringLiteral* clang::Sema::CurInitSeg

Last section used with #pragma init_seg.

Definition at line 2086 of file Sema.h.

Referenced by ActOnPragmaMSInitSeg(), CheckCompleteVariableDeclaration(), and Sema().

◆ CurInitSegLoc

SourceLocation clang::Sema::CurInitSegLoc

Definition at line 2087 of file Sema.h.

Referenced by ActOnPragmaMSInitSeg(), and CheckCompleteVariableDeclaration().

◆ CurrentDefer

SmallVector<std::pair<Scope *, SourceLocation>, 2> clang::Sema::CurrentDefer

Stack of '_Defer' statements that are currently being parsed, as well as the locations of their '_Defer' keywords.

Can be empty.

Definition at line 10981 of file Sema.h.

Referenced by ActOnDeferStmtError(), ActOnEndOfDeferStmt(), ActOnStartOfDeferStmt(), BuildResolvedCallExpr(), and CheckJumpOutOfSEHFinallyOrDefer().

◆ CurrentInstantiationScope

◆ CurrentParameterCopyTypes

llvm::SmallVector<QualType, 4> clang::Sema::CurrentParameterCopyTypes

Stack of types that correspond to the parameter entities that are currently being copy-initialized.

Can be empty.

Definition at line 9035 of file Sema.h.

Referenced by PerformCopyInitialization().

◆ CurrentSEHFinally

SmallVector<Scope *, 2> clang::Sema::CurrentSEHFinally

Stack of active SEH __finally scopes. Can be empty.

Definition at line 10977 of file Sema.h.

Referenced by ActOnAbortSEHFinallyBlock(), ActOnFinishSEHFinallyBlock(), ActOnStartSEHFinallyBlock(), and CheckJumpOutOfSEHFinallyOrDefer().

◆ CurrentSFINAEContext

SFINAETrap* clang::Sema::CurrentSFINAEContext = nullptr

◆ CXXThisTypeOverride

QualType clang::Sema::CXXThisTypeOverride

When non-NULL, the C++ 'this' expression is allowed despite the current context not being a non-static member function.

In such cases, this provides the type used for 'this'.

Definition at line 8466 of file Sema.h.

Referenced by ClassifyImplicitMemberAccess(), clang::Sema::ContextRAII::ContextRAII(), clang::Sema::CXXThisScopeRAII::CXXThisScopeRAII(), getCurrentThisType(), and isThisOutsideMemberFunctionBody().

◆ CXXTypeInfoDecl

RecordDecl* clang::Sema::CXXTypeInfoDecl

The C++ "type_info" declaration, which is defined in <typeinfo>.

Definition at line 8391 of file Sema.h.

Referenced by ActOnCXXTypeid(), and Sema().

◆ DataSegStack

PragmaStack<StringLiteral *> clang::Sema::DataSegStack

Definition at line 2042 of file Sema.h.

Referenced by ActOnPragmaMSSeg(), CheckCompleteVariableDeclaration(), and Sema().

◆ DeclsToCheckForDeferredDiags

llvm::SmallSetVector<Decl *, 4> clang::Sema::DeclsToCheckForDeferredDiags

Function or variable declarations to be checked for whether the deferred diagnostics should be emitted.

Definition at line 4775 of file Sema.h.

Referenced by ActOnFinishFunctionBody(), AddInitializerToDecl(), and emitDeferredDiags().

◆ DeclsWithEffectsToVerify

SmallVector<const Decl *> clang::Sema::DeclsWithEffectsToVerify

All functions/lambdas/blocks which have bodies and which have a non-empty FunctionEffectsRef to be verified.

Definition at line 15654 of file Sema.h.

Referenced by addDeclWithEffects().

◆ DeferDiags

bool clang::Sema::DeferDiags = false

Whether deferrable diagnostics should be deferred.

Definition at line 10061 of file Sema.h.

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

◆ DelayedDiagnostics

class clang::Sema::DelayedDiagnostics clang::Sema::DelayedDiagnostics

◆ DelayedDllExportClasses

◆ DelayedDllExportMemberFunctions

SmallVector<CXXMethodDecl *, 4> clang::Sema::DelayedDllExportMemberFunctions

◆ DelayedEquivalentExceptionSpecChecks

SmallVector<std::pair<FunctionDecl *, FunctionDecl *>, 2> clang::Sema::DelayedEquivalentExceptionSpecChecks

All the function redeclarations seen during a class definition that had their exception spec checks delayed, plus the prior declaration they should be checked against.

Except during error recovery, the new decl should always be a friend declaration, as that's the only valid way to redeclare a special member before its class is complete.

Definition at line 6629 of file Sema.h.

Referenced by ActOnEndOfTranslationUnit(), ActOnFinishCXXMemberDecls(), CheckDelayedMemberExceptionSpecs(), and CheckEquivalentExceptionSpec().

◆ DelayedOverridingExceptionSpecChecks

SmallVector<std::pair<const CXXMethodDecl *, const CXXMethodDecl *>, 2> clang::Sema::DelayedOverridingExceptionSpecChecks

All the overriding functions seen during a class definition that had their exception spec checks delayed, plus the overridden function.

Definition at line 6621 of file Sema.h.

Referenced by ActOnEndOfTranslationUnit(), ActOnFinishCXXMemberDecls(), CheckDelayedMemberExceptionSpecs(), and CheckOverridingFunctionExceptionSpec().

◆ DelegatingCtorDecls

DelegatingCtorDeclsType clang::Sema::DelegatingCtorDecls

All the delegating constructors seen so far in the file, used for cycle detection at the end of the TU.

Definition at line 6538 of file Sema.h.

Referenced by CheckDelegatingCtorCycles(), and SetDelegatingInitializer().

◆ DeleteExprs

llvm::MapVector<FieldDecl *, DeleteLocs> clang::Sema::DeleteExprs

Delete-expressions to be analyzed at the end of translation unit.

This list contains class members, and locations of delete-expressions that could not be proven as to whether they mismatch with new-expression used in initializer of the field.

Definition at line 8402 of file Sema.h.

Referenced by ActOnEndOfTranslationUnit(), and getMismatchingDeleteExpressions().

◆ DeviceDeferredDiags

SemaDiagnosticBuilder::DeferredDiagnosticsType clang::Sema::DeviceDeferredDiags

Diagnostics that are emitted only if we discover that the given function must be codegen'ed.

Because handling these correctly adds overhead to compilation, this is currently only enabled for CUDA compilations.

Definition at line 1418 of file Sema.h.

Referenced by emitDeferredDiags(), and hasUncompilableErrorOccurred().

◆ Diags

DiagnosticsEngine& clang::Sema::Diags

Definition at line 1290 of file Sema.h.

Referenced by ActOnCompoundStmt(), ActOnCXXMemberDeclarator(), ActOnDocumentableDecls(), ActOnDoStmt(), ActOnEndOfTranslationUnit(), ActOnFields(), ActOnForStmt(), ActOnFriendFunctionDecl(), ActOnIfStmt(), ActOnUninitializedDecl(), ActOnWhileStmt(), AddInitializerToDecl(), applyCocoaAPICheck(), BuildDeclRefExpr(), BuildResolvedCallExpr(), CheckAssignmentOperands(), CheckCompatibleReinterpretCast(), CheckConditionalOperator(), CheckCXX98CompatAccessibleCopy(), CheckForDuplicateEnumValues(), checkPointerTypesForAssignment(), CheckProtocolMethodDefs(), CheckShadow(), checkUnsafeExprAssigns(), DiagnoseAbsenceOfOverrideControl(), DiagnoseAbstractType(), clang::ImplicitConversionSequence::DiagnoseAmbiguousConversion(), DiagnoseAssignmentEnum(), DiagnoseBaseOrMemInitializerOrder(), diagnoseDiagnoseIfAttrsWith(), DiagnoseEmptyLoopBody(), DiagnoseForRangeVariableCopies(), DiagnoseHiddenVirtualMethods(), DiagnoseMismatchedSelectors(), DiagnoseNullConversion(), DiagnoseSelfMove(), diagnoseSubtractionOnNullPointer(), DiagnoseUseOfDecl(), diagnoseZeroToNullptrConversion(), emitCallStackNotes(), EmitDiagnostic(), EvaluateAsStringImpl(), getDefaultDiagFunc(), getDiagnostics(), getNullabilityCompletenessCheckFileID(), getShadowedDeclaration(), getShadowedDeclaration(), getShadowedDeclaration(), hasUncompilableErrorOccurred(), ImplicitlyDefineFunction(), clang::InitializationSequence::InitializeFrom(), LookupMemberExpr(), maybeAddDeclWithEffects(), clang::OverloadCandidateSet::NoteCandidates(), clang::TemplateSpecCandidateSet::NoteCandidates(), noteOverloads(), performFunctionEffectAnalysis(), PrintInstantiationStack(), and Sema().

◆ DisableTypoCorrection

bool clang::Sema::DisableTypoCorrection

Tracks whether we are in a context where typo correction is disabled.

Definition at line 9293 of file Sema.h.

Referenced by Sema(), and clang::Sema::TentativeAnalysisScope::TentativeAnalysisScope().

◆ ExcessPrecisionNotSatisfied

std::vector<std::pair<QualType, unsigned> > clang::Sema::ExcessPrecisionNotSatisfied

◆ ExprCleanupObjects

SmallVector<ExprWithCleanups::CleanupObject, 8> clang::Sema::ExprCleanupObjects

ExprCleanupObjects - This is the stack of objects requiring cleanup that are created by the current full expression.

Definition at line 6987 of file Sema.h.

Referenced by ActOnBlockStmtExpr(), ActOnFinishFunctionBody(), BuildBlockForLambdaConversion(), BuildCompoundLiteralExpr(), DiscardCleanupsInEvaluationContext(), MaybeCreateExprWithCleanups(), PopExpressionEvaluationContext(), and PushExpressionEvaluationContext().

◆ ExprEvalContexts

◆ ExternalDeclarations

SmallVector<DeclaratorDecl *, 4> clang::Sema::ExternalDeclarations

All the external declarations encoutered and used in the TU.

Definition at line 3588 of file Sema.h.

Referenced by ActOnEndOfTranslationUnit(), ActOnFunctionDeclarator(), and ActOnUninitializedDecl().

◆ ExternalSource

◆ ExtnameUndeclaredIdentifiers

llvm::DenseMap<IdentifierInfo *, AsmLabelAttr *> clang::Sema::ExtnameUndeclaredIdentifiers

ExtnameUndeclaredIdentifiers - Identifiers contained in #pragma redefine_extname before declared.

Used in Solaris system headers to define functions that occur in multiple standards to call the version in the currently selected standard.

Definition at line 3566 of file Sema.h.

Referenced by ActOnFunctionDeclarator(), ActOnPragmaRedefineExtname(), and ActOnVariableDeclarator().

◆ ExtVectorDecls

ExtVectorDeclsType clang::Sema::ExtVectorDecls

ExtVectorDecls - This is a list all the extended vector types.

This allows us to associate a raw vector type with one of the ext_vector type names. This is only necessary for issuing pretty diagnostics.

Definition at line 4909 of file Sema.h.

Referenced by CheckExtVectorComponent(), and handleExtVectorTypeAttr().

◆ FailedImmediateInvocations

llvm::SmallPtrSet<ConstantExpr *, 4> clang::Sema::FailedImmediateInvocations

◆ FieldCollector

std::unique_ptr<CXXFieldCollector> clang::Sema::FieldCollector

FieldCollector - Collects CXXFieldDecls during parsing of C++ classes.

Definition at line 6519 of file Sema.h.

Referenced by ActOnCXXMemberDeclarator(), ActOnFinishCXXMemberSpecification(), ActOnStartCXXMemberDeclarations(), ActOnTagFinishDefinition(), BuildAnonymousStructOrUnion(), and Sema().

◆ FlagBitsCache

llvm::DenseMap<const EnumDecl *, llvm::APInt> clang::Sema::FlagBitsCache
mutable

A cache of the flags available in enumerations with the flag_bits attribute.

Definition at line 3545 of file Sema.h.

Referenced by IsValueInFlagEnum().

◆ FpPragmaStack

◆ FunctionScopes

◆ FunctionScopesStart

unsigned clang::Sema::FunctionScopesStart = 0

The index of the first FunctionScope that corresponds to the current context.

Definition at line 1228 of file Sema.h.

Referenced by clang::Sema::ContextRAII::ContextRAII(), and getFunctionScopes().

◆ FunctionToSectionMap

llvm::StringMap<std::tuple<StringRef, SourceLocation> > clang::Sema::FunctionToSectionMap

Sections used with #pragma alloc_text.

Definition at line 2090 of file Sema.h.

Referenced by ActOnPragmaMSAllocText(), and AddSectionMSAllocText().

◆ GlobalNewDeleteDeclared

bool clang::Sema::GlobalNewDeleteDeclared

A flag to remember whether the implicit forms of operator new and delete have been declared.

Definition at line 8395 of file Sema.h.

Referenced by DeclareGlobalNewDelete(), and Sema().

◆ IdResolver

◆ ImplicitlyRetainedSelfLocs

llvm::SmallVector<std::pair<SourceLocation, const BlockDecl *>, 1> clang::Sema::ImplicitlyRetainedSelfLocs

List of SourceLocations where 'self' is implicitly retained inside a block.

Definition at line 8347 of file Sema.h.

Referenced by diagnoseImplicitlyRetainedSelf().

◆ ImplicitMSInheritanceAttrLoc

SourceLocation clang::Sema::ImplicitMSInheritanceAttrLoc

Source location for newly created implicit MSInheritanceAttrs.

Definition at line 1810 of file Sema.h.

Referenced by ActOnPragmaMSPointersToMembers(), and assignInheritanceModel().

◆ InstantiatedNonDependentTypes

llvm::DenseSet<QualType> clang::Sema::InstantiatedNonDependentTypes

Non-dependent types used in templates that have already been instantiated by some template instantiation.

Definition at line 13604 of file Sema.h.

◆ InstantiatingSpecializations

llvm::DenseSet<InstantiatingSpecializationsKey> clang::Sema::InstantiatingSpecializations

Specializations whose definitions are currently being instantiated.

Definition at line 13600 of file Sema.h.

Referenced by ~Sema().

◆ InventedParameterInfos

SmallVector<InventedTemplateParameterInfo, 4> clang::Sema::InventedParameterInfos

Stack containing information needed when in C++2a an 'auto' is encountered in a function declaration parameter type specifier in order to invent a corresponding template parameter in the enclosing abbreviated function template.

This information is also present in LambdaScopeInfo, stored in the FunctionScopes stack.

Definition at line 6516 of file Sema.h.

Referenced by ActOnFinishFunctionDeclarationDeclarator(), ActOnStartFunctionDeclarationDeclarator(), GetDeclSpecTypeForDeclarator(), GetFullTypeForDeclarator(), and getInventedParameterInfos().

◆ InventedParameterInfosStart

unsigned clang::Sema::InventedParameterInfosStart = 0

The index of the first InventedParameterInfo that refers to the current context.

Definition at line 3491 of file Sema.h.

Referenced by clang::Sema::ContextRAII::ContextRAII(), and getInventedParameterInfos().

◆ IsBuildingRecoveryCallExpr

bool clang::Sema::IsBuildingRecoveryCallExpr

Flag indicating if Sema is building a recovery call expression.

This flag is used to avoid building recovery call expressions if Sema is already doing so, which would cause infinite recursions.

Definition at line 10082 of file Sema.h.

Referenced by BuildRecoveryCallExpr(), and Sema().

◆ isConstantEvaluatedOverride

bool clang::Sema::isConstantEvaluatedOverride = false

Used to change context to isConstantEvaluated without pushing a heavy ExpressionEvaluationContextRecord object.

Definition at line 2612 of file Sema.h.

Referenced by isAlwaysConstantEvaluatedContext(), and isConstantEvaluatedContext().

◆ IsLastErrorImmediate

bool clang::Sema::IsLastErrorImmediate = true

Is the last error level diagnostic immediate.

This is used to determined whether the next info diagnostic should be immediate.

Definition at line 1349 of file Sema.h.

◆ LangOpts

const LangOptions& clang::Sema::LangOpts

Definition at line 1286 of file Sema.h.

Referenced by ActOnBlockStart(), ActOnBlockStmtExpr(), ActOnCallExpr(), ActOnCaseStmt(), ActOnClassTemplateSpecialization(), ActOnComment(), ActOnCXXDelete(), ActOnCXXTypeid(), ActOnDeclarator(), ActOnDefaultStmt(), ActOnEndOfTranslationUnit(), ActOnEnumBody(), ActOnExplicitInstantiation(), ActOnFields(), ActOnFinishFunctionBody(), ActOnGCCAsmStmt(), ActOnLastBitfield(), actOnOMPReductionKindClause(), ActOnPragmaAttributeAttribute(), ActOnStartOfFunctionDef(), ActOnStartOfLambdaDefinition(), ActOnTag(), ActOnVariableDeclarator(), AddInitializerToDecl(), AnalyzeBitFieldAssignment(), applyCocoaAPICheck(), applyFunctionAttributesBeforeParsingBody(), BuildBuiltinOffsetOf(), BuildCompoundLiteralExpr(), BuildDelegatingInitializer(), BuildLambdaExpr(), BuildOverloadedCallExpr(), BuildPredefinedExpr(), BuiltinAddReference(), BuiltinRemoveReference(), CheckAddressOfOperand(), checkArithmeticOnObjCPointer(), CheckCallingConvAttr(), CheckClassTemplate(), CheckCompareOperands(), CheckConstexprDeclStmt(), checkDeclInTargetContext(), CheckExtensionTraitOperandType(), CheckFieldDecl(), CheckFunctionDeclaration(), CheckFunctionTemplateSpecialization(), clang::checkGenericCastToPtr(), checkMapConflicts(), checkNestingOfRegions(), CheckObjCTraitOperandConstraints(), checkOpenMPIterationSpace(), checkOpenMPLoop(), CheckOverloadedOperatorDeclaration(), CheckParmsForFunctionDef(), CheckShiftOperands(), CheckTemplateArgument(), checkTypeSupport(), CheckVariableDeclarationType(), CheckVectorConditionalTypes(), checkVectorResult(), checkVectorShift(), ComputeSelectedDestructor(), CreateBuiltinArraySubscriptExpr(), CreateGenericSelectionExpr(), DeclareGlobalAllocationFunction(), DefineImplicitCopyAssignment(), DefineImplicitMoveAssignment(), DiagnoseCommaOperator(), clang::Sema::VerifyICEDiagnoser::diagnoseFold(), diagnoseQualifiedDeclaration(), DiagnoseSizeOfParametersAndReturnValue(), DiagnoseUnimplementedAccessor(), DiagnoseUnterminatedPragmaAlignPack(), DiagnoseUseOfDecl(), emitDeferredDiags(), FinalizeDeclaration(), FinalizeDeclaratorGroup(), getEmissionStatus(), getFixItZeroInitializerForType(), getLangOpts(), getLocationOfStringLiteralByte(), getLocForEndOfToken(), getRangeForNextToken(), getScalarZeroExpressionForType(), handleCommonAttr(), handleGlobalAttr(), handleGNUInlineAttr(), handleMSInheritanceAttr(), handleUuidAttr(), ImplicitlyDefineFunction(), isNonNegativeIntegerValue(), isOpenMPDeviceDelayedContext(), IsOverloadOrOverrideImpl(), isVariableCapturable(), LazilyCreateBuiltin(), MarkFunctionReferenced(), MarkVarDeclODRUsed(), MarkVTableUsed(), PerformPendingInstantiations(), PopFunctionScopeInfo(), ProcessAPINotes(), clang::PrintingCodeCompleteConsumer::ProcessCodeCompleteResults(), PushFunctionScope(), rebuildPotentialResultsAsNonOdrUsed(), resetFPOptions(), rewriteBuiltinFunctionDecl(), Sema(), ShouldDeleteSpecialMember(), shouldIgnoreInHostDeviceCheck(), targetDiag(), tryCaptureVariable(), VerifyIntegerConstantExpression(), and warnAboutAmbiguousFunction().

◆ LastEmittedCodeSynthesisContextDepth

unsigned clang::Sema::LastEmittedCodeSynthesisContextDepth = 0

The depth of the context stack at the point when the most recent error or warning was produced.

This value is used to suppress printing of redundant context stacks when there are multiple errors or warnings in the same instantiation.

Definition at line 13636 of file Sema.h.

Referenced by popCodeSynthesisContext(), and PrintContextStack().

◆ LateParsedInstantiations

SmallVector<PendingImplicitInstantiation, 1> clang::Sema::LateParsedInstantiations

Queue of implicit template instantiations that cannot be performed eagerly.

Definition at line 14015 of file Sema.h.

Referenced by ActOnEndOfTranslationUnit(), ActOnEndOfTranslationUnitFragment(), and InstantiateFunctionDefinition().

◆ LateParsedTemplateMap

LateParsedTemplateMapT clang::Sema::LateParsedTemplateMap

Definition at line 11388 of file Sema.h.

Referenced by InstantiateFunctionDefinition(), and MarkAsLateParsedTemplate().

◆ LateTemplateParser

LateTemplateParserCB* clang::Sema::LateTemplateParser

Definition at line 1331 of file Sema.h.

Referenced by InstantiateFunctionDefinition(), Sema(), and SetLateTemplateParser().

◆ LocationOfExcessPrecisionNotSatisfied

SourceLocation clang::Sema::LocationOfExcessPrecisionNotSatisfied

◆ LookupModulesCache

llvm::DenseSet<Module *> clang::Sema::LookupModulesCache

Cache of additional modules that should be used for name lookup within the current template instantiation.

Computed lazily; use getLookupModules() to get a complete set.

Definition at line 13613 of file Sema.h.

Referenced by getLookupModules(), and popCodeSynthesisContext().

◆ MaxAlignmentExponent

const unsigned Sema::MaxAlignmentExponent = 32
static

The maximum alignment, same as in llvm::Value.

We duplicate them here because that allows us not to duplicate the constants in clang code, which we must to since we can't directly use the llvm constants. The value is verified against llvm here: lib/CodeGen/CGDecl.cpp

This is the greatest alignment value supported by load, store, and alloca instructions, and global values.

Definition at line 1214 of file Sema.h.

◆ MaximumAlignment

const uint64_t Sema::MaximumAlignment = 1ull << MaxAlignmentExponent
static

Definition at line 1215 of file Sema.h.

Referenced by AddAlignedAttr(), AddAssumeAlignedAttr(), and checkCall().

◆ MaybeODRUseExprs

◆ MSFunctionNoBuiltins

llvm::SmallSetVector<StringRef, 4> clang::Sema::MSFunctionNoBuiltins

Set of no-builtin functions listed by #pragma function.

Definition at line 2137 of file Sema.h.

Referenced by ActOnPragmaMSFunction(), and AddImplicitMSFunctionNoBuiltinAttr().

◆ MSPointerToMemberRepresentationMethod

LangOptions::PragmaMSPointersToMembersKind clang::Sema::MSPointerToMemberRepresentationMethod

Controls member pointer representation format under the MS ABI.

Definition at line 1805 of file Sema.h.

Referenced by ActOnPragmaMSPointersToMembers(), assignInheritanceModel(), and Sema().

◆ MSPragmaOptimizeIsOn

bool clang::Sema::MSPragmaOptimizeIsOn = true

The "on" or "off" argument passed by #pragma optimize, that denotes whether the optimizations in the list passed to the pragma should be turned off or on.

This boolean is true by default because command line options are honored when #pragma optimize("", on). (i.e. ModifyFnAttributeMSPragmaOptimze() does nothing)

Definition at line 2134 of file Sema.h.

Referenced by ActOnPragmaMSOptimize(), and ModifyFnAttributesMSPragmaOptimize().

◆ MSStructPragmaOn

bool clang::Sema::MSStructPragmaOn

Definition at line 1807 of file Sema.h.

Referenced by ActOnPragmaMSStruct(), AddMsStructLayoutForRecord(), and Sema().

◆ NonInstantiationEntries

unsigned clang::Sema::NonInstantiationEntries

The number of CodeSynthesisContexts that are not template instantiations and, therefore, should not be counted as part of the instantiation depth.

When the instantiation depth reaches the user-configurable limit LangOptions::InstantiationDepth we will abort instantiation.

Definition at line 13628 of file Sema.h.

Referenced by inTemplateInstantiation(), popCodeSynthesisContext(), pushCodeSynthesisContext(), and Sema().

◆ NullabilityMap

FileNullabilityMap clang::Sema::NullabilityMap

A mapping that describes the nullability we've seen in each header file.

Definition at line 15067 of file Sema.h.

Referenced by checkNullabilityConsistency(), and recordNullabilitySeen().

◆ OpaqueParser

void* clang::Sema::OpaqueParser

Definition at line 1332 of file Sema.h.

Referenced by InstantiateFunctionDefinition(), Sema(), and SetLateTemplateParser().

◆ OpenCLFeatures

OpenCLOptions clang::Sema::OpenCLFeatures

Definition at line 1283 of file Sema.h.

Referenced by getOpenCLOptions().

◆ OptimizeOffPragmaLocation

SourceLocation clang::Sema::OptimizeOffPragmaLocation

This represents the last location of a "#pragma clang optimize off" directive if such a directive has not been closed by an "on" yet.

If optimizations are currently "on", this is set to an invalid location.

Definition at line 2121 of file Sema.h.

Referenced by ActOnPragmaOptimize(), AddRangeBasedOptnone(), and getOptimizeOffPragmaLocation().

◆ OriginalLexicalContext

DeclContext* clang::Sema::OriginalLexicalContext

Generally null except when we temporarily switch decl contexts, like in.

See also
SemaObjC::ActOnObjCTemporaryExitContainerContext.

Definition at line 3592 of file Sema.h.

Referenced by ActOnDeclarator(), ActOnFunctionDeclarator(), getCurLexicalContext(), and Sema().

◆ ParseTypeFromStringCallback

std::function<TypeResult(StringRef, StringRef, SourceLocation)> clang::Sema::ParseTypeFromStringCallback

Callback to the parser to parse a type expressed as a string.

Definition at line 1341 of file Sema.h.

Referenced by ApplyAPINotesType(), and ProcessAPINotes().

◆ ParsingInitForAutoVars

llvm::SmallPtrSet<const Decl *, 4> clang::Sema::ParsingInitForAutoVars

ParsingInitForAutoVars - a set of declarations with auto types for which we are currently parsing the initializer.

Definition at line 4661 of file Sema.h.

Referenced by ActOnDecompositionDeclarator(), ActOnEndOfTranslationUnit(), ActOnVariableDeclarator(), CanUseDecl(), checkAttributesAfterMerging(), CheckVarTemplateId(), DiagnoseUseOfDecl(), and FinalizeDeclaration().

◆ PendingExportedNames

llvm::DenseMap<IdentifierInfo *, PendingPragmaInfo> clang::Sema::PendingExportedNames

Definition at line 2333 of file Sema.h.

Referenced by ActOnEndOfTranslationUnit(), ActOnPragmaExport(), and ProcessPragmaExport().

◆ PendingInstantiations

std::deque<PendingImplicitInstantiation> clang::Sema::PendingInstantiations

The queue of implicit template instantiations that are required but have not yet been performed.

Definition at line 14011 of file Sema.h.

Referenced by ActOnEndOfTranslationUnit(), ActOnEndOfTranslationUnitFragment(), DoMarkVarDeclReferenced(), InstantiateFunctionDefinition(), InstantiateVariableDefinition(), MarkFunctionReferenced(), and PerformPendingInstantiations().

◆ PendingLocalImplicitInstantiations

std::deque<PendingImplicitInstantiation> clang::Sema::PendingLocalImplicitInstantiations

The queue of implicit template instantiations that are required and must be performed within the current local scope.

This queue is only used for member functions of local classes in templates, which must be instantiated in the same scope as their enclosing function, so that they can reference function-local types, static variables, enumerators, etc.

Definition at line 14028 of file Sema.h.

Referenced by InstantiateClassMembers(), MarkFunctionReferenced(), and PerformPendingInstantiations().

◆ PP

Preprocessor& clang::Sema::PP

Definition at line 1287 of file Sema.h.

Referenced by ActOnBlockStmtExpr(), ActOnCharacterConstant(), ActOnCXXTypeid(), ActOnEndOfTranslationUnit(), ActOnFinishFunctionBody(), ActOnModuleDecl(), ActOnModuleImport(), ActOnNumericConstant(), ActOnPopScope(), ActOnPragmaFPEvalMethod(), ActOnPragmaFPValueChangingOption(), ActOnPrivateModuleFragmentDecl(), ActOnStringLiteral(), ActOnUnevaluatedStringLiteral(), AddOrdinaryNameResults(), buildCoroutineHandle(), buildCoroutinePromise(), buildMemberCall(), BuildModuleInclude(), BuildNonArrayForRange(), buildStdNoThrowDeclRef(), BuildUsingDeclaration(), buildVarDecl(), CheckCompleteVariableDeclaration(), checkLiteralOperatorId(), CheckPtrComparisonWithNullChar(), checkTupleLikeDecomposition(), CheckVarTemplateId(), clang::CodeCompletionResult::CreateCodeCompletionString(), DeclareGlobalNewDelete(), DefaultVariadicArgumentPromotion(), DiagnoseCommaOperator(), diagnoseMissingConstinit(), diagnoseMissingImport(), DiagnoseSentinelCalls(), DiagnoseUseOfDecl(), EvaluateAsStringImpl(), ExpandFunctionLocalPredefinedMacros(), findFailedBooleanCondition(), findOMPAllocatorHandleT(), findOMPAlloctraitT(), findOMPDependT(), findOMPEventHandleT(), clang::Sema::FPFeaturesStateRAII::FPFeaturesStateRAII(), getCompletionPrintingPolicy(), getDarwinSDKInfoForAvailabilityChecking(), GetFullTypeForDeclarator(), getModuleLoader(), getNullabilityKeyword(), GetOrCreateMSAsmLabel(), getOrCreateStdNamespace(), getPreprocessor(), getPrintingPolicy(), getPrintingPolicy(), getStdTrait(), getTupleLikeElementType(), handleOwnershipAttr(), Initialize(), isMacroDefined(), isStdClassTemplate(), isTupleLike(), LookupBuiltin(), lookupCoroutineHandleType(), lookupCoroutineTraits(), lookupMember(), LookupMemberExpr(), lookupPromiseType(), LookupStdClassTemplate(), LookupStdSourceLocationImpl(), notePreviousDefinition(), Sema(), and UsualUnaryFPConversions().

◆ PragmaAttributeCurrentTargetDecl

const Decl* clang::Sema::PragmaAttributeCurrentTargetDecl

The declaration that is currently receiving an attribute from the #pragma attribute stack.

Definition at line 2116 of file Sema.h.

Referenced by AddPragmaAttributes(), PrintContextStack(), PrintPragmaAttributeInstantiationPoint(), and Sema().

◆ PragmaAttributeStack

◆ PragmaClangBSSSection

PragmaClangSection clang::Sema::PragmaClangBSSSection

Definition at line 1818 of file Sema.h.

Referenced by ActOnPragmaClangSection(), and FinalizeDeclaration().

◆ PragmaClangDataSection

PragmaClangSection clang::Sema::PragmaClangDataSection

Definition at line 1819 of file Sema.h.

Referenced by ActOnPragmaClangSection(), and FinalizeDeclaration().

◆ PragmaClangRelroSection

PragmaClangSection clang::Sema::PragmaClangRelroSection

Definition at line 1821 of file Sema.h.

Referenced by ActOnPragmaClangSection(), and FinalizeDeclaration().

◆ PragmaClangRodataSection

PragmaClangSection clang::Sema::PragmaClangRodataSection

Definition at line 1820 of file Sema.h.

Referenced by ActOnPragmaClangSection(), and FinalizeDeclaration().

◆ PragmaClangTextSection

PragmaClangSection clang::Sema::PragmaClangTextSection

Definition at line 1822 of file Sema.h.

Referenced by ActOnFunctionDeclarator(), and ActOnPragmaClangSection().

◆ PureVirtualClassDiagSet

std::unique_ptr<RecordDeclSetTy> clang::Sema::PureVirtualClassDiagSet

PureVirtualClassDiagSet - a set of class declarations which we have emitted a list of pure virtual functions.

Used to prevent emitting the same list more than once.

Definition at line 6530 of file Sema.h.

Referenced by DiagnoseAbstractType().

◆ RebuildingImmediateInvocation

bool clang::Sema::RebuildingImmediateInvocation = false

Whether the AST is currently being rebuilt to correct immediate invocations.

Immediate invocation candidates and references to consteval functions aren't tracked when this is set.

Definition at line 8189 of file Sema.h.

Referenced by CheckForImmediateInvocation(), HandleImmediateInvocations(), and MarkDeclRefReferenced().

◆ RefsMinusAssignments

llvm::DenseMap<const VarDecl *, int> clang::Sema::RefsMinusAssignments

Increment when we find a reference; decrement when we find an ignored assignment.

Ultimately the value is 0 if every reference is an ignored assignment.

Definition at line 6980 of file Sema.h.

Referenced by ActOnPopScope(), DiagnoseUnusedButSetDecl(), DoMarkVarDeclReferenced(), IgnoredValueConversions(), MarkDeclRefReferenced(), MarkExprReferenced(), MarkFunctionParmPackReferenced(), MarkMemberReferenced(), MarkVariableReferenced(), and MaybeDecrementCount().

◆ SavedPendingInstantiations

SmallVector<std::deque<PendingImplicitInstantiation>, 8> clang::Sema::SavedPendingInstantiations

Definition at line 14019 of file Sema.h.

Referenced by DoMarkVarDeclReferenced().

◆ SavedVTableUses

SmallVector<SmallVector<VTableUse, 16>, 8> clang::Sema::SavedVTableUses

Definition at line 14017 of file Sema.h.

◆ SourceMgr

◆ SpecialMemberCache

llvm::FoldingSet<SpecialMemberOverloadResultEntry> clang::Sema::SpecialMemberCache

A cache of special member function overload resolution results for C++ records.

Definition at line 9339 of file Sema.h.

Referenced by LookupSpecialMember().

◆ SpecialMembersBeingDeclared

llvm::SmallPtrSet<SpecialMemberDecl, 4> clang::Sema::SpecialMembersBeingDeclared

The C++ special members which we are currently in the process of declaring.

If this process recursively triggers the declaration of the same special member, we should act as if it is not yet declared.

Definition at line 6565 of file Sema.h.

◆ StdAlignValT

LazyDeclPtr clang::Sema::StdAlignValT

The C++ "std::align_val_t" enum class, which is defined by the C++ standard library.

Definition at line 8388 of file Sema.h.

Referenced by ActOnTag(), BuildCXXNew(), DeclareGlobalNewDelete(), and getStdAlignValT().

◆ StdBadAlloc

LazyDeclPtr clang::Sema::StdBadAlloc

The C++ "std::bad_alloc" class, which is defined by the C++ standard library.

Definition at line 8384 of file Sema.h.

Referenced by ActOnTag(), DeclareGlobalAllocationFunction(), DeclareGlobalNewDelete(), and getStdBadAlloc().

◆ StdCoroutineTraitsCache

ClassTemplateDecl* clang::Sema::StdCoroutineTraitsCache

The C++ "std::coroutine_traits" template, which is defined in <coroutine_traits>

Definition at line 3167 of file Sema.h.

Referenced by lookupCoroutineTraits(), and Sema().

◆ StdInitializerList

ClassTemplateDecl* clang::Sema::StdInitializerList

The C++ "std::initializer_list" template, which is defined in <initializer_list>.

Definition at line 6545 of file Sema.h.

Referenced by BuildStdInitializerList(), isStdInitializerList(), and Sema().

◆ StdNamespace

LazyDeclPtr clang::Sema::StdNamespace

The C++ "std" namespace, where the standard library resides.

Definition at line 6541 of file Sema.h.

Referenced by ActOnStartNamespaceDef(), ActOnTag(), getOrCreateStdNamespace(), getStdNamespace(), isStdClassTemplate(), and LookupStdClassTemplate().

◆ StdSourceLocationImplDecl

RecordDecl* clang::Sema::StdSourceLocationImplDecl

The C++ "std::source_location::__impl" struct, defined in <source_location>.

Definition at line 8336 of file Sema.h.

Referenced by ActOnSourceLocExpr(), and Sema().

◆ StdTypeIdentity

ClassTemplateDecl* clang::Sema::StdTypeIdentity

The C++ "std::type_identity" template, which is defined in <type_traits>.

Definition at line 6549 of file Sema.h.

Referenced by isStdTypeIdentity(), Sema(), and tryBuildStdTypeIdentity().

◆ StrictGuardStackCheckStack

PragmaStack<bool> clang::Sema::StrictGuardStackCheckStack

Definition at line 2048 of file Sema.h.

Referenced by ActOnFunctionDeclarator(), ActOnPragmaMSStrictGuardStackCheck(), and Sema().

◆ SuppressedDiagnostics

SuppressedDiagnosticsMap clang::Sema::SuppressedDiagnostics

Definition at line 12547 of file Sema.h.

Referenced by DiagnoseUseOfDecl(), and FinishTemplateArgumentDeduction().

◆ TemplateInstCallbacks

std::vector<std::unique_ptr<TemplateInstantiationCallback> > clang::Sema::TemplateInstCallbacks

The template instantiation callbacks to trace or track instantiations (objects can be chained).

This callbacks is used to print, trace or track template instantiations as they are being constructed.

Definition at line 13644 of file Sema.h.

Referenced by clang::TemplightDumpAction::ExecuteAction(), and clang::ParseAST().

◆ TentativeDefinitions

TentativeDefinitionsType clang::Sema::TentativeDefinitions

All the tentative definitions encountered in the TU.

Definition at line 3585 of file Sema.h.

Referenced by ActOnEndOfTranslationUnit(), and ActOnUninitializedDecl().

◆ ThreadSafetyDeclCache

threadSafety::BeforeSet* clang::Sema::ThreadSafetyDeclCache

Definition at line 1327 of file Sema.h.

Referenced by Sema(), and ~Sema().

◆ TUKind

const TranslationUnitKind clang::Sema::TUKind

The kind of translation unit we are processing.

When we're processing a complete translation unit, Sema will perform end-of-translation-unit semantic tasks (such as creating initializers for tentative definitions in C) once parsing has completed. Modules and precompiled headers perform different kinds of checks.

Definition at line 1242 of file Sema.h.

Referenced by ActOnEndOfTranslationUnit(), BuildModuleInclude(), isMainFileLoc(), MarkVTableUsed(), PerformPendingInstantiations(), and Sema().

◆ TUScope

◆ TypoCorrectedFunctionDefinitions

llvm::SmallPtrSet<const NamedDecl *, 4> clang::Sema::TypoCorrectedFunctionDefinitions

The function definitions which were renamed as part of typo-correction to match their respective declarations.

We want to keep track of them to ensure that we don't emit a "redefinition" error if we encounter a correctly named definition after the renamed definition.

Definition at line 3541 of file Sema.h.

Referenced by CheckForFunctionRedefinition(), and MarkTypoCorrectedFunctionDefinition().

◆ TypoCorrectionFailures

IdentifierSourceLocations clang::Sema::TypoCorrectionFailures

A cache containing identifiers for which typo correction failed and their locations, so that repeated attempts to correct an identifier in a given location are ignored if typo correction already failed for it.

Definition at line 9304 of file Sema.h.

◆ TyposCorrected

unsigned clang::Sema::TyposCorrected

The number of typos corrected by CorrectTypo.

Definition at line 9296 of file Sema.h.

Referenced by Sema().

◆ UndefinedButUsed

llvm::MapVector<NamedDecl *, SourceLocation> clang::Sema::UndefinedButUsed

UndefinedInternals - all the used, undefined objects which require a definition in this translation unit.

Definition at line 6557 of file Sema.h.

Referenced by ActOnEndOfTranslationUnit(), CheckImmediateEscalatingFunctionDefinition(), checkUndefinedButUsed(), getUndefinedButUsed(), MarkFunctionReferenced(), MarkVarDeclODRUsed(), MergeFunctionDecl(), and MergeVarDecl().

◆ UnparsedDefaultArgInstantiations

UnparsedDefaultArgInstantiationsMap clang::Sema::UnparsedDefaultArgInstantiations

A mapping from parameters with unparsed default arguments to the set of instantiations of each parameter.

This mapping is a temporary data structure used when parsing nested class templates or nested classes of class templates, where we might end up instantiating an inner class before the default arguments of its methods have been parsed.

Definition at line 13085 of file Sema.h.

Referenced by SetParamDefaultArgument(), and SubstParmVarDecl().

◆ UnparsedDefaultArgLocs

◆ UnsubstitutedConstraintSatisfactionCache

llvm::DenseMap<llvm::FoldingSetNodeID, UnsubstitutedConstraintSatisfactionCacheResult> clang::Sema::UnsubstitutedConstraintSatisfactionCache

Cache the satisfaction of an atomic constraint.

The key is based on the unsubstituted expression and the parameter mapping. This lets us not substituting the mapping more than once, which is (very!) expensive. FIXME: this should be private.

Definition at line 15013 of file Sema.h.

◆ UnusedFileScopedDecls

UnusedFileScopedDeclsType clang::Sema::UnusedFileScopedDecls

The set of file scoped decls seen so far that have not been used and must warn if not used.

Only contains the first declaration.

Definition at line 3578 of file Sema.h.

Referenced by ActOnEndOfTranslationUnit(), and MarkUnusedFileScopedDecl().

◆ UnusedLocalTypedefNameCandidates

llvm::SmallSetVector<const TypedefNameDecl *, 4> clang::Sema::UnusedLocalTypedefNameCandidates

Set containing all typedefs that are likely unused.

Definition at line 3570 of file Sema.h.

Referenced by DiagnoseUnusedDecl(), and emitAndClearUnusedLocalTypedefWarnings().

◆ UnusedPrivateFields

NamedDeclSetType clang::Sema::UnusedPrivateFields

Set containing all declared private fields that are not used.

Definition at line 6523 of file Sema.h.

Referenced by ActOnCXXMemberDeclarator(), ActOnEndOfTranslationUnit(), BuildDeclRefExpr(), BuildFieldReferenceExpr(), and CheckExplicitlyDefaultedFunction().

◆ VAListTagName

DeclarationName clang::Sema::VAListTagName

VAListTagName - The declaration name corresponding to __va_list_tag.

This is used as part of a hack to omit that class from ADL results.

Definition at line 1345 of file Sema.h.

Referenced by Initialize().

◆ VisContext

void* clang::Sema::VisContext

VisContext - Manages the stack for #pragma GCC visibility.

Definition at line 2093 of file Sema.h.

Referenced by AddPushedVisibilityAttribute(), FreeVisContext(), PopPragmaVisibility(), PushPragmaVisibility(), Sema(), and ~Sema().

◆ VisibleNamespaceCache

llvm::DenseMap<NamedDecl *, NamedDecl *> clang::Sema::VisibleNamespaceCache

Map from the most recent declaration of a namespace to the most recent visible declaration of that namespace.

Definition at line 13617 of file Sema.h.

Referenced by ActOnAnnotModuleEnd().

◆ VTablesUsed

llvm::DenseMap<CXXRecordDecl *, bool> clang::Sema::VTablesUsed

The set of classes whose vtables have been used within this translation unit, and a bit that will be true if the vtable is required to be emitted (otherwise, it should be emitted only if needed by code generation).

Definition at line 5882 of file Sema.h.

Referenced by DefineUsedVTables(), LoadExternalVTableUses(), and MarkVTableUsed().

◆ VTableUses

SmallVector<VTableUse, 16> clang::Sema::VTableUses

The list of vtables that are required but have not yet been materialized.

Definition at line 5876 of file Sema.h.

Referenced by DefineUsedVTables(), LoadExternalVTableUses(), and MarkVTableUsed().

◆ VtorDispStack

PragmaStack<MSVtorDispMode> clang::Sema::VtorDispStack

Whether to insert vtordisps prior to virtual bases in the Microsoft C++ ABI.

Possible values are 0, 1, and 2, which mean:

0: Suppress all vtordisps 1: Insert vtordisps in the presence of vbase overrides and non-trivial structors 2: Always insert vtordisps to support RTTI on partially constructed objects

Definition at line 2032 of file Sema.h.

Referenced by ActOnPragmaMSVtorDisp(), AddMsStructLayoutForRecord(), and Sema().

◆ WeakTopLevelDecl

SmallVector<Decl *, 2> clang::Sema::WeakTopLevelDecl

WeakTopLevelDecl - Translation-unit scoped declarations generated by #pragma weak during processing of other Decls.

I couldn't figure out a clean way to generate these in-line, so we store them here and handle separately – which is a hack. It would be best to refactor this.

Definition at line 4897 of file Sema.h.

Referenced by DeclApplyPragmaWeak(), and WeakTopLevelDecls().

◆ WeakUndeclaredIdentifiers

llvm::MapVector< IdentifierInfo *, llvm::SetVector< WeakInfo, llvm::SmallVector<WeakInfo, 1u>, llvm::SmallDenseSet<WeakInfo, 2u, WeakInfo::DenseMapInfoByAliasOnly> > > clang::Sema::WeakUndeclaredIdentifiers

WeakUndeclaredIdentifiers - Identifiers contained in #pragma weak before declared.

Rare. May alias another identifier, declared or undeclared.

For aliases, the target identifier is used as a key for eventual processing when the target is declared. For the single-identifier form, the sole identifier is used as the key. Each entry is a SetVector (ordered by parse order) of aliases (identified by the alias name) in case of multiple aliases to the same undeclared identifier.

Definition at line 3560 of file Sema.h.

Referenced by ActOnEndOfTranslationUnit(), ActOnPragmaWeakAlias(), ActOnPragmaWeakID(), LoadExternalWeakUndeclaredIdentifiers(), and ProcessPragmaWeak().


The documentation for this class was generated from the following files: