14 #ifndef LLVM_CLANG_SEMA_SEMA_H 15 #define LLVM_CLANG_SEMA_SEMA_H 54 #include "llvm/ADT/ArrayRef.h" 55 #include "llvm/ADT/Optional.h" 56 #include "llvm/ADT/SetVector.h" 57 #include "llvm/ADT/SmallBitVector.h" 58 #include "llvm/ADT/SmallPtrSet.h" 59 #include "llvm/ADT/SmallVector.h" 60 #include "llvm/ADT/TinyPtrVector.h" 61 #include "llvm/Frontend/OpenMP/OMPConstants.h" 70 template <
typename ValueT>
struct DenseMapInfo;
71 template <
typename ValueT,
typename ValueInfoT>
class DenseSet;
73 struct InlineAsmIdentifierInfo;
80 class ASTMutationListener;
90 class CXXBindTemporaryExpr;
92 class CXXConstructorDecl;
93 class CXXConversionDecl;
95 class CXXDestructorDecl;
96 class CXXFieldCollector;
97 class CXXMemberCallExpr;
103 class ClassTemplateDecl;
104 class ClassTemplatePartialSpecializationDecl;
105 class ClassTemplateSpecializationDecl;
106 class VarTemplatePartialSpecializationDecl;
107 class CodeCompleteConsumer;
108 class CodeCompletionAllocator;
109 class CodeCompletionTUInfo;
110 class CodeCompletionResult;
111 class CoroutineBodyStmt;
113 class DeclAccessPair;
116 class DeclaratorDecl;
117 class DeducedTemplateArgument;
118 class DependentDiagnostic;
119 class DesignatedInitExpr;
122 class EnumConstantDecl;
128 class FunctionProtoType;
129 class FunctionTemplateDecl;
130 class ImplicitConversionSequence;
133 class InitializationKind;
134 class InitializationSequence;
135 class InitializedEntity;
136 class IntegerLiteral;
140 class LocalInstantiationScope;
145 class MultiLevelTemplateArgumentList;
147 class ObjCCategoryDecl;
148 class ObjCCategoryImplDecl;
149 class ObjCCompatibleAliasDecl;
150 class ObjCContainerDecl;
152 class ObjCImplementationDecl;
153 class ObjCInterfaceDecl;
155 template <
class T>
class ObjCList;
156 class ObjCMessageExpr;
157 class ObjCMethodDecl;
158 class ObjCPropertyDecl;
159 class ObjCProtocolDecl;
160 class OMPThreadPrivateDecl;
161 class OMPRequiresDecl;
162 class OMPDeclareReductionDecl;
163 class OMPDeclareSimdDecl;
165 struct OMPVarListLocTy;
166 struct OverloadCandidate;
169 class OverloadCandidateSet;
174 class PseudoDestructorTypeStorage;
175 class PseudoObjectExpr;
177 class StandardConversionSequence;
181 class TemplateArgument;
182 class TemplateArgumentList;
183 class TemplateArgumentLoc;
185 class TemplateInstantiationCallback;
186 class TemplateParameterList;
187 class TemplatePartialOrderingContext;
188 class TemplateTemplateParmDecl;
192 class TypedefNameDecl;
194 class TypoCorrectionConsumer;
196 class UnresolvedLookupExpr;
197 class UnresolvedMemberExpr;
198 class UnresolvedSetImpl;
199 class UnresolvedSetIterator;
201 class UsingShadowDecl;
204 class VarTemplateSpecializationDecl;
205 class VisibilityAttr;
206 class VisibleDeclConsumer;
207 class IndirectFieldDecl;
208 struct DeductionFailureInfo;
209 class TemplateSpecCandidateSet;
212 class AccessedEntity;
213 class BlockScopeInfo;
215 class CapturedRegionScopeInfo;
216 class CapturingScopeInfo;
217 class CompoundScopeInfo;
218 class DelayedDiagnostic;
219 class DelayedDiagnosticPool;
220 class FunctionScopeInfo;
221 class LambdaScopeInfo;
222 class PossiblyUnreachableDiag;
223 class SemaPPCallbacks;
224 class TemplateDeductionInfo;
227 namespace threadSafety {
234 typedef std::pair<llvm::PointerUnion<const TemplateTypeParmType*, NamedDecl*>,
252 bool SawTypeNullability =
false;
259 llvm::DenseMap<FileID, FileNullability> Map;
270 if (file ==
Cache.File)
271 return Cache.Nullability;
274 if (!
Cache.File.isInvalid()) {
280 Cache.Nullability = Map[file];
281 return Cache.Nullability;
304 llvm::function_ref<
QualType()> ComputeType);
316 if (Tok != ExpectedLoc)
321 return ComputeType();
332 llvm::function_ref<QualType()> ComputeType;
338 void operator=(
const Sema &) =
delete;
341 virtual void anchor();
347 bool isMultiplexExternalSource;
349 static bool mightHaveNonExternalLinkage(
const DeclaratorDecl *FD);
356 bool shouldLinkPossiblyHiddenDecl(
const NamedDecl *Old,
364 "should not have found a non-externally-declarable previous decl");
371 void setupImplicitSpecialMemberType(
CXXMethodDecl *SpecialMem,
462 PSK_Push_Set = PSK_Push | PSK_Set,
463 PSK_Pop_Set = PSK_Pop | PSK_Set,
466 template<
typename ValueType>
473 Slot(llvm::StringRef StackSlotLabel, ValueType Value,
475 : StackSlotLabel(StackSlotLabel), Value(Value),
476 PragmaLocation(PragmaLocation),
477 PragmaPushLocation(PragmaPushLocation) {}
481 llvm::StringRef StackSlotLabel,
499 assert((Action == PSK_Push || Action == PSK_Pop) &&
500 "Can only push / pop #pragma stack sentinels!");
501 Act(CurrentPragmaLocation, Action, Label, CurrentValue);
506 : DefaultValue(Default), CurrentValue(Default) {}
508 bool hasValue()
const {
return CurrentValue != DefaultValue; }
529 static const unsigned kMac68kAlignmentSentinel = ~0U;
631 &ExternalSemaSource::ReadExtVectorDecls, 2, 2>
675 &ExternalSemaSource::ReadTentativeDefinitions, 2, 2>
685 &ExternalSemaSource::ReadUnusedFileScopedDecls, 2, 2>
693 &ExternalSemaSource::ReadDelegatingConstructors, 2, 2>
715 std::unique_ptr<LateParsedTemplate>>
727 LateTemplateParserCleanupCB *LTPCleanup,
729 LateTemplateParser = LTP;
730 LateTemplateParserCleanup = LTPCleanup;
768 state.SavedPool = CurPool;
777 CurPool = state.SavedPool;
784 state.SavedPool = CurPool;
791 assert(CurPool ==
nullptr);
792 CurPool = state.SavedPool;
801 ProcessingContextState SavedContextState;
806 : S(S), SavedContext(S.CurContext),
808 SavedCXXThisTypeOverride(S.CXXThisTypeOverride)
810 assert(ContextToPush &&
"pushing null context");
817 if (!SavedContext)
return;
821 SavedContext =
nullptr;
834 return ExprEvalContexts.back().isConstantEvaluated() ||
835 isConstantEvaluatedOverride;
843 bool PushedCodeSynthesisContext =
false;
847 : S(S), SavedContext(S, DC) {
850 Sema::ExpressionEvaluationContext::PotentiallyEvaluated);
851 if (
auto *FD = dyn_cast<FunctionDecl>(DC))
852 FD->setWillHaveBody(
true);
854 assert(isa<ObjCMethodDecl>(DC));
858 assert(!PushedCodeSynthesisContext);
861 Ctx.
Kind = Sema::CodeSynthesisContext::DefiningSynthesizedFunction;
866 PushedCodeSynthesisContext =
true;
870 if (PushedCodeSynthesisContext)
872 if (
auto *FD = dyn_cast<FunctionDecl>(S.
CurContext))
873 FD->setWillHaveBody(
false);
892 void LoadExternalWeakUndeclaredIdentifiers();
1017 UnevaluatedAbstract,
1027 PotentiallyEvaluated,
1037 PotentiallyEvaluatedIfUsed
1093 unsigned NumCleanupObjects,
1095 Decl *ManglingContextDecl,
1097 : Context(Context), ParentCleanup(ParentCleanup),
1098 NumCleanupObjects(NumCleanupObjects), NumTypos(0),
1099 ManglingContextDecl(ManglingContextDecl), ExprContext(ExprContext) {}
1102 return Context == ExpressionEvaluationContext::Unevaluated ||
1103 Context == ExpressionEvaluationContext::UnevaluatedAbstract ||
1104 Context == ExpressionEvaluationContext::UnevaluatedList;
1107 return Context == ExpressionEvaluationContext::ConstantEvaluated;
1122 std::tuple<MangleNumberingContext *, Decl *>
1123 getCurrentMangleNumberContext(
const DeclContext *DC);
1140 llvm::PointerIntPair<CXXMethodDecl*, 2> Pair;
1145 : Pair(MD, MD->isDeleted() ? NoMemberOrDeleted : Success) {}
1155 :
public llvm::FastFoldingSetNode,
1159 : FastFoldingSetNode(ID)
1185 typedef llvm::DenseMap<ParmVarDecl *, llvm::TinyPtrVector<ParmVarDecl *>>
1208 bool isExternalWithNoLinkageType(
ValueDecl *VD);
1211 void getUndefinedButUsed(
1216 const llvm::MapVector<FieldDecl *, DeleteLocs> &
1217 getMismatchingDeleteExpressions()
const;
1250 typedef llvm::PointerIntPair<CXXRecordDecl *, 3, CXXSpecialMember>
1287 void updateOutOfDateSelector(
Selector Sel);
1290 bool isSelfExpr(
Expr *RExpr);
1296 void EmitCurrentDiagnostic(
unsigned DiagID);
1310 void addImplicitTypedef(StringRef Name,
QualType T);
1312 bool WarnedStackExhausted =
false;
1341 void addExternalSource(ExternalSemaSource *E);
1343 void PrintStats()
const;
1353 llvm::function_ref<
void()> Fn);
1382 if (!isActive())
return;
1401 template<
typename T>
1437 InventAbbreviatedTemplateParameterTypeName(
IdentifierInfo *ParamName,
1440 void emitAndClearUnusedLocalTypedefWarnings();
1454 void ActOnStartOfTranslationUnit();
1455 void ActOnEndOfTranslationUnit();
1458 void CheckDelegatingCtorCycles();
1462 void PushFunctionScope();
1469 void RecordParsingTemplateParameterDepth(
unsigned Depth);
1473 unsigned OpenMPCaptureLevel = 0);
1486 std::unique_ptr<sema::FunctionScopeInfo, PoppedFunctionScopeDeleter>;
1490 const Decl *D =
nullptr,
1494 return FunctionScopes.empty() ? nullptr : FunctionScopes.back();
1499 void setFunctionHasBranchIntoScope();
1500 void setFunctionHasBranchProtectedScope();
1501 void setFunctionHasIndirectGoto();
1503 void PushCompoundScope(
bool IsStmtExpr);
1504 void PopCompoundScope();
1508 bool hasAnyUnrecoverableErrorsInThisFunction()
const;
1523 getCurLambda(
bool IgnoreNonLambdaCapturingScope =
false);
1536 void ActOnStartFunctionDeclarationDeclarator(
Declarator &D,
1537 unsigned TemplateParameterDepth);
1541 void ActOnFinishFunctionDeclarationDeclarator(
Declarator &D);
1558 Expr *ArraySize,
unsigned Quals,
1630 void UpdateExceptionSpec(FunctionDecl *FD,
1633 bool CheckDistantExceptionSpec(
QualType T);
1634 bool CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New);
1635 bool CheckEquivalentExceptionSpec(
1638 bool CheckEquivalentExceptionSpec(
1690 std::tuple<
const Ts &...> Args;
1694 std::index_sequence<Is...>)
const {
1696 bool Dummy[] = {
false, (DB << getPrintable(std::get<Is>(Args)))...};
1703 assert(DiagID != 0 &&
"no diagnostic for type diagnoser");
1708 emit(DB, std::index_sequence_for<Ts...>());
1722 void CheckAddressOfNoDeref(
const Expr *E);
1723 void CheckMemberAccessOfNoDeref(
const MemberExpr *E);
1728 struct ModuleScope {
1731 bool ModuleInterface =
false;
1732 bool ImplicitGlobalModuleFragment =
false;
1739 llvm::SmallPtrSet<const NamespaceDecl*, 8> DeferredExportedNamespaces;
1742 Module *getCurrentModule()
const {
1743 return ModuleScopes.empty() ? nullptr : ModuleScopes.back().Module;
1756 void makeMergedDefinitionVisible(
NamedDecl *ND);
1758 bool isModuleVisible(
const Module *M,
bool ModulePrivate =
false);
1762 return !D->
isHidden() || isVisibleSlow(D);
1769 return isVisible(D) || hasVisibleDeclarationSlow(D, Modules);
1771 bool hasVisibleDeclarationSlow(
const NamedDecl *D,
1774 bool hasVisibleMergedDefinition(
NamedDecl *Def);
1775 bool hasMergedDefinitionInCurrentModule(
NamedDecl *Def);
1779 bool hasStructuralCompatLayout(
Decl *D,
Decl *Suggested);
1784 bool OnlyNeedComplete =
false);
1787 return hasVisibleDefinition(const_cast<NamedDecl*>(D), &Hidden);
1798 bool hasVisibleExplicitSpecialization(
1803 bool hasVisibleMemberSpecialization(
1809 bool isEquivalentInternalLinkageDeclaration(
const NamedDecl *A,
1811 void diagnoseEquivalentInternalLinkageDeclarations(
1818 return !RequireCompleteTypeImpl(Loc, T,
nullptr);
1825 template <
typename... Ts>
1827 const Ts &...Args) {
1829 return RequireCompleteType(Loc, T, Diagnoser);
1832 void completeExprArrayBound(
Expr *E);
1834 bool RequireCompleteExprType(
Expr *E,
unsigned DiagID);
1836 template <
typename... Ts>
1839 return RequireCompleteExprType(E, Diagnoser);
1846 template <
typename... Ts>
1848 const Ts &...Args) {
1850 return RequireLiteralType(Loc, T, Diagnoser);
1855 TagDecl *OwnedTagDecl =
nullptr);
1861 bool AsUnevaluated =
true);
1880 DeclGroupPtrTy ConvertDeclToDeclGroup(
Decl *Ptr,
Decl *OwnedType =
nullptr);
1882 void DiagnoseUseOfUnimplementedSelectors();
1888 bool isClassName =
false,
bool HasTrailingDot =
false,
1890 bool IsCtorOrDtorName =
false,
1891 bool WantNontrivialTypeSourceInfo =
false,
1892 bool IsClassTemplateDeductionContext =
true,
1901 bool IsTemplateName =
false);
1909 bool IsTemplateTypeArg);
2027 assert(Kind == NC_ContextIndependentExpr);
2032 assert(Kind == NC_Type);
2037 assert(Kind == NC_NonType);
2042 assert(Kind == NC_TypeTemplate || Kind == NC_FunctionTemplate ||
2043 Kind == NC_VarTemplate || Kind == NC_Concept ||
2044 Kind == NC_UndeclaredTemplate);
2050 case NC_TypeTemplate:
2052 case NC_FunctionTemplate:
2054 case NC_VarTemplate:
2058 case NC_UndeclaredTemplate:
2061 llvm_unreachable(
"unsupported name classification.");
2088 const Token &NextToken,
2100 bool IsAddressOfOperand);
2106 const Token &NextToken);
2114 TemplateTemplateParam,
2127 if (
auto *DRE = dyn_cast<DeclRefExpr>(E.
get()))
2128 return !DRE->hasExplicitTemplateArgs();
2129 if (
auto *ME = dyn_cast<MemberExpr>(E.
get()))
2130 return !ME->hasExplicitTemplateArgs();
2132 if (
auto *DSDRE = dyn_cast<DependentScopeDeclRefExpr>(E.
get()))
2133 return !DSDRE->hasExplicitTemplateArgs();
2134 if (
auto *DSME = dyn_cast<CXXDependentScopeMemberExpr>(E.
get()))
2135 return !DSME->hasExplicitTemplateArgs();
2154 diagnoseIgnoredQualifiers(
unsigned DiagID,
unsigned Quals,
2162 static bool adjustContextForLocalExternDecl(
DeclContext *&DC);
2163 void DiagnoseFunctionSpecifiers(
const DeclSpec &DS);
2164 NamedDecl *getShadowedDeclaration(
const TypedefNameDecl *D,
2169 void CheckShadow(
Scope *S, VarDecl *D);
2180 llvm::DenseMap<const NamedDecl *, const NamedDecl *> ShadowingDecls;
2184 void handleTagNumbering(
const TagDecl *Tag,
Scope *TagScope);
2185 void setTagNameForLinkagePurposes(
TagDecl *TagFromDeclSpec,
2186 TypedefNameDecl *NewTD);
2187 void CheckTypedefForVariablyModifiedType(
Scope *S, TypedefNameDecl *D);
2203 bool CheckVariableDeclaration(VarDecl *NewVD,
LookupResult &Previous);
2204 void CheckVariableDeclarationType(VarDecl *NewVD);
2205 bool DeduceVariableDeclarationType(VarDecl *VDecl,
bool DirectInit,
2207 void CheckCompleteVariableDeclaration(VarDecl *VD);
2209 void MaybeSuggestAddingStaticToDecl(
const FunctionDecl *D);
2226 bool CheckConstexprFunctionDefinition(
const FunctionDecl *FD,
2235 bool CheckFunctionDeclaration(
Scope *S,
2237 bool IsMemberSpecialization);
2238 bool shouldLinkDependentDeclWithPrevious(
Decl *D,
Decl *OldDecl);
2241 void CheckMain(FunctionDecl *FD,
const DeclSpec &D);
2242 void CheckMSVCRTEntryPoint(FunctionDecl *FD);
2243 Attr *getImplicitCodeSegOrSectionAttrForFunction(
const FunctionDecl *FD,
2254 void ActOnParamDefaultArgument(
Decl *param,
2257 void ActOnParamUnparsedDefaultArgument(
Decl *param,
2296 NTCUK_Destruct = 0x2,
2304 unsigned NonTrivialKind);
2306 void AddInitializerToDecl(
Decl *dcl,
Expr *init,
bool DirectInit);
2307 void ActOnUninitializedDecl(
Decl *dcl);
2308 void ActOnInitializerError(
Decl *Dcl);
2311 void ActOnCXXForRangeDecl(
Decl *D);
2318 void CheckStaticLocalForDllExport(VarDecl *VD);
2319 void FinalizeDeclaration(
Decl *D);
2320 DeclGroupPtrTy FinalizeDeclaratorGroup(
Scope *S,
const DeclSpec &DS,
2326 void ActOnDocumentableDecl(
Decl *D);
2331 void CheckForFunctionRedefinition(
2332 FunctionDecl *FD,
const FunctionDecl *EffectiveDefinition =
nullptr,
2341 void ActOnStartOfObjCMethodDef(
Scope *S,
Decl *D);
2343 return D && isa<ObjCMethodDecl>(D);
2354 bool canDelayFunctionBody(
const Declarator &D);
2363 bool canSkipFunctionBody(
Decl *D);
2367 Decl *ActOnFinishFunctionBody(Decl *Decl,
Stmt *Body,
bool IsInstantiation);
2368 Decl *ActOnSkippedFunctionBody(Decl *Decl);
2369 void ActOnFinishInlineFunctionDef(FunctionDecl *D);
2373 void ActOnFinishDelayedAttribute(Scope *S, Decl *D,
ParsedAttributes &Attrs);
2386 void DiagnoseInvalidJumps(
Stmt *Body);
2387 Decl *ActOnFileScopeAsmDecl(
Expr *
expr,
2404 ModuleIdPath Path,
bool IsFirstDecl);
2409 DeclGroupPtrTy ActOnGlobalModuleFragmentDecl(
SourceLocation ModuleLoc);
2415 DeclGroupPtrTy ActOnPrivateModuleFragmentDecl(
SourceLocation ModuleLoc,
2431 ModuleIdPath Path = {});
2449 void createImplicitModuleImportForErrorRecovery(
SourceLocation Loc,
2458 ExplicitSpecialization,
2459 PartialSpecialization
2472 Decl *ActOnFinishExportDecl(Scope *S, Decl *
ExportDecl,
2488 return getPrintingPolicy(Context, PP);
2497 void ActOnTranslationUnitScope(Scope *S);
2503 bool IsExplicitInstantiation,
2506 Decl *BuildAnonymousStructOrUnion(Scope *S,
DeclSpec &DS,
2511 Decl *BuildMicrosoftCAnonymousStruct(Scope *S,
DeclSpec &DS,
2532 bool isAcceptableTagRedeclaration(
const TagDecl *Previous,
2544 Decl *ActOnTag(Scope *S,
unsigned TagSpec,
TagUseKind TUK,
2550 bool ScopedEnumUsesClassTag,
TypeResult UnderlyingType,
2551 bool IsTypeSpecifier,
bool IsTemplateParamOrArg,
2554 Decl *ActOnTemplatedFriendTag(Scope *S,
SourceLocation FriendLoc,
2581 Expr *BitfieldWidth,
2589 bool Mutable,
Expr *BitfieldWidth,
2595 bool CheckNontrivialField(
FieldDecl *FD);
2603 TAH_ConsiderTrivialABI
2608 bool Diagnose =
false);
2622 : SpecialMember(CXXInvalid),
Comparison(Comp) {}
2630 return isSpecialMember() || isComparison();
2638 static_assert(CXXInvalid > CXXDestructor,
2639 "invalid should have highest index");
2641 "none should be equal to zero");
2669 void ActOnTagStartDefinition(Scope *S, Decl *TagDecl);
2674 bool ActOnDuplicateDefinition(
DeclSpec &DS, Decl *Prev,
2680 SkippedDefinitionContext ActOnTagStartSkippedDefinition(Scope *S, Decl *TD);
2682 Decl *ActOnObjCContainerStartDefinition(Decl *IDecl);
2687 void ActOnStartCXXMemberDeclarations(Scope *S, Decl *TagDecl,
2689 bool IsFinalSpelledSealed,
2694 void ActOnTagFinishDefinition(Scope *S, Decl *TagDecl,
2697 void ActOnTagFinishSkippedDefinition(SkippedDefinitionContext Context);
2699 void ActOnObjCContainerFinishDefinition();
2705 void ActOnObjCTemporaryExitContainerContext(
DeclContext *DC);
2706 void ActOnObjCReenterContainerContext(
DeclContext *DC);
2710 void ActOnTagDefinitionError(Scope *S, Decl *TagDecl);
2718 bool CheckEnumRedeclaration(
SourceLocation EnumLoc,
bool IsScoped,
2719 QualType EnumUnderlyingTy,
bool IsFixed,
2727 Decl *ActOnEnumConstant(Scope *S, Decl *
EnumDecl, Decl *LastEnumConstant,
2739 void PopDeclContext();
2743 void EnterDeclaratorContext(Scope *S,
DeclContext *DC);
2744 void ExitDeclaratorContext(Scope *S);
2747 void ActOnReenterFunctionContext(Scope* S, Decl* D);
2748 void ActOnExitFunctionContext();
2755 FunctionDecl *getCurFunctionDecl();
2765 NamedDecl *getCurFunctionOrMethodDecl();
2768 void PushOnScopeChains(
NamedDecl *D, Scope *S,
bool AddToContext =
true);
2778 bool AllowInlineNamespace =
false);
2782 static Scope *getScopeForDeclContext(Scope *S,
DeclContext *DC);
2787 bool isIncompatibleTypedef(
TypeDecl *Old, TypedefNameDecl *New);
2823 AP_PragmaClangAttribute = 1,
2827 AP_InferredFromOtherPlatform = 2
2834 VersionTuple Introduced, VersionTuple Deprecated,
2835 VersionTuple Obsoleted,
bool IsUnavailable,
2836 StringRef Message,
bool IsStrict, StringRef Replacement,
2838 TypeVisibilityAttr *
2840 TypeVisibilityAttr::VisibilityType Vis);
2842 VisibilityAttr::VisibilityType Vis);
2847 MSInheritanceAttr *mergeMSInheritanceAttr(Decl *D,
2858 AlwaysInlineAttr *mergeAlwaysInlineAttr(Decl *D,
2862 NoSpeculativeLoadHardeningAttr *
2863 mergeNoSpeculativeLoadHardeningAttr(Decl *D,
2864 const NoSpeculativeLoadHardeningAttr &AL);
2865 SpeculativeLoadHardeningAttr *
2866 mergeSpeculativeLoadHardeningAttr(Decl *D,
2867 const SpeculativeLoadHardeningAttr &AL);
2868 OptimizeNoneAttr *mergeOptimizeNoneAttr(Decl *D,
2870 InternalLinkageAttr *mergeInternalLinkageAttr(Decl *D,
const ParsedAttr &AL);
2871 InternalLinkageAttr *mergeInternalLinkageAttr(Decl *D,
2872 const InternalLinkageAttr &AL);
2873 CommonAttr *mergeCommonAttr(Decl *D,
const ParsedAttr &AL);
2874 CommonAttr *mergeCommonAttr(Decl *D,
const CommonAttr &AL);
2876 void mergeDeclAttributes(
NamedDecl *New, Decl *Old,
2878 void MergeTypedefNameDecl(Scope *S, TypedefNameDecl *New,
2880 bool MergeFunctionDecl(FunctionDecl *New,
NamedDecl *&Old, Scope *S,
2881 bool MergeTypeWithOld);
2882 bool MergeCompatibleFunctionDecls(FunctionDecl *New, FunctionDecl *Old,
2883 Scope *S,
bool MergeTypeWithOld);
2885 void MergeVarDecl(VarDecl *New,
LookupResult &Previous);
2886 void MergeVarDeclTypes(VarDecl *New, VarDecl *Old,
bool MergeTypeWithOld);
2887 void MergeVarDeclExceptionSpecs(VarDecl *New, VarDecl *Old);
2888 bool checkVarDeclRedefinition(VarDecl *OldDefn, VarDecl *NewDefn);
2890 bool MergeCXXFunctionDecl(FunctionDecl *New, FunctionDecl *Old, Scope *S);
2902 AA_Passing_CFAudited
2923 bool IsForUsingDecl);
2924 bool IsOverload(FunctionDecl *New, FunctionDecl *Old,
bool IsForUsingDecl,
2925 bool ConsiderCudaAttrs =
true,
2926 bool ConsiderRequiresClauses =
true);
2930 bool SuppressUserConversions,
2932 bool InOverloadResolution,
2934 bool AllowObjCWritebackConversion);
2940 bool InOverloadResolution,
2941 QualType& ConvertedType,
bool &IncompatibleObjC);
2943 QualType& ConvertedType,
bool &IncompatibleObjC);
2950 unsigned *ArgPos =
nullptr);
2956 bool CheckPointerConversion(
Expr *From,
QualType ToType,
2958 CXXCastPath& BasePath,
2959 bool IgnoreBaseAccess,
2960 bool Diagnose =
true);
2962 bool InOverloadResolution,
2964 bool CheckMemberPointerConversion(
Expr *From,
QualType ToType,
2966 CXXCastPath &BasePath,
2967 bool IgnoreBaseAccess);
2969 bool CStyle,
bool &ObjCLifetimeConversion);
2972 bool DiagnoseMultipleUserDefinedConversion(
Expr *From,
QualType ToType);
2976 const VarDecl *NRVOCandidate,
2979 bool AllowNRVO =
true);
2981 bool CanPerformAggregateInitializationForOverloadResolution(
2989 bool TopLevelOfInitList =
false,
2990 bool AllowExplicit =
false);
3026 bool SuppressConversion =
false)
3027 : Suppress(Suppress), SuppressConversion(SuppressConversion) {}
3069 bool AllowScopedEnumerations;
3073 bool Suppress,
bool SuppressConversion)
3075 AllowScopedEnumerations(AllowScopedEnumerations) {}
3082 return diagnoseNotInt(S, Loc, T);
3092 ExprResult PerformContextualImplicitConversion(
3128 void AddOverloadCandidate(FunctionDecl *Function,
DeclAccessPair FoundDecl,
3131 bool SuppressUserConversions =
false,
3132 bool PartialOverloading =
false,
3133 bool AllowExplicit =
true,
3134 bool AllowExplicitConversion =
false,
3136 ConversionSequenceList EarlyConversions = None,
3142 bool SuppressUserConversions =
false,
3143 bool PartialOverloading =
false,
3144 bool FirstArgumentIsBase =
false);
3150 bool SuppressUserConversion =
false,
3158 bool SuppressUserConversions =
false,
3159 bool PartialOverloading =
false,
3160 ConversionSequenceList EarlyConversions = None,
3170 bool SuppressUserConversions =
false,
3171 bool PartialOverloading =
false,
3173 void AddTemplateOverloadCandidate(
3177 bool PartialOverloading =
false,
bool AllowExplicit =
true,
3180 bool CheckNonDependentConversions(
3183 ConversionSequenceList &Conversions,
bool SuppressUserConversions,
3187 void AddConversionCandidate(
3191 bool AllowExplicit,
bool AllowResultConversion =
true);
3192 void AddTemplateConversionCandidate(
3196 bool AllowExplicit,
bool AllowResultConversion =
true);
3203 void AddNonMemberOperatorCandidates(
3213 bool IsAssignmentOperator =
false,
3214 unsigned NumContextualBoolArguments = 0);
3223 bool PartialOverloading =
false);
3226 void NoteOverloadCandidate(
3234 bool TakingAddress =
false);
3239 bool MissingImplicitThis =
false);
3243 std::pair<Expr *, std::string> findFailedBooleanCondition(
Expr *Cond);
3252 bool diagnoseArgDependentDiagnoseIfAttrs(
const FunctionDecl *Function,
3253 const Expr *ThisArg,
3264 bool diagnoseArgIndependentDiagnoseIfAttrs(
const NamedDecl *ND,
3272 bool Complain =
false,
3284 ResolveAddressOfOverloadedFunction(
Expr *AddressOfExpr,
3288 bool *pHadMultipleCandidates =
nullptr);
3293 bool resolveAndFixAddressOfSingleOverloadCandidate(
3294 ExprResult &SrcExpr,
bool DoFunctionPointerConversion =
false);
3297 ResolveSingleFunctionTemplateSpecialization(
OverloadExpr *ovl,
3298 bool Complain =
false,
3301 bool ResolveAndFixSingleFunctionTemplateSpecialization(
3303 bool DoFunctionPointerConverion =
false,
3304 bool Complain =
false,
3307 unsigned DiagIDForComplaining = 0);
3310 Expr *FixOverloadedFunctionReference(
Expr *E,
3320 bool PartialOverloading =
false);
3327 FRS_DiagnosticIssued
3343 bool AllowTypoCorrection=
true,
3344 bool CalleesAddressIsTaken=
false);
3354 Expr *input,
bool RequiresADL =
true);
3364 bool RequiresADL =
true,
3365 bool AllowRewrittenCandidates =
true,
3366 FunctionDecl *DefaultedFn =
nullptr);
3370 FunctionDecl *DefaultedFn);
3377 BuildCallToMemberFunction(Scope *S,
Expr *MemExpr,
3388 bool *NoArrowOperatorFound =
nullptr);
3398 bool CheckParameterNames);
3399 void CheckCXXDefaultArguments(FunctionDecl *FD);
3400 void CheckExtraCXXDefaultArguments(
Declarator &D);
3401 Scope *getNonFieldDeclScope(Scope *S);
3435 LookupOrdinaryName = 0,
3485 NotForRedeclaration = 0,
3492 ForExternalRedeclaration
3500 if (cast<Decl>(CurContext)
3501 ->getOwningModuleForLinkage(
true))
3502 return ForVisibleRedeclaration;
3503 return ForExternalRedeclaration;
3537 typedef std::function<ExprResult(Sema &, TypoExpr *, TypoCorrection)>
3543 struct TypoExprState {
3544 std::unique_ptr<TypoCorrectionConsumer> Consumer;
3545 TypoDiagnosticGenerator DiagHandler;
3548 TypoExprState(TypoExprState &&other) noexcept;
3549 TypoExprState &operator=(TypoExprState &&other) noexcept;
3553 llvm::MapVector<TypoExpr *, TypoExprState> DelayedTypos;
3556 TypoExpr *createDelayedTypo(std::unique_ptr<TypoCorrectionConsumer> TCC,
3557 TypoDiagnosticGenerator TDG,
3564 llvm::MapVector<NamespaceDecl*, bool> KnownNamespaces;
3568 bool LoadedExternalKnownNamespaces;
3573 std::unique_ptr<TypoCorrectionConsumer>
3580 bool ErrorRecovery);
3583 const TypoExprState &getTypoExprState(
TypoExpr *TE)
const;
3586 void clearDelayedTypo(
TypoExpr *TE);
3597 = NotForRedeclaration);
3600 bool AllowBuiltinCreation =
false);
3602 bool InUnqualifiedLookup =
false);
3606 bool AllowBuiltinCreation =
false,
3607 bool EnteringContext =
false);
3610 = NotForRedeclaration);
3621 CXXConstructorDecl *LookupDefaultConstructor(
CXXRecordDecl *Class);
3622 CXXConstructorDecl *LookupCopyingConstructor(
CXXRecordDecl *Class,
3625 bool RValueThis,
unsigned ThisQuals);
3626 CXXConstructorDecl *LookupMovingConstructor(
CXXRecordDecl *Class,
3629 bool RValueThis,
unsigned ThisQuals);
3637 bool AllowStringTemplate,
3638 bool DiagnoseMissing);
3639 bool isKnownName(StringRef name);
3652 bool shouldIgnoreInHostDeviceCheck(FunctionDecl *Callee);
3659 bool IncludeGlobalScope =
true,
3660 bool LoadExternal =
true);
3663 bool IncludeGlobalScope =
true,
3664 bool IncludeDependentBases =
false,
3665 bool LoadExternal =
true);
3678 bool EnteringContext =
false,
3680 bool RecordFailure =
true);
3686 TypoDiagnosticGenerator TDG,
3689 bool EnteringContext =
false,
3707 CorrectDelayedTyposInExpr(
Expr *E, VarDecl *InitDecl =
nullptr,
3714 return CorrectDelayedTyposInExpr(E,
nullptr,
Filter);
3727 return CorrectDelayedTyposInExpr(ER,
nullptr,
Filter);
3732 bool ErrorRecovery =
true);
3737 bool ErrorRecovery =
true);
3739 void MarkTypoCorrectedFunctionDefinition(
const NamedDecl *F);
3741 void FindAssociatedClassesAndNamespaces(
SourceLocation InstantiationLoc,
3743 AssociatedNamespaceSet &AssociatedNamespaces,
3744 AssociatedClassSet &AssociatedClasses);
3747 bool ConsiderLinkage,
bool AllowInlineNamespace);
3758 Scope *S,
bool ForRedeclaration,
3762 void AddKnownFunctionAttributes(FunctionDecl *FD);
3766 void ProcessPragmaWeak(Scope *S, Decl *D);
3768 void ProcessDeclAttributes(Scope *S, Decl *D,
const Declarator &PD);
3770 void ProcessDeclAttributeDelayed(Decl *D,
3773 bool IncludeCXX11Attributes =
true);
3777 void checkUnusedDeclAttributes(
Declarator &D);
3783 bool isValidPointerAttrType(
QualType T,
bool RefOkay =
false);
3785 bool CheckRegparmAttr(
const ParsedAttr &attr,
unsigned &value);
3787 const FunctionDecl *FD =
nullptr);
3788 bool CheckAttrTarget(
const ParsedAttr &CurrAttr);
3789 bool CheckAttrNoArgs(
const ParsedAttr &CurrAttr);
3790 bool checkStringLiteralArgumentAttr(
const ParsedAttr &
Attr,
unsigned ArgNum,
3795 bool checkMSInheritanceAttrOnDefinition(
3799 void CheckAlignasUnderalignment(Decl *D);
3810 bool hasExplicitCallingConv(
QualType T);
3823 bool IsProtocolMethodDecl);
3827 bool IsProtocolMethodDecl);
3833 bool IsProtocolMethodDecl);
3845 void ImplMethodsVsClassMethods(Scope *S,
ObjCImplDecl* IMPDecl,
3847 bool IncompleteImpl =
false);
3851 void DiagnoseUnimplementedProperties(Scope *S,
ObjCImplDecl* IMPDecl,
3853 bool SynthesizeProperties);
3856 void diagnoseNullResettableSynthesizedSetters(
const ObjCImplDecl *impDecl);
3860 void DefaultSynthesizeProperties(Scope *S,
ObjCImplDecl *IMPDecl,
3863 void DefaultSynthesizeProperties(Scope *S, Decl *D,
SourceLocation AtEnd);
3873 void DiagnoseUnusedBackingIvarInAccessor(Scope *S,
3892 const bool isReadWrite,
3893 unsigned &Attributes,
3894 const unsigned AttributesAsWritten,
3910 const bool isReadWrite,
3911 const unsigned Attributes,
3912 const unsigned AttributesAsWritten,
3921 void AtomicPropertySetterGetterRules(
ObjCImplDecl* IMPDecl,
3926 void DiagnoseMissingDesignatedInitOverrides(
3945 void MatchAllMethodDeclarations(
const SelectorSet &InsMap,
3946 const SelectorSet &ClsMap,
3947 SelectorSet &InsMapSeen,
3948 SelectorSet &ClsMapSeen,
3951 bool &IncompleteImpl,
3952 bool ImmediateClass,
3953 bool WarnCategoryMethodImpl=
false);
3964 LangAS getDefaultCXXMethodAddrSpace()
const;
3969 void AddMethodToGlobalPool(
ObjCMethodDecl *Method,
bool impl,
bool instance);
3974 bool receiverIdOrClass,
3984 CollectMultipleMethodsInGlobalPool(
Selector Sel,
3986 bool InstanceFirst,
bool CheckTheOther,
3997 bool receiverIdOrClass);
4009 bool RecordFailure =
true) {
4011 TypoCorrectionFailures[Typo].insert(TypoLoc);
4021 AddMethodToGlobalPool(Method, impl,
true);
4026 AddMethodToGlobalPool(Method, impl,
false);
4031 void AddAnyMethodToGlobalPool(Decl *D);
4036 bool receiverIdOrClass=
false) {
4037 return LookupMethodInGlobalPool(Sel, R, receiverIdOrClass,
4044 bool receiverIdOrClass=
false) {
4045 return LookupMethodInGlobalPool(Sel, R, receiverIdOrClass,
4093 ActOnFinishFullExpr(Arg, CC,
false).
get());
4106 bool HasLeadingEmptyMacro =
false);
4108 void ActOnStartOfCompoundStmt(
bool IsStmtExpr);
4109 void ActOnFinishOfCompoundStmt();
4121 S.ActOnFinishOfCompoundStmt();
4140 StmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
4143 void ActOnForEachDeclStmt(DeclGroupPtrTy Decl);
4149 void ActOnCaseStmtBody(Stmt *
CaseStmt, Stmt *SubStmt);
4153 Stmt *SubStmt, Scope *CurScope);
4174 Stmt *Switch, Stmt *Body);
4191 Stmt *First,
Expr *collection,
4193 StmtResult FinishObjCForCollectionStmt(Stmt *ForCollection, Stmt *Body);
4217 Stmt *RangeDecl, Stmt *
Begin, Stmt *
End,
4222 StmtResult FinishCXXForRangeStmt(Stmt *ForRange, Stmt *Body);
4233 void ActOnCapturedRegionStart(
SourceLocation Loc, Scope *CurScope,
4236 void ActOnCapturedRegionStart(
SourceLocation Loc, Scope *CurScope,
4239 unsigned OpenMPCaptureLevel = 0);
4241 void ActOnCapturedRegionError();
4244 unsigned NumParams);
4248 CES_AllowParameters = 1,
4249 CES_AllowDifferentTypes = 2,
4250 CES_AllowExceptionVariables = 4,
4251 CES_FormerDefault = (CES_AllowParameters),
4252 CES_Default = (CES_AllowParameters | CES_AllowDifferentTypes),
4253 CES_AsIfByStdMove = (CES_AllowParameters | CES_AllowDifferentTypes |
4254 CES_AllowExceptionVariables),
4257 VarDecl *getCopyElisionCandidate(
QualType ReturnType,
Expr *E,
4259 bool isCopyElisionCandidate(
QualType ReturnType,
const VarDecl *VD,
4268 bool IsVolatile,
unsigned NumOutputs,
4275 void FillInlineAsmIdentifierInfo(
Expr *Res,
4276 llvm::InlineAsmIdentifierInfo &Info);
4280 bool IsUnevaluatedContext);
4281 bool LookupInlineAsmField(StringRef
Base, StringRef Member,
4283 ExprResult LookupInlineAsmVarDeclField(
Expr *RefExpr, StringRef Member,
4287 StringRef AsmString,
4288 unsigned NumOutputs,
unsigned NumInputs,
4293 LabelDecl *GetOrCreateMSAsmLabel(StringRef ExternalLabelName,
4300 bool Invalid =
false);
4302 Decl *ActOnObjCExceptionDecl(Scope *S,
Declarator &D);
4305 Decl *Parm, Stmt *Body);
4323 VarDecl *BuildExceptionDeclaration(Scope *S,
TypeSourceInfo *TInfo,
4328 Decl *ActOnExceptionDeclarator(Scope *S,
Declarator &D);
4331 Decl *ExDecl, Stmt *HandlerBlock);
4341 void ActOnStartSEHFinallyBlock();
4342 void ActOnAbortSEHFinallyBlock();
4346 void DiagnoseReturnInConstructorExceptionHandler(
CXXTryStmt *TryBlock);
4348 bool ShouldWarnIfUnusedFileScopedDecl(
const DeclaratorDecl *D)
const;
4352 void MarkUnusedFileScopedDecl(
const DeclaratorDecl *D);
4356 void DiagnoseUnusedExprResult(
const Stmt *S);
4357 void DiagnoseUnusedNestedTypedefs(
const RecordDecl *D);
4358 void DiagnoseUnusedDecl(
const NamedDecl *ND);
4372 void DiagnoseEmptyLoopBody(
const Stmt *S,
4373 const Stmt *PossibleBody);
4376 void DiagnoseSelfMove(
const Expr *LHSExpr,
const Expr *RHSExpr,
4381 void diagnoseNullableToNonnullConversion(
QualType DstType,
QualType SrcType,
4385 void diagnoseZeroToNullptrConversion(
CastKind Kind,
const Expr *E);
4390 void PopParsingDeclaration(ParsingDeclState
state, Decl *
decl);
4394 ParsingClassDepth++;
4398 ParsingClassDepth--;
4406 bool ObjCPropertyAccess,
4407 bool AvoidPartialAvailabilityChecks =
false,
4411 UnavailableAttr::ImplicitReason reason);
4414 void DiagnoseUnguardedAvailabilityViolations(Decl *FD);
4419 bool CanUseDecl(
NamedDecl *D,
bool TreatUnavailableAsInvalid);
4422 bool ObjCPropertyAccess =
false,
4423 bool AvoidPartialAvailabilityChecks =
false,
4425 void NoteDeletedFunction(FunctionDecl *FD);
4426 void NoteDeletedInheritingConstructor(CXXConstructorDecl *CD);
4433 void PushExpressionEvaluationContext(
4436 ExpressionEvaluationContextRecord::EK_Other);
4438 void PushExpressionEvaluationContext(
4441 ExpressionEvaluationContextRecord::EK_Other);
4442 void PopExpressionEvaluationContext();
4444 void DiscardCleanupsInEvaluationContext();
4450 void CheckUnusedVolatileAssignment(
Expr *E);
4466 void MarkAnyDeclReferenced(
SourceLocation Loc, Decl *D,
bool MightBeOdrUse);
4467 void MarkFunctionReferenced(
SourceLocation Loc, FunctionDecl *Func,
4468 bool MightBeOdrUse =
true);
4474 unsigned CapturingScopeIndex);
4477 void CleanupVarDeclMarking();
4520 const unsigned *
const FunctionScopeIndexToStopAt);
4538 void MarkDeclarationsReferencedInExpr(
Expr *E,
4539 bool SkipLocalVariables =
false);
4545 bool ForceComplain =
false,
4546 bool (*IsPlausibleResult)(
QualType) =
nullptr);
4549 bool tryExprAsCall(
Expr &E,
QualType &ZeroArgCallReturnTy,
4559 bool DiagRuntimeBehavior(
SourceLocation Loc,
const Stmt *Statement,
4571 UnqualifiedId &Id,
bool HasTrailingLParen,
bool IsAddressOfOperand,
4573 bool IsInlineAsmIdentifier =
false,
Token *KeywordReplacement =
nullptr);
4592 bool AllowBuiltinCreation=
false);
4597 bool isAddressOfOperand,
4623 BuildAnonymousStructUnionMemberReference(
4628 Expr *baseObjectExpr =
nullptr,
4640 bool IsDefiniteInstance,
4642 bool UseArgumentDependentLookup(
const CXXScopeSpec &SS,
4644 bool HasTrailingLParen);
4649 bool IsAddressOfOperand,
const Scope *S,
4660 bool AcceptInvalidDecl =
false);
4665 bool AcceptInvalidDecl =
false);
4682 Scope *UDLScope =
nullptr);
4691 Scope *UDLScope =
nullptr);
4696 Expr *ControllingExpr,
4702 Expr *ControllingExpr,
4714 bool isQualifiedMemberAccess(
Expr *E);
4726 bool IsType,
void *TyOrEx,
4730 bool CheckVecStepExpr(
Expr *E);
4736 ExprResult ActOnSizeofParameterPackExpr(Scope *S,
4778 bool SuppressQualifierCheck =
false,
4789 bool CheckQualifiedMemberReference(
Expr *BaseExpr,
QualType BaseType,
4813 bool HadMultipleCandidates,
4821 bool HadMultipleCandidates,
4826 void ActOnDefaultCtorInitializers(Decl *CDtorDecl);
4828 FunctionDecl *FDecl,
4832 bool ExecConfig =
false);
4835 const Expr *ArgExpr);
4842 Expr *ExecConfig =
nullptr);
4845 Expr *ExecConfig =
nullptr,
4846 bool IsExecConfig =
false);
4856 Expr *Config =
nullptr,
bool IsExecConfig =
false,
4877 ExprResult MaybeConvertParenListExprToParenExpr(Scope *S,
Expr *ME);
4925 void ActOnStartStmtExpr();
4930 void ActOnStmtExprError();
4979 bool CheckCaseExpression(
Expr *E);
4998 CheckMicrosoftIfExistsSymbol(Scope *S,
CXXScopeSpec &SS,
5002 CheckMicrosoftIfExistsSymbol(Scope *S,
SourceLocation KeywordLoc,
5073 llvm::SmallBitVector FullyCheckedComparisonCategories;
5084 OperatorInExpression,
5113 bool isInitListConstructor(
const FunctionDecl *Ctor);
5115 Decl *ActOnUsingDirective(Scope *CurScope,
SourceLocation UsingLoc,
5123 Decl *ActOnNamespaceAliasDef(Scope *CurScope,
5140 bool HasTypenameKeyword,
5158 bool CheckInheritingConstructorUsingDecl(
UsingDecl *UD);
5163 CXXConstructorDecl *
5164 findInheritingConstructor(
SourceLocation Loc, CXXConstructorDecl *BaseCtor,
5186 bool HadMultipleCandidates,
bool IsListInitialization,
5187 bool IsStdInitListInitialization,
5188 bool RequiresZeroInit,
unsigned ConstructKind,
5195 CXXConstructorDecl *Constructor,
bool Elidable,
5197 bool HadMultipleCandidates,
bool IsListInitialization,
5198 bool IsStdInitListInitialization,
5199 bool RequiresZeroInit,
unsigned ConstructKind,
5207 CXXConstructorDecl *Constructor,
bool Elidable,
5209 bool IsListInitialization,
5210 bool IsStdInitListInitialization,
bool RequiresZeroInit,
5218 bool CheckCXXDefaultArgExpr(
SourceLocation CallLoc, FunctionDecl *FD,
5229 void FinalizeVarWithDestructor(VarDecl *VD,
const RecordType *DeclInitType);
5243 llvm::SmallPtrSet<CanQualType, 4> ExceptionsSeen;
5246 void ClearExceptions() {
5247 ExceptionsSeen.clear();
5261 "noexcept(expr) should not be a possible result");
5266 unsigned size()
const {
return Exceptions.size(); }
5278 void CalledStmt(Stmt *S);
5284 ESI.
Type = getExceptionSpecType();
5293 tok::kw_false).
get();
5315 ComputeDefaultedCopyAssignmentExceptionSpec(
CXXMethodDecl *MD);
5325 ComputeDefaultedMoveAssignmentExceptionSpec(
CXXMethodDecl *MD);
5336 CXXConstructorDecl *CD);
5340 void EvaluateImplicitExceptionSpec(
SourceLocation Loc, FunctionDecl *FD);
5349 void checkExceptionSpecification(
bool IsTopLevel,
5359 bool isLibstdcxxEagerExceptionSpecHack(
const Declarator &D);
5364 void actOnDelayedExceptionSpecification(Decl *Method,
5369 Expr *NoexceptExpr);
5377 bool Diagnose =
false);
5380 void DiagnoseDeletedDefaultedFunction(FunctionDecl *FD);
5388 CXXConstructorDecl *DeclareImplicitDefaultConstructor(
5393 void DefineImplicitDefaultConstructor(
SourceLocation CurrentLocation,
5394 CXXConstructorDecl *Constructor);
5417 CXXConstructorDecl *Constructor);
5425 CXXConstructorDecl *DeclareImplicitCopyConstructor(
CXXRecordDecl *ClassDecl);
5429 void DefineImplicitCopyConstructor(
SourceLocation CurrentLocation,
5430 CXXConstructorDecl *Constructor);
5439 CXXConstructorDecl *DeclareImplicitMoveConstructor(
CXXRecordDecl *ClassDecl);
5443 void DefineImplicitMoveConstructor(
SourceLocation CurrentLocation,
5444 CXXConstructorDecl *Constructor);
5455 void DefineImplicitCopyAssignment(
SourceLocation CurrentLocation,
5468 void DefineImplicitMoveAssignment(
SourceLocation CurrentLocation,
5473 void ForceDeclarationOfImplicitMembers(
CXXRecordDecl *Class);
5476 void CheckImplicitSpecialMemberDeclaration(Scope *S, FunctionDecl *FD);
5480 bool isImplicitlyDeleted(FunctionDecl *FD);
5486 bool checkThisInStaticMemberFunctionType(
CXXMethodDecl *Method);
5490 bool checkThisInStaticMemberFunctionExceptionSpec(
CXXMethodDecl *Method);
5496 bool checkThisInStaticMemberFunctionAttributes(
CXXMethodDecl *Method);
5503 bool CompleteConstructorCall(CXXConstructorDecl *Constructor,
5507 bool AllowExplicit =
false,
5508 bool IsListInitialization =
false);
5516 bool EnteringContext);
5521 bool EnteringContext);
5627 bool Enabled =
true);
5647 bool CheckCXXThisCapture(
SourceLocation Loc,
bool Explicit =
false,
5648 bool BuildAndDiagnose =
true,
5649 const unsigned *
const FunctionScopeIndexToStopAt =
nullptr,
5650 bool ByCopy =
false);
5655 bool isThisOutsideMemberFunctionBody(
QualType BaseType);
5674 bool IsThrownVarInScope);
5685 bool ListInitialization);
5691 bool ListInitialization);
5713 bool isUnavailableAlignedAllocationFunction(
const FunctionDecl &FD)
const;
5717 void diagnoseUnavailableAlignedAllocation(
const FunctionDecl &FD,
5742 FunctionDecl *&OperatorNew,
5743 FunctionDecl *&OperatorDelete,
5744 bool Diagnose =
true);
5745 void DeclareGlobalNewDelete();
5751 bool Diagnose =
true);
5752 FunctionDecl *FindUsualDeallocationFunction(
SourceLocation StartLoc,
5753 bool CanProvideSize,
5756 FunctionDecl *FindDeallocationFunctionForDestructor(
SourceLocation StartLoc,
5761 bool UseGlobal,
bool ArrayForm,
5764 bool IsDelete,
bool CallCanBeVirtual,
5765 bool WarnOnNonAbstractTypes,
5807 ExprResult ActOnStartCXXMemberReference(Scope *S,
5812 bool &MayBePseudoDestructor);
5841 Expr *MaybeCreateExprWithCleanups(
Expr *SubExpr);
5842 Stmt *MaybeCreateStmtWithCleanups(Stmt *SubStmt);
5846 CreateMaterializeTemporaryExpr(
QualType T,
Expr *Temporary,
5847 bool BoundToLvalueReference);
5850 return ActOnFinishFullExpr(
5854 bool DiscardedValue,
bool IsConstexpr =
false);
5862 bool EnteringContext =
false);
5863 bool isDependentScopeSpecifier(
const CXXScopeSpec &SS);
5889 bool isAcceptableNestedNameSpecifier(
const NamedDecl *SD,
5890 bool *CanCorrect =
nullptr);
5912 : ObjectType(ObjectType), Identifier(II), IdentifierLoc(IdLoc),
5913 CCLoc(ColonColonLoc) {
5918 : ObjectType(
ParsedType::make(ObjectType)), Identifier(II),
5919 IdentifierLoc(IdLoc), CCLoc(ColonColonLoc) {
5923 bool isNonTypeNestedNameSpecifier(Scope *S,
CXXScopeSpec &SS,
5926 bool BuildCXXNestedNameSpecifier(Scope *S,
5928 bool EnteringContext,
5931 bool ErrorRecoveryLookup,
5932 bool *IsCorrectedToColon =
nullptr,
5933 bool OnlyNamespace =
false);
5960 bool ActOnCXXNestedNameSpecifier(Scope *S,
5962 bool EnteringContext,
5964 bool ErrorRecoveryLookup =
false,
5965 bool *IsCorrectedToColon =
nullptr,
5966 bool OnlyNamespace =
false);
5970 bool ActOnCXXNestedNameSpecifierDecltype(
CXXScopeSpec &SS,
5974 bool IsInvalidUnlessNestedName(Scope *S,
CXXScopeSpec &SS,
5976 bool EnteringContext);
6001 bool ActOnCXXNestedNameSpecifier(Scope *S,
6004 TemplateTy TemplateName,
6010 bool EnteringContext);
6020 void *SaveNestedNameSpecifierAnnotation(
CXXScopeSpec &SS);
6032 void RestoreNestedNameSpecifierAnnotation(
void *Annotation,
6036 bool ShouldEnterDeclaratorScope(Scope *S,
const CXXScopeSpec &SS);
6044 bool ActOnCXXEnterDeclaratorScope(Scope *S,
CXXScopeSpec &SS);
6051 void ActOnCXXExitDeclaratorScope(Scope *S,
const CXXScopeSpec &SS);
6058 void ActOnCXXEnterDeclInitializer(Scope *S, Decl *Dcl);
6062 void ActOnCXXExitDeclInitializer(Scope *S, Decl *Dcl);
6067 bool KnownDependent,
6077 Expr *TrailingRequiresClause);
6080 void handleLambdaNumbering(
6082 Optional<std::tuple<unsigned, bool, Decl *>> Mangling = None);
6090 bool ExplicitParams,
6091 bool ExplicitResultType,
6100 return ParsedType::make(buildLambdaInitCaptureInitialization(
6101 Loc, ByRef, EllipsisLoc, None, Id,
6102 InitKind != LambdaCaptureInitKind::CopyInit, Init));
6104 QualType buildLambdaInitCaptureInitialization(
6118 unsigned InitStyle, Expr *Init);
6129 void ActOnLambdaExplicitTemplateParameterList(
SourceLocation LAngleLoc,
6134 void addLambdaParameters(
6152 bool IsInstantiation =
false);
6164 bool DiagnoseUnusedLambdaCapture(
SourceRange CaptureRange,
6173 bool IsOpenMPMapping =
false);
6192 void DefineImplicitLambdaToFunctionPointerConversion(
6202 void DefineImplicitLambdaToBlockPointerConversion(
SourceLocation CurrentLoc,
6214 bool CheckConstraintExpression(Expr *CE,
Token NextToken =
Token(),
6215 bool *PossibleNonPrimary =
nullptr,
6216 bool IsTrailingRequiresClause =
false);
6221 bool IsDependentFunctionNameExpr(Expr *E);
6227 llvm::DenseMap<std::pair<NamedDecl *, NamedDecl *>,
bool> SubsumptionCache;
6232 llvm::DenseMap<NamedDecl *, NormalizedConstraint *>
6235 llvm::ContextualFoldingSet<ConstraintSatisfaction, const ASTContext &>
6240 getNormalizedAssociatedConstraints(
6259 bool MaybeEmitAmbiguousAtomicConstraintsDiagnostic(
NamedDecl *D1,
6297 bool CheckFunctionConstraints(
const FunctionDecl *FD,
6315 bool EnsureTemplateArgumentListConstraints(
TemplateDecl *Template,
6335 void DiagnoseUnsatisfiedIllFormedConstraint(
SourceLocation DiagnosticLocation,
6375 bool HadMultipleCandidates);
6389 bool WarnMultipleSelectors);
6402 Decl *ActOnStartLinkageSpecification(Scope *S,
6406 Decl *ActOnFinishLinkageSpecification(Scope *S,
6429 void ActOnStartCXXInClassMemberInitializer();
6430 void ActOnFinishCXXInClassMemberInitializer(Decl *VarDecl,
6480 bool SetDelegatingInitializer(CXXConstructorDecl *Constructor,
6483 bool SetCtorInitializers(CXXConstructorDecl *Constructor,
bool AnyErrors,
6498 typedef std::pair<CXXRecordDecl*, SourceLocation>
VTableUse;
6511 void LoadExternalVTableUses();
6516 bool DefinitionRequired =
false);
6526 bool ConstexprOnly =
false);
6533 bool DefineUsedVTables();
6535 void AddImplicitlyDeclaredMembersToClass(
CXXRecordDecl *ClassDecl);
6537 void ActOnMemInitializers(Decl *ConstructorDecl,
6548 void referenceDLLExportedClassMethods();
6550 void propagateDLLAttrToBaseClassTemplate(
6564 void inferGslPointerAttribute(TypedefNameDecl *TD);
6566 void CheckCompletedCXXClass(Scope *S,
CXXRecordDecl *Record);
6572 void ActOnFinishCXXMemberSpecification(Scope *S,
SourceLocation RLoc,
6576 void ActOnFinishCXXMemberDecls();
6577 void ActOnFinishCXXNonNestedClass();
6579 void ActOnReenterCXXMethodParameter(Scope *S,
ParmVarDecl *Param);
6580 unsigned ActOnReenterTemplateScope(Scope *S, Decl *Template);
6581 void ActOnStartDelayedMemberDeclarations(Scope *S, Decl *Record);
6582 void ActOnStartDelayedCXXMethodDeclaration(Scope *S, Decl *Method);
6583 void ActOnDelayedCXXMethodParameter(Scope *S, Decl *Param);
6584 void ActOnFinishDelayedMemberDeclarations(Scope *S, Decl *Record);
6585 void ActOnFinishDelayedCXXMethodDeclaration(Scope *S, Decl *Method);
6586 void ActOnFinishDelayedMemberInitializers(Decl *Record);
6587 void MarkAsLateParsedTemplate(FunctionDecl *FD, Decl *FnD,
6589 void UnmarkAsLateParsedTemplate(FunctionDecl *FD);
6590 bool IsInsideALocalClassWithinATemplateFunction();
6592 Decl *ActOnStaticAssertDeclaration(
SourceLocation StaticAssertLoc,
6594 Expr *AssertMessageExpr,
6596 Decl *BuildStaticAssertDeclaration(
SourceLocation StaticAssertLoc,
6605 Decl *ActOnFriendTypeDecl(Scope *S,
const DeclSpec &DS,
6612 void CheckConstructor(CXXConstructorDecl *Constructor);
6623 void CheckExplicitlyDefaultedFunction(Scope *S, FunctionDecl *MD);
6625 bool CheckExplicitlyDefaultedSpecialMember(
CXXMethodDecl *MD,
6627 void CheckDelayedMemberExceptionSpecs();
6629 bool CheckExplicitlyDefaultedComparison(Scope *S, FunctionDecl *MD,
6633 void DefineDefaultedComparison(
SourceLocation Loc, FunctionDecl *FD,
6647 BaseResult ActOnBaseSpecifier(Decl *classdecl,
6657 void ActOnBaseSpecifiers(Decl *ClassDecl,
6669 CXXCastPath *BasePath =
nullptr,
6670 bool IgnoreAccess =
false);
6672 unsigned InaccessibleBaseID,
6673 unsigned AmbigiousBaseConvID,
6676 CXXCastPath *BasePath,
6677 bool IgnoreAccess =
false);
6679 std::string getAmbiguousPathsDisplayString(
CXXBasePaths &Paths);
6681 bool CheckOverridingFunctionAttributes(
const CXXMethodDecl *New,
6686 bool CheckOverridingFunctionReturnType(
const CXXMethodDecl *New,
6691 bool CheckOverridingFunctionExceptionSpec(
const CXXMethodDecl *New,
6697 void CheckOverrideControl(
NamedDecl *D);
6701 void DiagnoseAbsenceOfOverrideControl(
NamedDecl *D);
6706 bool CheckIfOverriddenFunctionIsMarkedFinal(
const CXXMethodDecl *New,
6721 bool SetMemberAccessSpecifier(
NamedDecl *MemberDecl,
6733 bool Diagnose =
true);
6735 CXXConstructorDecl *D,
6738 bool IsCopyBindingRefToTemp =
false);
6740 CXXConstructorDecl *D,
6766 bool ForceCheck =
false,
6767 bool ForceUnprivileged =
false);
6771 bool isMemberAccessibleForDeletion(
CXXRecordDecl *NamingClass,
6778 return isMemberAccessibleForDeletion(NamingClass, Found, ObjectType,
6784 void PerformDependentDiagnostics(
const DeclContext *Pattern,
6807 template <
typename... Ts>
6809 const Ts &...Args) {
6811 return RequireNonAbstractType(Loc, T, Diagnoser);
6820 bool CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl);
6822 bool CheckLiteralOperatorDeclaration(FunctionDecl *FnDecl);
6828 bool AllowFunctionTemplates =
true,
6829 bool AllowDependent =
true);
6831 bool AllowFunctionTemplates =
true,
6832 bool AllowDependent =
true,
6833 bool AllowNonTemplateFunctions =
false);
6842 bool AllowFunctionTemplates =
true,
6843 bool AllowDependent =
true);
6855 QualType ObjectType,
bool EnteringContext,
6856 bool &MemberOfUnknownSpecialization,
6862 bool hasTemplateKeyword,
6865 bool EnteringContext,
6866 TemplateTy &Template,
6867 bool &MemberOfUnknownSpecialization);
6874 void ActOnUndeclaredTypeTemplateName(Scope *S, TemplateTy &Name,
6879 bool resolveAssumedTemplateNameAsType(Scope *S, TemplateName &Name,
6881 bool Diagnose =
true);
6893 TemplateTy &SuggestedTemplate,
6896 bool DiagnoseUninstantiableTemplate(
SourceLocation PointOfInstantiation,
6898 bool InstantiatedFromMember,
6902 bool Complain =
true);
6904 void DiagnoseTemplateParameterShadow(
SourceLocation Loc, Decl *PrevDecl);
6907 NamedDecl *ActOnTypeParameter(Scope *S,
bool Typename,
6912 unsigned Depth,
unsigned Position,
6914 ParsedType DefaultArg,
bool HasTypeConstraint);
6941 NamedDecl *ActOnTemplateTemplateParameter(Scope *S,
6953 ActOnTemplateParameterList(
unsigned Depth,
6959 Expr *RequiresClause);
6970 TPC_TypeAliasTemplate
6981 bool IsFriend,
bool &IsMemberSpecialization,
bool &Invalid,
6982 bool SuppressDiagnostic =
false);
7008 void NoteAllFoundTemplates(TemplateName Name);
7010 QualType CheckTemplateIdType(TemplateName Template,
7019 bool IsCtorOrDtorName =
false,
bool IsClassName =
false);
7028 TemplateTy TemplateD,
7057 void diagnoseMissingTemplateArguments(TemplateName Name,
SourceLocation Loc);
7073 TemplateTy &Template,
bool AllowInjectedClassName =
false);
7084 unsigned NumExplicitArgs,
7086 void CheckTemplatePartialSpecialization(
7088 void CheckTemplatePartialSpecialization(
7091 Decl *ActOnTemplateDeclarator(Scope *S,
7103 bool CheckDependentFunctionTemplateSpecialization(FunctionDecl *FD,
7107 bool CheckFunctionTemplateSpecialization(
7127 DeclResult ActOnExplicitInstantiation(Scope *S,
7133 SubstDefaultTemplateArgumentIfAvailable(
TemplateDecl *Template,
7139 bool &HasDefaultArg);
7154 CTAK_DeducedFromArrayBound
7157 bool CheckTemplateArgument(
NamedDecl *Param,
7162 unsigned ArgumentPackIndex,
7198 bool PartialTemplateArgs,
7200 bool UpdateArgsWithConversions =
true,
7201 bool *ConstraintsNotSatisfied =
nullptr);
7210 QualType InstantiatedParamType, Expr *Arg,
7256 TPL_TemplateTemplateArgumentMatch
7299 TemplateTy TemplateName,
7312 bool DeducedTSTContext);
7319 bool DeducedTSTContext =
true);
7325 bool RebuildNestedNameSpecifierInCurrentInstantiation(
CXXScopeSpec &SS);
7327 ExprResult RebuildExprInCurrentInstantiation(Expr *E);
7328 bool RebuildTemplateParamsInCurrentInstantiation(
7343 Decl *ActOnConceptDefinition(
7351 void ActOnFinishRequiresExpr();
7359 ActOnCompoundRequirement(
7364 BuildExprRequirement(
7368 BuildExprRequirement(
7374 BuildTypeRequirement(
7378 BuildNestedRequirement(
7392 bool isUnexpandedParameterPackPermitted();
7401 UPPC_Expression = 0,
7497 bool DiagnoseUnexpandedParameterPack(Expr *E,
7507 bool DiagnoseUnexpandedParameterPack(
const CXXScopeSpec &SS,
7530 TemplateName Template,
7681 bool &RetainExpansion,
7709 bool containsUnexpandedParameterPacks(
Declarator &D);
7741 bool AdjustExceptionSpec =
false);
7804 TDK_CUDATargetMismatch
7828 unsigned ArgIdx,
QualType OriginalArgType)
7829 : OriginalParamType(OriginalParamType),
7830 DecomposedParam(DecomposedParam), ArgIdx(ArgIdx),
7831 OriginalArgType(OriginalArgType) {}
7842 unsigned NumExplicitlySpecified, FunctionDecl *&Specialization,
7845 bool PartialOverloading =
false,
7846 llvm::function_ref<
bool()> CheckNonDependent = []{
return false; });
7852 bool PartialOverloading,
7859 FunctionDecl *&Specialization,
7861 bool IsAddressOfFunction =
false);
7872 FunctionDecl *&Specialization,
7874 bool IsAddressOfFunction =
false);
7889 DAR_FailedAlreadyDiagnosed
7895 bool IgnoreConstraints =
false);
7899 bool IgnoreConstraints =
false);
7900 void DiagnoseAutoDeductionFailure(VarDecl *VDecl, Expr *Init);
7902 bool Diagnose =
true);
7906 void DeclareImplicitDeductionGuides(
TemplateDecl *Template,
7909 QualType DeduceTemplateSpecializationFromInitializer(
7918 TypeLoc getReturnTypeLoc(FunctionDecl *FD)
const;
7920 bool DeduceFunctionTypeFromReturnExpr(FunctionDecl *FD,
7928 unsigned NumCallArguments1,
7929 unsigned NumCallArguments2);
7940 getMoreSpecializedPartialSpecialization(
7955 bool isTemplateTemplateParameterAtLeastAsSpecializedAs(
7959 unsigned Depth, llvm::SmallBitVector &
Used);
7964 llvm::SmallBitVector &
Used);
7967 llvm::SmallBitVector &Deduced) {
7968 return MarkDeducedTemplateParameters(Context, FunctionTemplate, Deduced);
7970 static void MarkDeducedTemplateParameters(
ASTContext &Ctx,
7972 llvm::SmallBitVector &Deduced);
7979 getTemplateInstantiationArgs(
NamedDecl *D,
7981 bool RelativeToPrimary =
false,
7982 const FunctionDecl *Pattern =
nullptr);
8107 assert(Kind != DeclaringSpecialMember);
8108 return {TemplateArgs, NumTemplateArgs};
8121 : Kind(TemplateInstantiation),
8122 SavedInNonInstantiationSFINAEContext(
false), Entity(nullptr),
8123 Template(nullptr), TemplateArgs(nullptr), NumTemplateArgs(0),
8124 DeductionInfo(nullptr) {}
8128 bool isInstantiationRecord()
const;
8184 unsigned LastEmittedCodeSynthesisContextDepth = 0;
8191 std::vector<std::unique_ptr<TemplateInstantiationCallback>>
8208 int OldSubstitutionIndex;
8212 : Self(Self), OldSubstitutionIndex(Self.ArgumentPackSubstitutionIndex) {
8221 friend class ArgumentPackSubstitutionRAII;
8228 typedef llvm::DenseMap<Decl *, SmallVector<PartialDiagnosticAt, 1> >
8391 bool AlreadyInstantiating;
8392 bool CheckInstantiationDepth(
SourceLocation PointOfInstantiation,
8398 Decl *Entity,
NamedDecl *Template =
nullptr,
8409 void popCodeSynthesisContext();
8413 return CodeSynthesisContexts.size() > NonInstantiationEntries;
8417 if (!CodeSynthesisContexts.empty() &&
8418 CodeSynthesisContexts.size() != LastEmittedCodeSynthesisContextDepth) {
8419 PrintInstantiationStack();
8420 LastEmittedCodeSynthesisContextDepth = CodeSynthesisContexts.size();
8422 if (PragmaAttributeCurrentTargetDecl)
8423 PrintPragmaAttributeInstantiationPoint();
8425 void PrintInstantiationStack();
8427 void PrintPragmaAttributeInstantiationPoint();
8442 assert(!ExprEvalContexts.empty() &&
8443 "Must be in an expression evaluation context");
8444 return ExprEvalContexts.back().isUnevaluated();
8452 unsigned PrevSFINAEErrors;
8453 bool PrevInNonInstantiationSFINAEContext;
8454 bool PrevAccessCheckingSFINAE;
8455 bool PrevLastDiagnosticIgnored;
8459 : SemaRef(SemaRef), PrevSFINAEErrors(SemaRef.NumSFINAEErrors),
8460 PrevInNonInstantiationSFINAEContext(
8461 SemaRef.InNonInstantiationSFINAEContext),
8462 PrevAccessCheckingSFINAE(SemaRef.AccessCheckingSFINAE),
8463 PrevLastDiagnosticIgnored(
8464 SemaRef.getDiagnostics().isLastDiagnosticIgnored())
8474 = PrevInNonInstantiationSFINAEContext;
8477 PrevLastDiagnosticIgnored);
8494 bool PrevDisableTypoCorrection;
8497 : SemaRef(SemaRef), Trap(SemaRef,
true),
8498 PrevDisableTypoCorrection(SemaRef.DisableTypoCorrection) {
8550 : S(S), Enabled(Enabled) {
8551 if (!Enabled)
return;
8559 S.DefineUsedVTables();
8560 S.PerformPendingInstantiations();
8565 if (!Enabled)
return;
8568 assert(S.VTableUses.empty() &&
8569 "VTableUses should be empty before it is discarded.");
8570 S.VTableUses.swap(SavedVTableUses);
8573 assert(S.PendingInstantiations.empty() &&
8574 "PendingInstantiations should be empty before it is discarded.");
8575 S.PendingInstantiations.swap(SavedPendingInstantiations);
8581 std::deque<PendingImplicitInstantiation> SavedPendingInstantiations;
8597 SavedPendingLocalImplicitInstantiations.swap(
8601 void perform() { S.PerformPendingInstantiations(
true); }
8604 assert(S.PendingLocalImplicitInstantiations.empty() &&
8605 "there shouldn't be any pending local implicit instantiations");
8606 SavedPendingLocalImplicitInstantiations.swap(
8607 S.PendingLocalImplicitInstantiations);
8612 std::deque<PendingImplicitInstantiation>
8613 SavedPendingLocalImplicitInstantiations;
8619 bool HasInteresting =
false;
8624 void set(
unsigned index, FunctionProtoType::ExtParameterInfo info) {
8625 assert(Infos.size() <= index);
8626 Infos.resize(index);
8627 Infos.push_back(info);
8629 if (!HasInteresting)
8630 HasInteresting = (info != FunctionProtoType::ExtParameterInfo());
8635 const FunctionProtoType::ExtParameterInfo *
8637 if (!HasInteresting)
return nullptr;
8638 Infos.resize(numParams);
8639 return Infos.data();
8643 void PerformPendingInstantiations(
bool LocalOnly =
false);
8648 bool AllowDeducedTST =
false);
8672 int indexAdjustment,
8674 bool ExpectParameterPack);
8676 const FunctionProtoType::ExtParameterInfo *ExtParamInfos,
8724 bool CXXDirectInit);
8736 bool Complain =
true);
8743 bool InstantiateInClassInitializer(
8754 : TmplAttr(A), Scope(S), NewDecl(D)
8760 const Decl *Pattern, Decl *Inst,
8761 LateInstantiatedAttrVec *LateAttrs =
nullptr,
8766 const Decl *Pattern, Decl *Inst,
8767 LateInstantiatedAttrVec *LateAttrs =
nullptr,
8770 bool usesPartialOrExplicitSpecialization(
8774 InstantiateClassTemplateSpecialization(
SourceLocation PointOfInstantiation,
8777 bool Complain =
true);
8779 void InstantiateClassMembers(
SourceLocation PointOfInstantiation,
8784 void InstantiateClassTemplateSpecializationMembers(
8804 void InstantiateExceptionSpec(
SourceLocation PointOfInstantiation,
8805 FunctionDecl *Function);
8806 bool CheckInstantiatedFunctionTemplateConstraints(
8813 void InstantiateFunctionDefinition(
SourceLocation PointOfInstantiation,
8814 FunctionDecl *Function,
8815 bool Recursive =
false,
8816 bool DefinitionRequired =
false,
8817 bool AtEndOfTU =
false);
8824 LateInstantiatedAttrVec *LateAttrs =
nullptr,
8830 BuildVariableInstantiation(VarDecl *NewVar, VarDecl *OldVar,
8832 LateInstantiatedAttrVec *LateAttrs,
8835 bool InstantiatingVarTemplate =
false,
8838 VarDecl *getVarTemplateSpecialization(
8842 void InstantiateVariableInitializer(
8843 VarDecl *Var, VarDecl *OldVar,
8845 void InstantiateVariableDefinition(
SourceLocation PointOfInstantiation,
8846 VarDecl *Var,
bool Recursive =
false,
8847 bool DefinitionRequired =
false,
8848 bool AtEndOfTU =
false);
8850 void InstantiateMemInitializers(CXXConstructorDecl *New,
8851 const CXXConstructorDecl *Tmpl,
8856 bool FindingInstantiatedContext =
false);
8868 OCK_CategoryImplementation
8886 Decl *ActOnStartClassInterface(
8891 Decl *
const *ProtoRefs,
unsigned NumProtoRefs,
8895 void ActOnSuperClassOfClassInterface(Scope *S,
8910 Decl *ActOnCompatibilityAlias(
8915 bool CheckForwardProtocolDeclarationForCircularDependency(
8920 Decl *ActOnStartProtocolInterface(
8926 Decl *ActOnStartCategoryInterface(
8930 Decl *
const *ProtoRefs,
unsigned NumProtoRefs,
8934 Decl *ActOnStartClassImplementation(
SourceLocation AtClassImplLoc,
8941 Decl *ActOnStartCategoryImplementation(
SourceLocation AtCatImplLoc,
8948 DeclGroupPtrTy ActOnFinishObjCImplementation(Decl *ObjCImpDecl,
8962 void FindProtocolDeclaration(
bool WarnOnDeclarations,
bool ForObjCContainer,
8970 bool SelectProtocolFirst =
false);
8975 void actOnObjCTypeArgsOrProtocolQualifiers(
8988 bool warnOnIncompleteProtocols);
8999 TypeResult actOnObjCTypeArgsAndProtocolQualifiers(
9017 bool FailOnError =
false);
9029 bool FailOnError =
false);
9034 void CheckObjCPropertyAttributes(Decl *PropertyPtrTy,
9036 unsigned &Attributes,
9037 bool propertyInPrimaryClass);
9048 bool OverridingProtocolProperty);
9064 Decl *ActOnPropertyImplDecl(Scope *S,
9079 OSMK_NonRetainingInit
9094 Decl *ActOnMethodDeclaration(
9105 bool isVariadic,
bool MethodDefinition);
9114 bool inferObjCARCLifetime(
ValueDecl *decl);
9116 void deduceOpenCLAddressSpace(
ValueDecl *decl);
9151 bool HasTrailingDot,
9170 bool isImplicit =
false);
9173 bool isSuperReceiver,
9187 ExprResult BuildInstanceMessage(Expr *Receiver,
9196 bool isImplicit =
false);
9198 ExprResult BuildInstanceMessageImplicit(Expr *Receiver,
9239 TypedefNameDecl *&TDNDecl,
9240 bool CfToNs,
bool Diagnose =
true);
9244 Expr *&SrcExpr,
bool Diagnose =
true);
9246 bool ConversionToObjCStringLiteralCheck(
QualType DstType, Expr *&SrcExpr,
9247 bool Diagnose =
true);
9290 StringRef SlotLabel, Expr *Alignment);
9293 NonDefaultStateAtInclude,
9299 void DiagnoseUnterminatedPragmaPack();
9312 void ActOnPragmaMSPointersToMembers(
9328 bool UnifySection(StringRef SectionName,
9330 DeclaratorDecl *TheDecl);
9331 bool UnifySection(StringRef SectionName,
9338 llvm::StringRef StackSlotLabel,
9340 llvm::StringRef PragmaName);
9354 void ActOnPragmaDetectMismatch(
SourceLocation Loc, StringRef Name,
9358 void ActOnPragmaUnused(
const Token &Identifier,
9401 void AddAlignmentAttributesForRecord(
RecordDecl *RD);
9404 void AddMsStructLayoutForRecord(
RecordDecl *RD);
9407 void FreePackedContext();
9411 void PushNamespaceVisibilityAttr(
const VisibilityAttr *Attr,
9416 void AddPushedVisibilityAttribute(Decl *RD);
9420 void PopPragmaVisibility(
bool IsNamespaceEnd,
SourceLocation EndLoc);
9423 void FreeVisContext();
9428 void AddCFAuditedAttribute(Decl *D);
9430 void ActOnPragmaAttributeAttribute(
ParsedAttr &Attribute,
9442 void AddPragmaAttributes(Scope *S, Decl *D);
9444 void DiagnoseUnterminatedPragmaAttribute();
9452 return OptimizeOffPragmaLocation;
9458 void AddRangeBasedOptnone(FunctionDecl *FD);
9463 void AddOptnoneAttributeIfNoConflicts(FunctionDecl *FD,
SourceLocation Loc);
9467 bool IsPackExpansion);
9469 bool IsPackExpansion);
9488 Expr *MaxThreads, Expr *MinBlocks);
9492 bool InInstantiation =
false);
9504 Expr *Min, Expr *Max);
9509 Expr *Min, Expr *Max);
9523 bool IsImplicit =
false);
9528 bool IsImplicit =
false);
9532 void CheckCompletedCoroutineBody(FunctionDecl *FD, Stmt *&Body);
9540 std::string CurrOpenCLExtension;
9542 llvm::DenseMap<const Type*, std::set<std::string>> OpenCLTypeExtMap;
9544 llvm::DenseMap<const Decl*, std::set<std::string>> OpenCLDeclExtMap;
9547 return CurrOpenCLExtension;
9553 std::string getOpenCLExtensionsFromDeclExtMap(FunctionDecl *FD);
9558 std::string getOpenCLExtensionsFromTypeExtMap(
FunctionType *FT);
9561 template<
typename T,
typename MapT>
9562 std::string getOpenCLExtensionsFromExtMap(T* FT, MapT &Map);
9565 CurrOpenCLExtension = Ext;
9571 void setOpenCLExtensionForType(
QualType T, llvm::StringRef Exts);
9577 void setOpenCLExtensionForDecl(Decl *FD, llvm::StringRef Exts);
9582 void setCurrentOpenCLExtensionForType(
QualType T);
9587 void setCurrentOpenCLExtensionForDecl(Decl *FD);
9589 bool isOpenCLDisabledDecl(Decl *FD);
9601 bool checkOpenCLDisabledDecl(
const NamedDecl &D,
const Expr &E);
9607 void *VarDataSharingAttributesStack;
9609 unsigned DeclareTargetNestingLevel = 0;
9611 void InitDataSharingAttributesStack();
9612 void DestroyDataSharingAttributesStack();
9615 bool StrictlyPositive =
true);
9617 unsigned getOpenMPNestingLevel()
const;
9620 void adjustOpenMPTargetScopeIndex(
unsigned &FunctionScopesIndex,
9621 unsigned Level)
const;
9625 int getNumberOfConstructScopes(
unsigned Level)
const;
9628 void pushOpenMPFunctionRegion();
9634 void checkOpenMPDeviceFunction(
SourceLocation Loc, FunctionDecl *Callee,
9635 bool CheckForDelayedContext =
true);
9638 void checkOpenMPHostFunction(
SourceLocation Loc, FunctionDecl *Callee,
9639 bool CheckCaller =
true);
9643 void checkOpenMPDeviceExpr(
const Expr *E);
9647 void finalizeOpenMPDelayedAnalysis();
9659 template <
typename T,
typename DiagLocT,
typename DiagInfoT,
typename MapT>
9660 bool checkOpenCLDisabledTypeOrDecl(T D, DiagLocT DiagLoc, DiagInfoT DiagInfo,
9668 bool MightBeOdrUse);
9677 bool areMultiversionVariantFunctionsCompatible(
9678 const FunctionDecl *OldFD,
const FunctionDecl *NewFD,
9683 bool ConstexprSupported,
bool CLinkageMayDiffer);
9694 bool isOpenMPCapturedByRef(
const ValueDecl *D,
unsigned Level,
9695 unsigned OpenMPCaptureLevel)
const;
9700 VarDecl *isOpenMPCapturedDecl(
ValueDecl *D,
bool CheckScopeInfo =
false,
9701 unsigned StopAt = 0);
9702 ExprResult getOpenMPCapturedExpr(VarDecl *Capture,
ExprValueKind VK,
9707 void startOpenMPLoop();
9711 void startOpenMPCXXRangeFor();
9716 bool isOpenMPPrivateDecl(
const ValueDecl *D,
unsigned Level)
const;
9726 bool isOpenMPTargetCapturedDecl(
const ValueDecl *D,
unsigned Level)
const;
9728 ExprResult PerformOpenMPImplicitIntegerConversion(
SourceLocation OpLoc,
9737 void EndOpenMPClause();
9739 void EndOpenMPDSABlock(Stmt *CurDirective);
9745 void ActOnOpenMPLoopInitialization(
SourceLocation ForLoc, Stmt *Init);
9750 ExprResult ActOnOpenMPIdExpression(Scope *CurScope,
CXXScopeSpec &ScopeSpec,
9754 DeclGroupPtrTy ActOnOpenMPThreadprivateDirective(
9776 DeclGroupPtrTy ActOnOpenMPDeclareReductionDirectiveStart(
9778 ArrayRef<std::pair<QualType, SourceLocation>> ReductionTypes,
9781 void ActOnOpenMPDeclareReductionCombinerStart(Scope *S, Decl *D);
9783 void ActOnOpenMPDeclareReductionCombinerEnd(Decl *D, Expr *Combiner);
9786 VarDecl *ActOnOpenMPDeclareReductionInitializerStart(Scope *S, Decl *D);
9788 void ActOnOpenMPDeclareReductionInitializerEnd(Decl *D, Expr *Initializer,
9789 VarDecl *OmpPrivParm);
9791 DeclGroupPtrTy ActOnOpenMPDeclareReductionDirectiveEnd(
9792 Scope *S, DeclGroupPtrTy DeclReductions,
bool IsValid);
9804 Decl *PrevDeclInScope =
nullptr);
9818 void ActOnFinishOpenMPDeclareTargetDirective();
9822 lookupOpenMPDeclareTargetName(Scope *CurScope,
CXXScopeSpec &ScopeSpec,
9824 NamedDeclSetType &SameDirectiveDecls);
9827 OMPDeclareTargetDeclAttr::MapTypeTy MT,
9828 OMPDeclareTargetDeclAttr::DevTypeTy DT);
9831 checkDeclIsAllowedInOpenMPTarget(Expr *E, Decl *D,
9835 return DeclareTargetNestingLevel > 0;
9838 bool isInOpenMPTargetExecutionDirective()
const;
9863 llvm::SmallDenseMap<const ValueDecl *, const Expr *, 4>;
9913 StmtResult ActOnOpenMPParallelForSimdDirective(
9990 StmtResult ActOnOpenMPTargetParallelForDirective(
10016 StmtResult ActOnOpenMPTaskLoopSimdDirective(
10021 StmtResult ActOnOpenMPMasterTaskLoopDirective(
10026 StmtResult ActOnOpenMPMasterTaskLoopSimdDirective(
10031 StmtResult ActOnOpenMPParallelMasterTaskLoopDirective(
10036 StmtResult ActOnOpenMPParallelMasterTaskLoopSimdDirective(
10052 StmtResult ActOnOpenMPDistributeParallelForDirective(
10057 StmtResult ActOnOpenMPDistributeParallelForSimdDirective(
10062 StmtResult ActOnOpenMPDistributeSimdDirective(
10067 StmtResult ActOnOpenMPTargetParallelForSimdDirective(
10078 StmtResult ActOnOpenMPTeamsDistributeDirective(
10083 StmtResult ActOnOpenMPTeamsDistributeSimdDirective(
10088 StmtResult ActOnOpenMPTeamsDistributeParallelForSimdDirective(
10093 StmtResult ActOnOpenMPTeamsDistributeParallelForDirective(
10104 StmtResult ActOnOpenMPTargetTeamsDistributeDirective(
10109 StmtResult ActOnOpenMPTargetTeamsDistributeParallelForDirective(
10114 StmtResult ActOnOpenMPTargetTeamsDistributeParallelForSimdDirective(
10119 StmtResult ActOnOpenMPTargetTeamsDistributeSimdDirective(
10133 DeclGroupPtrTy ActOnOpenMPDeclareSimdDirective(
10134 DeclGroupPtrTy DG, OMPDeclareSimdDeclAttr::BranchStateTy BS,
10148 DeclGroupPtrTy DG, Expr *VariantRef,
SourceRange SR);
10158 void ActOnOpenMPDeclareVariantDirective(FunctionDecl *FD, Expr *VariantRef,
10168 OMPClause *ActOnOpenMPAllocatorClause(Expr *Allocator,
10184 OMPClause *ActOnOpenMPNumThreadsClause(Expr *NumThreads,
10189 OMPClause *ActOnOpenMPSafelenClause(Expr *Length,
10198 OMPClause *ActOnOpenMPCollapseClause(Expr *NumForLoops,
10206 Expr *NumForLoops =
nullptr);
10233 OMPClause *ActOnOpenMPProcBindClause(llvm::omp::ProcBindKind Kind,
10239 OMPClause *ActOnOpenMPSingleExprWithArgClause(
10303 OMPClause *ActOnOpenMPAtomicDefaultMemOrderClause(
10331 OMPClause *ActOnOpenMPLastprivateClause(
10348 OMPClause *ActOnOpenMPTaskReductionClause(
10355 OMPClause *ActOnOpenMPInReductionClause(
10414 OMPClause *ActOnOpenMPThreadLimitClause(Expr *ThreadLimit,
10423 OMPClause *ActOnOpenMPDistScheduleClause(
10428 OMPClause *ActOnOpenMPDefaultmapClause(
10466 CCK_ForBuiltinOverloadedOp
10470 return CCK == CCK_CStyleCast || CCK == CCK_FunctionalCast ||
10471 CCK == CCK_OtherCast;
10479 const CXXCastPath *BasePath =
nullptr,
10481 = CCK_ImplicitConversion);
10490 ExprResult IgnoredValueConversions(Expr *E);
10494 ExprResult UsualUnaryConversions(Expr *E);
10498 ExprResult CallExprUnaryConversions(Expr *E);
10502 ExprResult DefaultFunctionArrayConversion(Expr *E,
bool Diagnose =
true);
10507 ExprResult DefaultFunctionArrayLvalueConversion(Expr *E,
10508 bool Diagnose =
true);
10514 ExprResult DefaultLvalueConversion(Expr *E);
10519 ExprResult DefaultArgumentPromotion(Expr *E);
10524 ExprResult TemporaryMaterializationConversion(Expr *E);
10532 VariadicDoesNotApply
10557 bool hasCStrMethod(
const Expr *E);
10561 bool GatherArgumentsForCall(
SourceLocation CallLoc, FunctionDecl *FDecl,
10566 bool AllowExplicit =
false,
10567 bool IsListInitialization =
false);
10572 FunctionDecl *FDecl);
10593 QualType UsualArithmeticConversions(ExprResult &LHS, ExprResult &RHS,
10681 bool *Complained =
nullptr);
10687 bool AllowMask)
const;
10707 bool ConvertRHS =
true);
10724 QualType LHSType, ExprResult &RHS,
bool Diagnose =
true,
10725 bool DiagnoseCFAudited =
false,
bool ConvertRHS =
true);
10732 bool IsStringLiteralToNonConstPointerConversion(Expr *From,
QualType ToType);
10734 bool CheckExceptionSpecCompatibility(Expr *From,
QualType ToType);
10736 ExprResult PerformImplicitConversion(Expr *From,
QualType ToType,
10738 bool AllowExplicit =
false);
10739 ExprResult PerformImplicitConversion(Expr *From,
QualType ToType,
10741 bool AllowExplicit,
10743 ExprResult PerformImplicitConversion(Expr *From,
QualType ToType,
10747 = CCK_ImplicitConversion);
10748 ExprResult PerformImplicitConversion(Expr *From,
QualType ToType,
10753 ExprResult PerformQualificationConversion(
10765 QualType CheckPointerToMemberOperands(
10768 QualType CheckMultiplyDivideOperands(
10769 ExprResult &LHS, ExprResult &RHS,
SourceLocation Loc,
bool IsCompAssign,
10773 bool IsCompAssign =
false);
10777 QualType CheckSubtractionOperands(
10783 void CheckPtrComparisonWithNullChar(ExprResult &E, ExprResult &NullE);
10799 ExprResult checkPseudoObjectIncDec(Scope *S,
SourceLocation OpLoc,
10801 ExprResult checkPseudoObjectAssignment(Scope *S,
SourceLocation OpLoc,
10803 Expr *LHS, Expr *RHS);
10804 ExprResult checkPseudoObjectRValue(Expr *E);
10807 QualType CheckConditionalOperands(
10808 ExprResult &Cond, ExprResult &LHS, ExprResult &RHS,
10810 QualType CXXCheckConditionalOperands(
10811 ExprResult &cond, ExprResult &lhs, ExprResult &rhs,
10813 QualType CheckGNUVectorConditionalTypes(ExprResult &Cond, ExprResult &LHS,
10817 bool ConvertArgs =
true);
10819 ExprResult &E1, ExprResult &E2,
10820 bool ConvertArgs =
true) {
10821 Expr *E1Tmp = E1.
get(), *E2Tmp = E2.
get();
10823 FindCompositePointerType(Loc, E1Tmp, E2Tmp, ConvertArgs);
10829 QualType FindCompositeObjCPointerType(ExprResult &LHS, ExprResult &RHS,
10832 bool DiagnoseConditionalForNull(Expr *LHSExpr, Expr *RHSExpr,
10835 void DiagnoseAlwaysNonNullPointer(Expr *E,
10840 QualType CheckVectorOperands(ExprResult &LHS, ExprResult &RHS,
10842 bool AllowBothBool,
bool AllowBoolConversion);
10844 QualType CheckVectorCompareOperands(ExprResult &LHS, ExprResult &RHS,
10847 QualType CheckVectorLogicalOperands(ExprResult &LHS, ExprResult &RHS,
10854 bool CheckForConstantInitializer(Expr *e,
QualType t);
10864 Ref_Incompatible = 0,
10879 Qualification = 0x1,
10880 NestedQualification = 0x2,
10882 DerivedToBase = 0x8,
10884 ObjCLifetime = 0x20,
10886 LLVM_MARK_AS_BITMASK_ENUM(ObjCLifetime)
10901 ExprResult forceUnknownAnyToType(Expr *E,
QualType ToType);
10906 Expr *result,
QualType ¶mType);
10917 ExprResult prepareVectorSplat(
QualType VectorTy, Expr *SplattedExpr);
10939 bool Diagnose =
true,
10940 bool DiagnoseCFAudited =
false,
10944 Expr *stripARCUnbridgedCast(Expr *e);
10945 void diagnoseARCUnbridgedCast(Expr *e);
10947 bool CheckObjCARCUnavailableWeakConversion(
QualType castType,
10953 void checkRetainCycles(Expr *receiver, Expr *argument);
10954 void checkRetainCycles(VarDecl *Var, Expr *Init);
10962 void checkUnsafeExprAssigns(
SourceLocation Loc, Expr *LHS, Expr *RHS);
10968 bool CheckMessageArgumentTypes(
const Expr *Receiver,
QualType ReceiverType,
10979 QualType getMessageSendResultType(
const Expr *Receiver,
QualType ReceiverType,
10981 bool isSuperMessage);
10985 void EmitRelatedResultTypeNote(
const Expr *E);
10990 void EmitRelatedResultTypeNoteForReturn(
QualType destType);
10993 Decl *ConditionVar;
10996 bool HasKnownValue;
11002 : ConditionVar(ConditionVar), Condition(Condition), Invalid(
false),
11003 HasKnownValue(IsConstexpr && Condition.get() &&
11004 !Condition.get()->isValueDependent()),
11005 KnownValue(HasKnownValue &&
11006 !!Condition.get()->EvaluateKnownConstInt(S.Context)) {}
11008 : ConditionVar(nullptr), Condition(nullptr), Invalid(Invalid),
11014 std::pair<VarDecl *, Expr *>
get()
const {
11015 return std::make_pair(cast_or_null<VarDecl>(ConditionVar),
11019 if (!HasKnownValue)
11041 ExprResult CheckConditionVariable(VarDecl *ConditionVar,
11044 ExprResult CheckSwitchCondition(
SourceLocation SwitchLoc, Expr *Cond);
11055 bool IsConstexpr =
false);
11067 void DiagnoseAssignmentAsCondition(Expr *E);
11071 void DiagnoseEqualityWithExtraParens(
ParenExpr *ParenE);
11074 ExprResult CheckCXXBooleanCondition(Expr *CondExpr,
bool IsConstexpr =
false);
11079 void ConvertIntegerToTypeWarnOnOverflow(
llvm::APSInt &OldVal,
11080 unsigned NewWidth,
bool NewSign,
11086 bool CheckObjCDeclScope(Decl *D);
11104 ExprResult VerifyIntegerConstantExpression(Expr *E,
llvm::APSInt *Result,
11106 bool AllowFold =
true);
11107 ExprResult VerifyIntegerConstantExpression(Expr *E,
llvm::APSInt *Result,
11109 bool AllowFold =
true);
11110 ExprResult VerifyIntegerConstantExpression(Expr *E,
11118 QualType FieldTy,
bool IsMsStruct,
11119 Expr *BitWidth,
bool *ZeroWidth =
nullptr);
11122 unsigned ForceCUDAHostDeviceDepth = 0;
11128 void PushForceCUDAHostDevice();
11133 bool PopForceCUDAHostDevice();
11138 llvm::DenseMap<CanonicalDeclPtr<FunctionDecl>,
11139 std::vector<PartialDiagnosticAt>>
11170 llvm::DenseMap< CanonicalDeclPtr<FunctionDecl>,
11171 llvm::MapVector<CanonicalDeclPtr<FunctionDecl>,
11208 FunctionDecl *Fn,
Sema &S);
11223 operator bool()
const {
return ImmediateDiag.hasValue(); }
11225 template <
typename T>
11228 if (Diag.ImmediateDiag.hasValue())
11229 *Diag.ImmediateDiag << Value;
11230 else if (Diag.PartialDiagId.hasValue())
11241 bool ShowCallStack;
11252 void markKnownEmitted(
11253 Sema &S, FunctionDecl *OrigCaller, FunctionDecl *OrigCallee,
11255 const llvm::function_ref<
bool(
Sema &, FunctionDecl *)> IsKnownEmitted);
11329 bool IgnoreImplicitHDAttr =
false);
11334 return IdentifyCUDATarget(dyn_cast<FunctionDecl>(CurContext));
11358 const FunctionDecl *Callee);
11366 const FunctionDecl *Callee) {
11367 return IdentifyCUDAPreference(Caller, Callee) != CFP_Never;
11372 void maybeAddCUDAHostDeviceAttrs(FunctionDecl *FD,
11403 void EraseUnwantedCUDAMatches(
11404 const FunctionDecl *Caller,
11405 SmallVectorImpl<std::pair<DeclAccessPair, FunctionDecl *>> &Matches);
11418 bool inferCUDATargetForImplicitSpecialMember(
CXXRecordDecl *ClassDecl,
11426 bool isEmptyCudaConstructor(
SourceLocation Loc, CXXConstructorDecl *CD);
11437 void checkAllowedCUDAInitializer(VarDecl *VD);
11441 void checkCUDATargetOverload(FunctionDecl *NewFD,
11449 std::string getCudaConfigureFuncName()
const;
11496 PCC_LocalDeclarationSpecifiers
11499 void CodeCompleteModuleImport(
SourceLocation ImportLoc, ModuleIdPath Path);
11500 void CodeCompleteOrdinaryName(Scope *S,
11502 void CodeCompleteDeclSpec(Scope *S,
DeclSpec &DS,
11503 bool AllowNonIdentifiers,
11504 bool AllowNestedNameSpecifiers);
11507 void CodeCompleteExpression(Scope *S,
11509 void CodeCompleteExpression(Scope *S,
QualType PreferredType,
11510 bool IsParenthesized =
false);
11511 void CodeCompleteMemberReferenceExpr(Scope *S, Expr *
Base, Expr *OtherOpBase,
11513 bool IsBaseExprStatement,
11515 void CodeCompletePostfixExpression(Scope *S, ExprResult LHS,
11517 void CodeCompleteTag(Scope *S,
unsigned TagSpec);
11518 void CodeCompleteTypeQualifiers(
DeclSpec &DS);
11521 void CodeCompleteBracketDeclarator(Scope *S);
11522 void CodeCompleteCase(Scope *S);
11531 QualType ProduceCtorInitMemberSignatureHelp(Scope *S, Decl *ConstructorDecl,
11537 void CodeCompleteInitializer(Scope *S, Decl *D);
11538 void CodeCompleteAfterIf(Scope *S);
11540 void CodeCompleteQualifiedId(Scope *S,
CXXScopeSpec &SS,
bool EnteringContext,
11541 bool IsUsingDeclaration,
QualType BaseType,
11543 void CodeCompleteUsing(Scope *S);
11544 void CodeCompleteUsingDirective(Scope *S);
11545 void CodeCompleteNamespaceDecl(Scope *S);
11546 void CodeCompleteNamespaceAliasDecl(Scope *S);
11547 void CodeCompleteOperatorName(Scope *S);
11548 void CodeCompleteConstructorInitializer(
11553 bool AfterAmpersand);
11555 void CodeCompleteObjCAtDirective(Scope *S);
11556 void CodeCompleteObjCAtVisibility(Scope *S);
11557 void CodeCompleteObjCAtStatement(Scope *S);
11558 void CodeCompleteObjCAtExpression(Scope *S);
11559 void CodeCompleteObjCPropertyFlags(Scope *S,
ObjCDeclSpec &ODS);
11560 void CodeCompleteObjCPropertyGetter(Scope *S);
11561 void CodeCompleteObjCPropertySetter(Scope *S);
11562 void CodeCompleteObjCPassingType(Scope *S,
ObjCDeclSpec &DS,
11564 void CodeCompleteObjCMessageReceiver(Scope *S);
11565 void CodeCompleteObjCSuperMessage(Scope *S,
SourceLocation SuperLoc,
11567 bool AtArgumentExpression);
11568 void CodeCompleteObjCClassMessage(Scope *S,
ParsedType Receiver,
11570 bool AtArgumentExpression,
11571 bool IsSuper =
false);
11572 void CodeCompleteObjCInstanceMessage(Scope *S, Expr *Receiver,
11574 bool AtArgumentExpression,
11576 void CodeCompleteObjCForCollection(Scope *S,
11577 DeclGroupPtrTy IterationVar);
11578 void CodeCompleteObjCSelector(Scope *S,
11580 void CodeCompleteObjCProtocolReferences(
11582 void CodeCompleteObjCProtocolDecl(Scope *S);
11583 void CodeCompleteObjCInterfaceDecl(Scope *S);
11584 void CodeCompleteObjCSuperclass(Scope *S,
11587 void CodeCompleteObjCImplementationDecl(Scope *S);
11588 void CodeCompleteObjCInterfaceCategory(Scope *S,
11591 void CodeCompleteObjCImplementationCategory(Scope *S,
11594 void CodeCompleteObjCPropertyDefinition(Scope *S);
11595 void CodeCompleteObjCPropertySynthesizeIvar(Scope *S,
11597 void CodeCompleteObjCMethodDecl(Scope *S,
Optional<bool> IsInstanceMethod,
11599 void CodeCompleteObjCMethodDeclSelector(Scope *S,
11600 bool IsInstanceMethod,
11601 bool AtParameterName,
11604 void CodeCompleteObjCClassPropertyRefExpr(Scope *S,
IdentifierInfo &ClassName,
11606 bool IsBaseExprStatement);
11607 void CodeCompletePreprocessorDirective(
bool InConditional);
11608 void CodeCompleteInPreprocessorConditionalExclusion(Scope *S);
11609 void CodeCompletePreprocessorMacroName(
bool IsDefinition);
11610 void CodeCompletePreprocessorExpression();
11611 void CodeCompletePreprocessorMacroArgument(Scope *S,
11614 unsigned Argument);
11615 void CodeCompleteIncludedFile(llvm::StringRef Dir,
bool IsAngled);
11616 void CodeCompleteNaturalLanguage();
11617 void CodeCompleteAvailabilityPlatformName();
11628 unsigned ByteNo)
const;
11631 void CheckArrayAccess(
const Expr *BaseExpr,
const Expr *IndexExpr,
11633 bool AllowOnePastEnd=
true,
bool IndexNegated=
false);
11634 void CheckArrayAccess(
const Expr *E);
11637 struct FormatStringInfo {
11638 unsigned FormatIdx;
11639 unsigned FirstDataArg;
11643 static bool getFormatStringInfo(
const FormatAttr *Format,
bool IsCXXMember,
11644 FormatStringInfo *FSI);
11645 bool CheckFunctionCall(FunctionDecl *FDecl,
CallExpr *TheCall,
11652 void CheckConstructorCall(FunctionDecl *FDecl,
11662 bool CheckObjCString(Expr *Arg);
11663 ExprResult CheckOSLogFormatStringArg(Expr *Arg);
11665 ExprResult CheckBuiltinFunctionCall(FunctionDecl *FDecl,
11666 unsigned BuiltinID,
CallExpr *TheCall);
11667 void checkFortifiedBuiltinMemoryFunction(FunctionDecl *FD,
CallExpr *TheCall);
11669 bool CheckARMBuiltinExclusiveCall(
unsigned BuiltinID,
CallExpr *TheCall,
11670 unsigned MaxWidth);
11671 bool CheckNeonBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
11672 bool CheckMVEBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
11673 bool CheckARMBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
11675 bool CheckAArch64BuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
11676 bool CheckBPFBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
11677 bool CheckHexagonBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
11678 bool CheckHexagonBuiltinCpu(
unsigned BuiltinID,
CallExpr *TheCall);
11679 bool CheckHexagonBuiltinArgument(
unsigned BuiltinID,
CallExpr *TheCall);
11680 bool CheckMipsBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
11681 bool CheckMipsBuiltinCpu(
unsigned BuiltinID,
CallExpr *TheCall);
11682 bool CheckMipsBuiltinArgument(
unsigned BuiltinID,
CallExpr *TheCall);
11683 bool CheckSystemZBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
11684 bool CheckX86BuiltinRoundingOrSAE(
unsigned BuiltinID,
CallExpr *TheCall);
11685 bool CheckX86BuiltinGatherScatterScale(
unsigned BuiltinID,
CallExpr *TheCall);
11686 bool CheckX86BuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
11687 bool CheckPPCBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
11689 bool SemaBuiltinVAStart(
unsigned BuiltinID,
CallExpr *TheCall);
11690 bool SemaBuiltinVAStartARMMicrosoft(
CallExpr *Call);
11691 bool SemaBuiltinUnorderedCompare(
CallExpr *TheCall);
11692 bool SemaBuiltinFPClassification(
CallExpr *TheCall,
unsigned NumArgs);
11693 bool SemaBuiltinVSX(
CallExpr *TheCall);
11694 bool SemaBuiltinOSLogFormat(
CallExpr *TheCall);
11698 ExprResult SemaBuiltinShuffleVector(
CallExpr *TheCall);
11699 ExprResult SemaConvertVectorExpr(Expr *E,
TypeSourceInfo *TInfo,
11704 bool SemaBuiltinPrefetch(
CallExpr *TheCall);
11705 bool SemaBuiltinAllocaWithAlign(
CallExpr *TheCall);
11706 bool SemaBuiltinAssume(
CallExpr *TheCall);
11707 bool SemaBuiltinAssumeAligned(
CallExpr *TheCall);
11708 bool SemaBuiltinLongjmp(
CallExpr *TheCall);
11709 bool SemaBuiltinSetjmp(
CallExpr *TheCall);
11710 ExprResult SemaBuiltinAtomicOverloaded(ExprResult TheCallResult);
11711 ExprResult SemaBuiltinNontemporalOverloaded(ExprResult TheCallResult);
11712 ExprResult SemaAtomicOpsOverloaded(ExprResult TheCallResult,
11714 ExprResult SemaBuiltinOperatorNewDeleteOverloaded(ExprResult TheCallResult,
11716 bool SemaBuiltinConstantArg(
CallExpr *TheCall,
int ArgNum,
11718 bool SemaBuiltinConstantArgRange(
CallExpr *TheCall,
int ArgNum,
int Low,
11719 int High,
bool RangeIsError =
true);
11720 bool SemaBuiltinConstantArgMultiple(
CallExpr *TheCall,
int ArgNum,
11721 unsigned Multiple);
11722 bool SemaBuiltinConstantArgPower2(
CallExpr *TheCall,
int ArgNum);
11723 bool SemaBuiltinConstantArgShiftedByte(
CallExpr *TheCall,
int ArgNum);
11724 bool SemaBuiltinConstantArgShiftedByteOrXXFF(
CallExpr *TheCall,
int ArgNum);
11725 bool SemaBuiltinARMSpecialReg(
unsigned BuiltinID,
CallExpr *TheCall,
11726 int ArgNum,
unsigned ExpectedFieldNum,
11728 bool SemaBuiltinARMMemoryTaggingCall(
unsigned BuiltinID,
CallExpr *TheCall);
11746 static bool GetFormatNSStringIdx(
const FormatAttr *Format,
unsigned &Idx);
11749 bool CheckFormatArguments(
const FormatAttr *Format,
11754 llvm::SmallBitVector &CheckedVarArgs);
11756 bool HasVAListArg,
unsigned format_idx,
11760 llvm::SmallBitVector &CheckedVarArgs);
11762 void CheckAbsoluteValueFunction(
const CallExpr *Call,
11763 const FunctionDecl *FDecl);
11765 void CheckMaxUnsignedZero(
const CallExpr *Call,
const FunctionDecl *FDecl);
11767 void CheckMemaccessArguments(
const CallExpr *Call,
11771 void CheckStrlcpycatArguments(
const CallExpr *Call,
11774 void CheckStrncatArguments(
const CallExpr *Call,
11777 void CheckReturnValExpr(Expr *RetValExp,
QualType lhsType,
11779 bool isObjCMethod =
false,
11780 const AttrVec *Attrs =
nullptr,
11781 const FunctionDecl *FD =
nullptr);
11784 void CheckFloatComparison(
SourceLocation Loc, Expr *LHS, Expr *RHS);
11789 void CheckForIntOverflow(Expr *E);
11790 void CheckUnsequencedOperations(
const Expr *E);
11795 bool IsConstexpr =
false);
11804 bool DeclIsField =
true);
11808 void CheckBreakContinueBinding(Expr *E);
11816 bool DeleteWasArrayForm);
11819 void RegisterTypeTagForDatatype(
const IdentifierInfo *ArgumentKind,
11820 uint64_t MagicValue,
QualType Type,
11821 bool LayoutCompatible,
bool MustBeNull);
11827 Type(Type), LayoutCompatible(LayoutCompatible),
11828 MustBeNull(MustBeNull)
11845 std::unique_ptr<llvm::DenseMap<TypeTagMagicValue, TypeTagData>>
11846 TypeTagForDatatypeMagicValues;
11850 void CheckArgumentWithTypeTag(
const ArgumentWithTypeTagAttr *Attr,
11856 void CheckAddressOfPackedMember(Expr *rhs);
11913 Decl *getObjCDeclContext()
const;
11916 return OriginalLexicalContext ? OriginalLexicalContext : CurContext;
11923 DC = CatD->getClassInterface();
11930 bool PartialOverloading =
false) {
11932 if (NumArgs > 0 && PartialOverloading)
11933 return NumArgs + 1 > NumParams;
11934 return NumArgs > NumParams;
11943 int ParsingClassDepth = 0;
11945 class SavePendingParsedClassStateRAII {
11947 SavePendingParsedClassStateRAII(
Sema &S) : S(S) { swapSavedState(); }
11949 ~SavePendingParsedClassStateRAII() {
11951 "there shouldn't be any pending delayed exception spec checks");
11953 "there shouldn't be any pending delayed exception spec checks");
11959 decltype(DelayedOverridingExceptionSpecChecks)
11960 SavedOverridingExceptionSpecChecks;
11961 decltype(DelayedEquivalentExceptionSpecChecks)
11962 SavedEquivalentExceptionSpecChecks;
11964 void swapSavedState() {
11965 SavedOverridingExceptionSpecChecks.swap(
11967 SavedEquivalentExceptionSpecChecks.swap(
11974 struct MisalignedMember {
11980 MisalignedMember() : E(), RD(), MD(), Alignment() {}
11983 : E(E), RD(RD), MD(MD), Alignment(Alignment) {}
11984 explicit MisalignedMember(Expr *E)
11985 : MisalignedMember(E,
nullptr,
nullptr,
CharUnits()) {}
11987 bool operator==(
const MisalignedMember &m) {
return this->E == m.E; }
12001 void DiagnoseMisalignedMembers();
12008 void DiscardMisalignedMemberAddress(
const Type *T, Expr *E);
12013 void RefersToMemberWithReducedAlignment(
12023 ConstructorDestructor,
12031 bool Entered =
true;
12036 Decl *LambdaContextDecl =
nullptr,
12038 Sema::ExpressionEvaluationContextRecord::EK_Other,
12039 bool ShouldEnter =
true)
12040 : Actions(Actions), Entered(ShouldEnter) {
12049 Sema::ExpressionEvaluationContextRecord::EK_Other)
12050 : Actions(Actions) {
12052 NewContext, Sema::ReuseLambdaContextDecl, ExprContext);
12057 bool ShouldEnter =
true)
12058 : Actions(Actions), Entered(
false) {
12066 Sema::ExpressionEvaluationContext::UnevaluatedList);
12112 return LHS.
FD == RHS.
FD && LHS.
Loc == RHS.
Loc;
FileNullabilityMap NullabilityMap
A mapping that describes the nullability we've seen in each header file.
Abstract class used to diagnose incomplete types.
The name denotes a member of a dependent type that could not be resolved.
ObjCInterfaceDecl * NSStringDecl
The declaration of the Objective-C NSString class.
PragmaStack< StringLiteral * > CodeSegStack
UnusedFileScopedDeclsType UnusedFileScopedDecls
The set of file scoped decls seen so far that have not been used and must warn if not used...
We are defining a synthesized function (such as a defaulted special member).
The name was classified as a variable template name.
static void collectUnexpandedParameterPacks(Sema &S, TemplateParameterList *Params, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded)
MSVtorDispMode
In the Microsoft ABI, this controls the placement of virtual displacement members used to implement v...
The lookup results will be used for redeclaration of a name, if an entity by that name already exists...
Represents a function declaration or definition.
bool RequireCompleteExprType(Expr *E, unsigned DiagID, const Ts &...Args)
static bool CheckConstraintSatisfaction(Sema &S, const NamedDecl *Template, ArrayRef< const Expr *> ConstraintExprs, ArrayRef< TemplateArgument > TemplateArgs, SourceRange TemplateIDRange, ConstraintSatisfaction &Satisfaction)
llvm::SmallSetVector< const TypedefNameDecl *, 4 > UnusedLocalTypedefNameCandidates
Set containing all typedefs that are likely unused.
A set of visible modules.
UnexpandedParameterPackContext
The context in which an unexpanded parameter pack is being diagnosed.
std::pair< llvm::PointerUnion< const TemplateTypeParmType *, NamedDecl * >, SourceLocation > UnexpandedParameterPack
SourceLocation getOptimizeOffPragmaLocation() const
Get the location for the currently active "\#pragma clang optimize off". If this location is invalid...
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
ExtVectorDeclsType ExtVectorDecls
ExtVectorDecls - This is a list all the extended vector types.
NestedNameSpecInfo(IdentifierInfo *II, SourceLocation IdLoc, SourceLocation ColonColonLoc, ParsedType ObjectType=ParsedType())
Creates info object for the most typical case.
ExternalSemaSource * getExternalSource() const
IncompatibleNestedPointerAddressSpaceMismatch - The assignment changes address spaces in nested point...
SuppressedDiagnosticsMap SuppressedDiagnostics
CXXMethodDecl * getMethod() const
no exception specification
~GlobalEagerInstantiationScope()
Smart pointer class that efficiently represents Objective-C method names.
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
void PushExpressionEvaluationContext(ExpressionEvaluationContext NewContext, Decl *LambdaContextDecl=nullptr, ExpressionEvaluationContextRecord::ExpressionKind Type=ExpressionEvaluationContextRecord::EK_Other)
if(T->getSizeExpr()) TRY_TO(TraverseStmt(T -> getSizeExpr()))
unsigned getRawEncoding() const
When a SourceLocation itself cannot be used, this returns an (opaque) 32-bit integer encoding for it...
PointerToInt - The assignment converts a pointer to an int, which we accept as an extension...
Stores the type being destroyed by a pseudo-destructor expression.
Struct to store the context selectors info.
A (possibly-)qualified type.
Keeps information about an identifier in a nested-name-spec.
GlobalEagerInstantiationScope(Sema &S, bool Enabled)
Simple class containing the result of Sema::CorrectTypo.
TemplateDeductionResult
Describes the result of template argument deduction.
LateTemplateParserCB * LateTemplateParser
SmallVectorImpl< Decl * > & WeakTopLevelDecls()
WeakTopLevelDeclDecls - access to #pragma weak-generated Decls.
Instantiation or recovery rebuild of a for-range statement.
NameClassification(const IdentifierInfo *Keyword)
void SentinelAction(PragmaMsStackAction Action, StringRef Label)
ASTConsumer - This is an abstract interface that should be implemented by clients that read ASTs...
~EnterExpressionEvaluationContext()
Defines enumerations for the type traits support.
A cast other than a C-style cast.
LateParsedTemplateMapT LateParsedTemplateMap
SmallVector< PackIncludeState, 8 > PackIncludeStack
A stack-allocated class that identifies which local variable declaration instantiations are present i...
llvm::MutableArrayRef< ImplicitConversionSequence > ConversionSequenceList
A list of implicit conversion sequences for the arguments of an OverloadCandidate.
static bool getPrintable(bool B)
bool operator==(CanQual< T > x, CanQual< U > y)
Code completion occurs within a class, struct, or union.
A requires-expression requirement which queries the validity and properties of an expression ('simple...
RecordDecl * MSVCGuidDecl
The MSVC "_GUID" struct, which is defined in MSVC header files.
std::vector< std::unique_ptr< TemplateInstantiationCallback > > TemplateInstCallbacks
The template instantiation callbacks to trace or track instantiations (objects can be chained)...
OpenCL supported extensions and optional core features.
PragmaStack< StringLiteral * > DataSegStack
Represents a lazily-loaded vector of data.
OverloadCandidateParamOrder
The parameter ordering that will be used for the candidate.
Emit the diagnostic immediately, and, if it's a warning or error, also emit a call stack showing how ...
ObjCBridgeCastKind
The kind of bridging performed by the Objective-C bridge cast.
std::unique_ptr< RecordDeclSetTy > PureVirtualClassDiagSet
PureVirtualClassDiagSet - a set of class declarations which we have emitted a list of pure virtual fu...
A class which encapsulates the logic for delaying diagnostics during parsing and other processing...
OpenMPDefaultmapClauseKind
OpenMP attributes for 'defaultmap' clause.
Specialize PointerLikeTypeTraits to allow LazyGenerationalUpdatePtr to be placed into a PointerUnion...
The name was classified as an ADL-only function template name.
A structure used to record information about a failed template argument deduction, for diagnosis.
static ConditionResult ConditionError()
Checking non-dependent argument conversions failed.
TypePropertyCache< Private > Cache
ObjCMessageKind
Describes the kind of message expression indicated by a message send that starts with an identifier...
Look up the name of an Objective-C protocol.
Decl * Entity
The entity that is being synthesized.
QualType CXXThisTypeOverride
When non-NULL, the C++ 'this' expression is allowed despite the current context not being a non-stati...
OpenCLOptions OpenCLFeatures
Stmt - This represents one statement.
NullabilityKind
Describes the nullability of a particular type.
We are matching the template parameter lists of two templates that might be redeclarations.
FunctionType - C99 6.7.5.3 - Function Declarators.
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 l...
FullExprArg MakeFullExpr(Expr *Arg)
Provides information about an attempted template argument deduction, whose success or failure was des...
Merge availability attributes for an override, which requires an exact match or a weakening of constr...
Microsoft __if_not_exists.
DefaultedComparisonKind asComparison() const
An instance of this object exists for each enum constant that is defined.
unsigned getDiagnosticIndex() const
Get the index of this function kind for use in diagnostics.
LazyVector< CXXConstructorDecl *, ExternalSemaSource, &ExternalSemaSource::ReadDelegatingConstructors, 2, 2 > DelegatingCtorDeclsType
The name refers to a function template or a set of overloaded functions that includes at least one fu...
Represents the declaration of a typedef-name via the 'typedef' type specifier.
SmallVector< std::pair< const CXXMethodDecl *, const CXXMethodDecl * >, 2 > DelayedOverridingExceptionSpecChecks
All the overriding functions seen during a class definition that had their exception spec checks dela...
llvm::StringRef StackSlotLabel
SmallVector< Scope *, 2 > CurrentSEHFinally
Stack of active SEH __finally scopes. Can be empty.
void setCurrentOpenCLExtension(llvm::StringRef Ext)
OriginalCallArg(QualType OriginalParamType, bool DecomposedParam, unsigned ArgIdx, QualType OriginalArgType)
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
Decl - This represents one declaration (or definition), e.g.
A normal translation unit fragment.
Captures information about "declaration specifiers" specific to Objective-C.
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
std::deque< PendingImplicitInstantiation > PendingInstantiations
The queue of implicit template instantiations that are required but have not yet been performed...
AssignConvertType
AssignConvertType - All of the 'assignment' semantic checks return this enum to indicate whether the ...
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Defines the C++ template declaration subclasses.
Scope * TUScope
Translation Unit Scope - useful to Objective-C actions that need to lookup file scope declarations in...
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
DeclContext * OriginalLexicalContext
Generally null except when we temporarily switch decl contexts, like in.
ParenExpr - This represents a parethesized expression, e.g.
SmallVector< CodeSynthesisContext, 16 > CodeSynthesisContexts
List of active code synthesis contexts.
SmallVector< Module *, 16 > CodeSynthesisContextLookupModules
Extra modules inspected when performing a lookup during a template instantiation. ...
The base class of the type hierarchy.
Classification failed; an error has been produced.
std::deque< PendingImplicitInstantiation > PendingLocalImplicitInstantiations
The queue of implicit template instantiations that are required and must be performed within the curr...
void AddFactoryMethodToGlobalPool(ObjCMethodDecl *Method, bool impl=false)
AddFactoryMethodToGlobalPool - Same as above, but for factory methods.
SmallVector< PragmaAttributeEntry, 2 > Entries
llvm::MapVector< const FunctionDecl *, std::unique_ptr< LateParsedTemplate > > LateParsedTemplateMapT
~SynthesizedFunctionScope()
MissingImportKind
Kinds of missing import.
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Declaration of a variable template.
TemplateParamListContext
The context in which we are checking a template parameter list.
Represent a C++ namespace.
Template argument deduction produced inconsistent deduced values for the given template parameter...
RedeclarationKind
Specifies whether (or how) name lookup is being performed for a redeclaration (vs.
static FunctionDeclAndLoc getEmptyKey()
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
LazyVector< const DeclaratorDecl *, ExternalSemaSource, &ExternalSemaSource::ReadUnusedFileScopedDecls, 2, 2 > UnusedFileScopedDeclsType
A container of type source information.
static const IdentifierInfo * getPrintable(const IdentifierInfo *II)
Store information needed for an explicit specifier.
Wrapper for void* pointer.
Parser - This implements a parser for the C family of languages.
Look up of a name that precedes the '::' scope resolution operator in C++.
std::pair< ValueDecl *, SourceLocation > PendingImplicitInstantiation
An entity for which implicit template instantiation is required.
bool hasVisibleDeclaration(const NamedDecl *D, llvm::SmallVectorImpl< Module *> *Modules=nullptr)
Determine whether any declaration of an entity is visible.
Floating point control options.
We are instantiating a default argument for a template parameter.
DelayedDiagnosticsState pushUndelayed()
Enter a new scope where access and deprecation diagnostics are not delayed.
Abstract base class used for diagnosing integer constant expression violations.
FileNullability Nullability
Represents a path from a specific derived class (which is not represented as part of the path) to a p...
LiteralOperatorLookupResult
The possible outcomes of name lookup for a literal operator.
Represents a C++ constructor within a class.
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
OpenMPDefaultmapClauseModifier
OpenMP modifiers for 'defaultmap' clause.
SpecialMemberOverloadResultEntry(const llvm::FoldingSetNodeID &ID)
unsigned NonInstantiationEntries
The number of CodeSynthesisContexts that are not template instantiations and, therefore, should not be counted as part of the instantiation depth.
NameClassificationKind getKind() const
static void MarkUsedTemplateParameters(ASTContext &Ctx, const TemplateArgument &TemplateArg, bool OnlyDeduced, unsigned Depth, llvm::SmallBitVector &Used)
Mark the template parameters that are used by this template argument.
VerifyICEDiagnoser(bool Suppress=false)
EnterExpressionEvaluationContext(Sema &Actions, Sema::ExpressionEvaluationContext NewContext, Sema::ReuseLambdaContextDecl_t, Sema::ExpressionEvaluationContextRecord::ExpressionKind ExprContext=Sema::ExpressionEvaluationContextRecord::EK_Other)
RAII object to handle the state changes required to synthesize a function body.
Look up a namespace name within a C++ using directive or namespace alias definition, ignoring non-namespace names (C++ [basic.lookup.udir]p1).
Consumes visible declarations found when searching for all visible names within a given scope or cont...
bool DisableTypoCorrection
Tracks whether we are in a context where typo correction is disabled.
Retains information about a function, method, or block that is currently being parsed.
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
RAII object that enters a new expression evaluation context.
Represents a variable declaration or definition.
IfExistsResult
Describes the result of an "if-exists" condition check.
ExpressionKind
Describes whether we are in an expression constext which we have to handle differently.
CleanupInfo Cleanup
Used to control the generation of ExprWithCleanups.
Information about one declarator, including the parsed type information and the identifier.
DiagnosticsEngine & Diags
llvm::SmallSetVector< DeclContext *, 16 > AssociatedNamespaceSet
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
PrintingPolicy getPrintingPolicy() const
Retrieve a suitable printing policy for diagnostics.
bool This(InterpState &S, CodePtr OpPC)
llvm::SmallPtrSet< const NamedDecl *, 4 > TypoCorrectedFunctionDefinitions
The function definitions which were renamed as part of typo-correction to match their respective decl...
Records and restores the FP_CONTRACT state on entry/exit of compound statements.
Extra information about a function prototype.
ExpressionEvaluationContextRecord(ExpressionEvaluationContext Context, unsigned NumCleanupObjects, CleanupInfo ParentCleanup, Decl *ManglingContextDecl, ExpressionKind ExprContext)
TypeSpecifierType
Specifies the kind of type.
LangAS
Defines the address space values used by the address space qualifier of QualType. ...
Represents a variable template specialization, which refers to a variable template with a given set o...
ObjCMethodDecl - Represents an instance or class method declaration.
SmallVector< CXXRecordDecl *, 4 > DelayedDllExportClasses
void diagnose(Sema &S, SourceLocation Loc, QualType T) override
ExprResult ActOnFinishFullExpr(Expr *Expr, bool DiscardedValue)
RAII object used to temporarily allow the C++ 'this' expression to be used, with the given qualifiers...
llvm::MapVector< NamedDecl *, SourceLocation > UndefinedButUsed
UndefinedInternals - all the used, undefined objects which require a definition in this translation u...
The lookup found a single 'cooked' literal operator, which expects a normal literal to be built and p...
static NameClassification UndeclaredNonType()
PragmaClangSection PragmaClangBSSSection
BoundTypeDiagnoser(unsigned DiagID, const Ts &...Args)
Stores a list of template parameters for a TemplateDecl and its derived classes.
Describes how types, statements, expressions, and declarations should be printed. ...
A context in which code is being synthesized (where a source location alone is not sufficient to iden...
Code completion occurs within an Objective-C implementation or category implementation.
ObjCMethodDecl * ValueWithBytesObjCTypeMethod
The declaration of the valueWithBytes:objCType: method.
llvm::MapVector< Selector, SourceLocation > ReferencedSelectors
Method selectors used in a @selector expression.
bool IsDecltype
Whether we are in a decltype expression.
NestedNameSpecInfo(IdentifierInfo *II, SourceLocation IdLoc, SourceLocation ColonColonLoc, QualType ObjectType)
SourceLocation PragmaLocation
Look up an ordinary name that is going to be redeclared as a name with linkage.
FunctionProtoType::ExceptionSpecInfo getExceptionSpec() const
Overwrite an EPI's exception specification with this computed exception specification.
Represents a parameter to a function.
OpenCLOptions & getOpenCLOptions()
Defines the clang::Expr interface and subclasses for C++ expressions.
ObjCInterfaceDecl * NSDictionaryDecl
The declaration of the Objective-C NSDictionary class.
The name was classified as a non-type, and an expression representing that name has been formed...
FPOptions & getFPOptions()
const TemplateArgument * TemplateArgs
The list of template arguments we are substituting, if they are not part of the entity.
The collection of all-type qualifiers we support.
Information about a template-id annotation token.
static SourceRange getPrintable(TypeLoc TL)
void setMethod(CXXMethodDecl *MD)
void threadSafetyCleanup(BeforeSet *Cache)
Base wrapper for a particular "section" of type source info.
Represents a struct/union/class.
enum clang::Sema::CodeSynthesisContext::SynthesisKind Kind
friend const SemaDiagnosticBuilder & operator<<(const SemaDiagnosticBuilder &Diag, const T &Value)
Teach operator<< to produce an object of the correct type.
ContextualImplicitConverter(bool Suppress=false, bool SuppressConversion=false)
Represents a class template specialization, which refers to a class template with a given set of temp...
One of these records is kept for each identifier that is lexed.
std::unique_ptr< NSAPI > NSAPIObj
Caches identifiers/selectors for NSFoundation APIs.
LocalInstantiationScope * CurrentInstantiationScope
The current instantiation scope used to store local variables.
The lookup found a single 'raw' literal operator, which expects a string literal containing the spell...
IntToPointer - The assignment converts an int to a pointer, which we accept as an extension...
CompoundScopeRAII(Sema &S, bool IsStmtExpr=false)
SmallVector< std::pair< FunctionDecl *, FunctionDecl * >, 2 > DelayedEquivalentExceptionSpecChecks
All the function redeclarations seen during a class definition that had their exception spec checks d...
IncompatibleObjCWeakRef - Assigning a weak-unavailable object to an object with __weak qualifier...
Enumerator value with fixed underlying type.
Value of a non-type template parameter.
Represents a class type in Objective C.
CallingConventionIgnoredReason
Describes the reason a calling convention specification was ignored, used for diagnostics.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
A C++ nested-name-specifier augmented with source location information.
Lookup for the name failed, but we're assuming it was a template name anyway.
bool inTemplateInstantiation() const
Determine whether we are currently performing template instantiation.
The results of name lookup within a DeclContext.
Base class for callback objects used by Sema::CorrectTypo to check the validity of a potential typo c...
ImplicitExceptionSpecification(Sema &Self)
DefaultedFunctionKind(CXXSpecialMember CSM)
FunctionScopeRAII(Sema &S)
FileNullability & operator[](FileID file)
OpenMPLinearClauseKind
OpenMP attributes for 'linear' clause.
Represents a member of a struct/union/class.
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.
std::unique_ptr< sema::FunctionScopeInfo > CachedFunctionScope
threadSafety::BeforeSet * ThreadSafetyDeclCache
ObjCInterfaceDecl * NSValueDecl
The declaration of the Objective-C NSValue class.
UnaryExprOrTypeTrait
Names for the "expression or type" traits.
NamedDecl * Template
The template (or partial specialization) in which we are performing the instantiation, for substitutions of prior template arguments.
DefaultedComparisonKind
Kinds of defaulted comparison operator functions.
Code completion occurs following one or more template headers within a class.
This is not an overload because the signature exactly matches an existing declaration.
The iterator over UnresolvedSets.
Token - This structure provides full information about a lexed token.
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
CompatiblePointerDiscardsQualifiers - The assignment discards c/v/r qualifiers, which we accept as an...
ParsingDeclState PushParsingDeclaration(sema::DelayedDiagnosticPool &pool)
The fixed underlying type of an enumeration.
bool isExternallyDeclarable() const
Determine whether this declaration can be redeclared in a different translation unit.
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
TemplateName getTemplateName() const
LazyVector< VarDecl *, ExternalSemaSource, &ExternalSemaSource::ReadTentativeDefinitions, 2, 2 > TentativeDefinitionsType
A conditional (?:) operator.
Defines some OpenMP-specific enums and functions.
OpaquePtr< QualType > ParsedType
An opaque type for threading parsed type information through the parser.
Represents an access specifier followed by colon ':'.
The type of a non-type template parameter.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
ArrayRef< std::pair< IdentifierInfo *, SourceLocation > > ModuleIdPath
A sequence of identifier/location pairs used to describe a particular module or submodule, e.g., std.vector.
i32 captured_struct **param SharedsTy A type which contains references the shared variables *param Shareds Context with the list of shared variables from the p *TaskFunction *param Data Additional data for task generation like final * state
void PopExpressionEvaluationContext()
OverloadKind
C++ Overloading.
Code completion occurs where only a type is permitted.
Describes a module or submodule.
llvm::BumpPtrAllocator BumpAlloc
ObjCMethodDecl * LookupFactoryMethodInGlobalPool(Selector Sel, SourceRange R, bool receiverIdOrClass=false)
LookupFactoryMethodInGlobalPool - Returns the method and warns if there are multiple signatures...
bool isConstantEvaluated()
This little struct is used to capture information about structure field declarators, which is basically just a bitfield size.
SpecialMemberOverloadResult - The overloading result for a special member function.
bool AccessCheckingSFINAE
When true, access checking violations are treated as SFINAE failures rather than hard errors...
An r-value expression (a pr-value in the C++11 taxonomy) produces a temporary value.
The type of an exception.
The name was classified as a type.
Code completion occurs at top-level or namespace context.
The name was classified as a template whose specializations are types.
A pair of a canonical FunctionDecl and a SourceLocation.
We are instantiating the exception specification for a function template which was deferred until it ...
SemaDiagnosticBuilder(DiagnosticBuilder &DB, Sema &SemaRef, unsigned DiagID)
OpenMPDistScheduleClauseKind
OpenMP attributes for 'dist_schedule' clause.
An allocator used specifically for the purpose of code completion.
unsigned TyposCorrected
The number of typos corrected by CorrectTypo.
Describes an C or C++ initializer list.
Represents a C++ using-declaration.
Code completion occurs within the body of a function on a recovery path, where we do not have a speci...
llvm::SmallVector< QualType, 4 > CurrentParameterCopyTypes
Stack of types that correspond to the parameter entities that are currently being copy-initialized...
Represents a C++ unqualified-id that has been parsed.
bool isCompleteType(SourceLocation Loc, QualType T)
ParsedAttributesView ArgAttrs
ArgAttrs - Attribute list for this argument.
static ExprResult CheckConvertedConstantExpression(Sema &S, Expr *From, QualType T, APValue &Value, Sema::CCEKind CCE, bool RequireInt)
CheckConvertedConstantExpression - Check that the expression From is a converted constant expression ...
Look up implicit 'self' parameter of an objective-c method.
ReferenceConversions
The conversions that would be performed on an lvalue of type T2 when binding a reference of type T1 t...
Represents the results of name lookup.
static const std::string & getPrintable(const std::string &S)
RAII class used to indicate that we are performing provisional semantic analysis to determine the val...
ObjCContainerDecl - Represents a container for method declarations.
static NameClassification UndeclaredTemplate(TemplateName Name)
CharUnits - This is an opaque type for sizes expressed in character units.
TemplateSpecCandidateSet - A set of generalized overload candidates, used in template specializations...
A convenient class for passing around template argument information.
bool AllowAbstractFieldReference
A flag to indicate that we're in a context that permits abstract references to fields.
bool isObjCMethodDecl(Decl *D)
ICEConvertDiagnoser(bool AllowScopedEnumerations, bool Suppress, bool SuppressConversion)
We are checking the satisfaction of a nested requirement of a requires expression.
Code completion occurs following one or more template headers.
The base type of a class type.
Look up all declarations in a scope with the given name, including resolved using declarations...
Code completion occurs within an expression.
PragmaStack(const ValueType &Default)
std::pair< SourceLocation, bool > DeleteExprLoc
Delete-expressions to be analyzed at the end of translation unit.
unsigned LayoutCompatible
If true, Type should be compared with other expression's types for layout-compatibility.
ExprResult getExpression() const
Concrete class used by the front-end to report problems and issues.
void incrementMSManglingNumber() const
MSInheritanceModel
Assigned inheritance model for a class in the MS C++ ABI.
llvm::DenseSet< Module * > LookupModulesCache
Cache of additional modules that should be used for name lookup within the current template instantia...
GlobalMethodPool MethodPool
Method Pool - allows efficient lookup when typechecking messages to "id".
Represents a declaration of a type.
Substitution of the deduced template argument values resulted in an error.
The name has been typo-corrected to a keyword.
A set of unresolved declarations.
SmallVector< VarDecl *, 4 > ExternalDeclarations
All the external declarations encoutered and used in the TU.
SourceLocation PointOfInstantiation
The point of instantiation or synthesis within the source code.
Look up the name of an OpenMP user-defined reduction operation.
Template argument deduction exceeded the maximum template instantiation depth (which has already been...
void MarkDeducedTemplateParameters(const FunctionTemplateDecl *FunctionTemplate, llvm::SmallBitVector &Deduced)
CheckedConversionKind
The kind of conversion being performed.
EnterExpressionEvaluationContext(Sema &Actions, InitListTag, bool ShouldEnter=true)
std::pair< StringRef, QualType > CapturedParamNameType
std::function< ExprResult(Sema &, TypoExpr *, TypoCorrection)> TypoRecoveryCallback
virtual ~VerifyICEDiagnoser()
LazyDeclPtr StdBadAlloc
The C++ "std::bad_alloc" class, which is defined by the C++ standard library.
Scope - A scope is a transient data structure that is used while parsing the program.
The type of a data member.
PreferredTypeBuilder(QualType Type)
CaseStmt - Represent a case statement.
NonTagKind
Common ways to introduce type names without a tag for use in diagnostics.
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
void popUndelayed(DelayedDiagnosticsState state)
Undo a previous pushUndelayed().
SourceLocation Loc
The location of the push attribute.
Represents a C++ nested-name-specifier or a global scope specifier.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Represents an Objective-C protocol declaration.
llvm::DenseMap< Decl *, SmallVector< PartialDiagnosticAt, 1 > > SuppressedDiagnosticsMap
For each declaration that involved template argument deduction, the set of diagnostics that were supp...
ArrayTypeTrait
Names for the array type traits.
const internal::VariadicDynCastAllOfMatcher< Stmt, CastExpr > castExpr
Matches any cast nodes of Clang's AST.
static bool checkAddressOfFunctionIsAvailable(Sema &S, const FunctionDecl *FD, bool Complain, bool InOverloadResolution, SourceLocation Loc)
Returns true if we can take the address of the function.
void incrementMSManglingNumber()
ObjCInterfaceDecl * NSNumberDecl
The declaration of the Objective-C NSNumber class.
const LangOptions & getLangOpts() const
QualType OriginalParamType
sema::AnalysisBasedWarnings AnalysisWarnings
Worker object for performing CFG-based warnings.
SmallVector< BoundNodes, 1 > match(MatcherT Matcher, const NodeT &Node, ASTContext &Context)
Returns the results of matching Matcher on Node.
MaybeODRUseExprSet MaybeODRUseExprs
Represents the body of a CapturedStmt, and serves as its DeclContext.
bool isUnevaluatedContext() const
Determines whether we are currently in a context that is not evaluated as per C++ [expr] p5...
Represents an ObjC class declaration.
SmallVector< LambdaExpr *, 2 > Lambdas
The lambdas that are present within this context, if it is indeed an unevaluated context.
Member name lookup, which finds the names of class/struct/union members.
IncompatiblePointerSign - The assignment is between two pointers types which point to integers which ...
llvm::omp::Directive OpenMPDirectiveKind
OpenMP directives.
NamespaceDecl * StdExperimentalNamespaceCache
The C++ "std::experimental" namespace, where the experimental parts of the standard library resides...
llvm::DenseMap< IdentifierInfo *, AsmLabelAttr * > ExtnameUndeclaredIdentifiers
ExtnameUndeclaredIdentifiers - Identifiers contained in #pragma redefine_extname before declared...
bool mightBeIntendedToBeTemplateName(ExprResult E, bool &Dependent)
Determine whether it's plausible that E was intended to be a template-name.
FullExprArg(Sema &actions)
ObjCMethodDecl * StringWithUTF8StringMethod
The declaration of the stringWithUTF8String: method.
const LangOptions & LangOpts
static NameClassification TypeTemplate(TemplateName Name)
RAII object used to change the argument pack substitution index within a Sema object.
uint8_t PointerKind
Which kind of pointer declarator we saw.
Contains information about the compound statement currently being parsed.
TemplateNameKindForDiagnostics
Describes the detailed kind of a template name. Used in diagnostics.
Represents the this expression in C++.
ParsingClassState PushParsingClass()
unsigned NumCleanupObjects
The number of active cleanup objects when we entered this expression evaluation context.
llvm::SmallVector< DeleteExprLoc, 4 > DeleteLocs
A helper class for building up ExtParameterInfos.
void AddInstanceMethodToGlobalPool(ObjCMethodDecl *Method, bool impl=false)
AddInstanceMethodToGlobalPool - All instance methods in a translation unit are added to a global pool...
TypeTrait
Names for traits that operate specifically on types.
We are matching the template parameter lists of two template template parameters as part of matching ...
DiagnosticsEngine & getDiagnostics() const
CXXSpecialMember asSpecialMember() const
RAII class used to determine whether SFINAE has trapped any errors that occur during template argumen...
Defines the clang::TemplateNameKind enum.
ArgumentPackSubstitutionIndexRAII(Sema &Self, int NewSubstitutionIndex)
CXXSpecialMember
Kinds of C++ special members.
static Sema::TemplateDeductionResult DeduceTemplateArguments(Sema &S, TemplateParameterList *TemplateParams, const TemplateArgument &Param, TemplateArgument Arg, TemplateDeductionInfo &Info, SmallVectorImpl< DeducedTemplateArgument > &Deduced)
llvm::Optional< bool > getKnownValue() const
We are substituting explicit template arguments provided for a function template. ...
IdentifierInfo * IdentInfo
Sema - This implements semantic analysis and AST building for C.
Merge availability attributes for an implementation of a protocol requirement.
A little helper class used to produce diagnostics.
A requires-expression requirement which queries the existence of a type name or type template special...
Represents a prototype with parameter type info, e.g.
SmallVector< CallExpr *, 8 > DelayedDecltypeCalls
If we are processing a decltype type, a set of call expressions for which we have deferred checking t...
TentativeDefinitionsType TentativeDefinitions
All the tentative definitions encountered in the TU.
ResultTypeCompatibilityKind
Describes the compatibility of a result type with its method.
llvm::DenseMap< Selector, GlobalMethods > GlobalMethodPool
static bool isEqual(const FunctionDeclAndLoc &LHS, const FunctionDeclAndLoc &RHS)
Retains information about a captured region.
llvm::SmallPtrSet< Selector, 8 > SelectorSet
A RAII object to enter scope of a compound statement.
Represents a ValueDecl that came out of a declarator.
CastKind
CastKind - The kind of operation required for a conversion.
CXXSpecialMember getSpecialMember(const CXXMethodDecl *MD)
The return type of classify().
friend const DeviceDiagBuilder & operator<<(const DeviceDiagBuilder &Diag, const T &Value)
The name was classified as a function template name.
Template argument deduction did not deduce a value for every template parameter.
static FunctionDeclAndLoc getTombstoneKey()
FunctionVoidPointer - The assignment is between a function pointer and void*, which the standard does...
llvm::FoldingSet< SpecialMemberOverloadResultEntry > SpecialMemberCache
A cache of special member function overload resolution results for C++ records.
ArraySizeModifier
Capture whether this is a normal array (e.g.
llvm::SmallPtrSet< Expr *, 2 > MaybeODRUseExprSet
Store a set of either DeclRefExprs or MemberExprs that contain a reference to a variable (constant) t...
const Decl * PragmaAttributeCurrentTargetDecl
The declaration that is currently receiving an attribute from the #pragma attribute stack...
TemplateParameterListEqualKind
Enumeration describing how template parameter lists are compared for equality.
DelayedDiagnosticsState ParsingDeclState
We are instantiating a template declaration.
Captures information about a #pragma weak directive.
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
std::function< void(const TypoCorrection &)> TypoDiagnosticGenerator
This represents '#pragma omp requires...' directive.
Scope * getCurScope() const
Retrieve the parser's current scope.
llvm::PointerIntPair< CXXRecordDecl *, 3, CXXSpecialMember > SpecialMemberDecl
void runWithSufficientStackSpace(llvm::function_ref< void()> Diag, llvm::function_ref< void()> Fn)
Run a given function on a stack with "sufficient" space.
SourceLocation IdentifierLoc
The location of the identifier.
Allows QualTypes to be sorted and hence used in maps and sets.
NameClassification(ParsedType Type)
OpenMPLastprivateModifier
OpenMP 'lastprivate' clause modifier.
SmallVector< PendingImplicitInstantiation, 1 > LateParsedInstantiations
Queue of implicit template instantiations that cannot be performed eagerly.
Retains information about a block that is currently being parsed.
void popWithoutEmitting(DelayedDiagnosticsState state)
Leave a delayed-diagnostic state that was previously pushed.
const char * getTypeName(ID Id)
getTypeName - Return the name of the type for Id.
llvm::DenseSet< FunctionDeclAndLoc > LocsWithCUDACallDiags
FunctionDecls and SourceLocations for which CheckCUDACall has emitted a (maybe deferred) "bad call" d...
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
This represents one expression.
LookupNameKind
Describes the kind of name lookup to perform.
SmallVector< Decl *, 2 > WeakTopLevelDecl
WeakTopLevelDecl - Translation-unit scoped declarations generated by #pragma weak during processing o...
DelayedDiagnosticsState push(sema::DelayedDiagnosticPool &pool)
Enter a new scope.
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
Represents the body of a requires-expression.
Slot(llvm::StringRef StackSlotLabel, ValueType Value, SourceLocation PragmaLocation, SourceLocation PragmaPushLocation)
Helper class that collects exception specifications for implicitly-declared special member functions...
When performing template argument deduction for a function template, there were too many call argumen...
llvm::SmallPtrSet< const Decl *, 4 > ParsingInitForAutoVars
ParsingInitForAutoVars - a set of declarations with auto types for which we are currently parsing the...
Look up the name of an OpenMP user-defined mapper.
Declaration of a template type parameter.
The message is an instance message.
This file defines the classes used to store parsed information about declaration-specifiers and decla...
bool isInvalid() const
Determines whether we have exceeded the maximum recursive template instantiations.
We are substituting template argument determined as part of template argument deduction for either a ...
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
The name was classified as a specific non-type, non-template declaration.
Represents a C++ destructor within a class.
LazyDeclPtr StdNamespace
The C++ "std" namespace, where the standard library resides.
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
SpecialMemberOverloadResult()
The name refers to a concept.
Code completion occurs within an Objective-C interface, protocol, or category.
bool InNonInstantiationSFINAEContext
Whether we are in a SFINAE context that is not associated with template instantiation.
IncompatibleVectors - The assignment is between two vector types that have the same size...
llvm::MapVector< IdentifierInfo *, WeakInfo > WeakUndeclaredIdentifiers
WeakUndeclaredIdentifiers - Identifiers contained in #pragma weak before declared.
OpenMPClauseKind
OpenMP clauses.
MaybeODRUseExprSet SavedMaybeODRUseExprs
QualType FindCompositePointerType(SourceLocation Loc, ExprResult &E1, ExprResult &E2, bool ConvertArgs=true)
PragmaStack< StringLiteral * > BSSSegStack
Initial building of a for-range statement.
When performing template argument deduction for a function template, there were too few call argument...
IdentifierResolver - Keeps track of shadowed decls on enclosing scopes.
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
CXXTryStmt - A C++ try block, including all handlers.
llvm::PointerUnion< TemplateTypeParmDecl *, NonTypeTemplateParmDecl *, TemplateTemplateParmDecl * > TemplateParameter
Stores a template parameter of any kind.
IncompatiblePointerDiscardsQualifiers - The assignment discards qualifiers that we don't permit to be...
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
Ref_Related - The two types are reference-related, which means that their unqualified forms (T1 and T...
Represents a C++ template name within the type system.
QualType NSNumberPointer
Pointer to NSNumber type (NSNumber *).
ReferenceCompareResult
ReferenceCompareResult - Expresses the result of comparing two types (cv1 T1 and cv2 T2) to determine...
Defines the clang::TypeLoc interface and its subclasses.
Keeps track of expected type during expression parsing.
bool isVisible(const NamedDecl *D)
Determine whether a declaration is visible to name lookup.
Code completion occurs within a statement, which may also be an expression or a declaration.
NamedDecl * getNonTypeDecl() const
TemplateNameKind
Specifies the kind of template name that an identifier refers to.
SmallVector< LateInstantiatedAttribute, 16 > LateInstantiatedAttrVec
SmallVector< VTableUse, 16 > VTableUses
The list of vtables that are required but have not yet been materialized.
An RAII helper that pops function a function scope on exit.
StorageClass
Storage classes.
CleanupInfo ParentCleanup
Whether the enclosing context needed a cleanup.
Module * getOwningModule(const Decl *Entity)
Get the module owning an entity.
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 paramete...
SmallVector< sema::FunctionScopeInfo *, 4 > FunctionScopes
Stack containing information about each of the nested function, block, and method scopes that are cur...
Provides LLVM's BitmaskEnum facility to enumeration types declared in namespace clang.
InClassInitStyle
In-class initialization styles for non-static data members.
For a defaulted function, the kind of defaulted function that it is.
An expression that sends a message to the given Objective-C object or class.
A mapping from file IDs to a record of whether we've seen nullability information in that file...
Data structure that captures multiple levels of template argument lists for use in template instantia...
llvm::SmallPtrSet< const Expr *, 8 > PossibleDerefs
Preprocessor & getPreprocessor() const
IdentifierInfo * Identifier
The identifier preceding the '::'.
bool RequireCompleteType(SourceLocation Loc, QualType T, unsigned DiagID, const Ts &...Args)
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
ObjCMethodDecl * ArrayWithObjectsMethod
The declaration of the arrayWithObjects:count: method.
const FunctionProtoType::ExtParameterInfo * getPointerOrNull(unsigned numParams)
Return a pointer (suitable for setting in an ExtProtoInfo) to the ExtParameterInfo array we've built ...
void addContextNote(SourceLocation UseLoc)
SmallVector< attr::SubjectMatchRule, 4 > MatchRules
After substituting deduced template arguments, a dependent parameter type did not match the correspon...
Represents a C++ conversion function within a class.
We are instantiating a requirement of a requires expression.
Code completion occurs within the list of instance variables in an Objective-C interface, protocol, category, or implementation.
ObjCTypeParamVariance
Describes the variance of a given generic parameter.
PragmaClangSectionKind
pragma clang section kind
ObjCKeywordKind
Provides a namespace for Objective-C keywords which start with an '@'.
SmallVector< CXXMethodDecl *, 4 > DelayedDllExportMemberFunctions
CallingConv
CallingConv - Specifies the calling convention that a function uses.
SourceLocation PointerLoc
The first pointer declarator (of any pointer kind) in the file that does not have a corresponding nul...
unsigned NumSFINAEErrors
The number of SFINAE diagnostics that have been trapped.
OverloadCandidateRewriteKind
The kinds of rewrite we perform on overload candidates.
This is a legitimate overload: the existing declarations are functions or function templates with dif...
An abstract interface that should be implemented by external AST sources that also provide informatio...
~LocalEagerInstantiationScope()
ExprResult CorrectDelayedTyposInExpr(ExprResult ER, llvm::function_ref< ExprResult(Expr *)> Filter)
CanonicalDeclPtr< FunctionDecl > FD
static StringRef getPrintable(StringRef S)
DelegatingCtorDeclsType DelegatingCtorDecls
All the delegating constructors seen so far in the file, used for cycle detection at the end of the T...
static NameClassification NonType(NamedDecl *D)
AvailabilityPriority
Describes the kind of priority given to an availability attribute.
std::pair< const IdentifierInfo *, uint64_t > TypeTagMagicValue
A pair of ArgumentKind identifier and magic value.
noexcept(expression), evals to 'false'
LazyVector< TypedefNameDecl *, ExternalSemaSource, &ExternalSemaSource::ReadExtVectorDecls, 2, 2 > ExtVectorDeclsType
bool hasVisibleDefinition(const NamedDecl *D)
StringLiteral * CurInitSeg
Last section used with #pragma init_seg.
CanThrowResult
Possible results from evaluation of a noexcept expression.
bool isComputedNoexcept(ExceptionSpecificationType ESpecType)
static unsigned getPrintable(unsigned I)
static bool DiagnoseUnexpandedParameterPacks(Sema &S, TemplateTemplateParmDecl *TTP)
Check for unexpanded parameter packs within the template parameters of a template template parameter...
Represents a C++ Modules TS module export declaration.
NameClassificationKind
Describes the result of the name lookup and resolution performed by ClassifyName().
bool isComparison() const
void pushCodeSynthesisContext(CodeSynthesisContext Ctx)
We are declaring an implicit special member function.
CXXSpecialMember SpecialMember
The special member being declared or defined.
Tag name lookup, which finds the names of enums, classes, structs, and unions.
RecordDecl * CXXTypeInfoDecl
The C++ "type_info" declaration, which is defined in <typeinfo>.
A reference to an overloaded function set, either an UnresolvedLookupExpr or an UnresolvedMemberExpr...
ImplicitConversionSequence - Represents an implicit conversion sequence, which may be a standard conv...
ActionResult - This structure is used while parsing/acting on expressions, stmts, etc...
ExceptionSpecificationType Type
The kind of exception specification this is.
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
SmallVector< CXXBaseSpecifier *, 4 > CXXCastPath
A simple array of base specifiers.
Represents the parsed form of a C++ template argument.
A stack object to be created when performing template instantiation.
TypeTagData(QualType Type, bool LayoutCompatible, bool MustBeNull)
ASTContext & getASTContext() const
LazyDeclPtr StdAlignValT
The C++ "std::align_val_t" enum class, which is defined by the C++ standard library.
llvm::SmallDenseMap< const ValueDecl *, const Expr *, 4 > VarsWithInheritedDSAType
DeduceAutoResult
Result type of DeduceAutoType.
Encodes a location in the source.
static NameClassification DependentNonType()
We are computing the exception specification for a defaulted special member function.
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
Defines enumerations for expression traits intrinsics.
SourceLocation CurrentPragmaLocation
Diagnostic builder for CUDA/OpenMP devices errors which may or may not be deferred.
static unsigned getHashValue(const FunctionDeclAndLoc &FDL)
static const char * getPrintable(const char *S)
sema::TemplateDeductionInfo * DeductionInfo
The template deduction info object associated with the substitution or checking of explicit or deduce...
PragmaStack< MSVtorDispMode > VtorDispStack
Whether to insert vtordisps prior to virtual bases in the Microsoft C++ ABI.
static SourceRange getPrintable(const Expr *E)
ArithConvKind
Context in which we're performing a usual arithmetic conversion.
Template argument deduction failed due to inconsistent cv-qualifiers on a template parameter type tha...
Represents the declaration of a struct/union/class/enum.
Represents the declaration of a label.
IncompatiblePointer - The assignment is between two pointers types that are not compatible, but we accept them as an extension.
ParsedAttr - Represents a syntactic attribute.
Template argument deduction did not deduce a value for every expansion of an expanded template parame...
SynthesisKind
The kind of template instantiation we are performing.
DelayedDiagnosticsState ProcessingContextState
Decl * ManglingContextDecl
The declaration that provides context for lambda expressions and block literals if the normal declara...
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
ClassTemplateDecl * StdInitializerList
The C++ "std::initializer_list" template, which is defined in <initializer_list>. ...
std::pair< SourceLocation, PartialDiagnostic > PartialDiagnosticAt
A partial diagnostic along with the source location where this diagnostic occurs. ...
bool isMemberAccessibleForDeletion(CXXRecordDecl *NamingClass, DeclAccessPair Found, QualType ObjectType)
Represents a static or instance method of a struct/union/class.
ParsedType getType() const
SourceLocation CCLoc
The location of the '::'.
bool shouldDelayDiagnostics()
Determines whether diagnostics should be delayed.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
Only look for allocation functions in the scope of the allocated class.
TemplateNameKind getTemplateNameKind() const
llvm::SmallPtrSet< const CXXRecordDecl *, 8 > RecordDeclSetTy
SFINAETrap(Sema &SemaRef, bool AccessCheckingSFINAE=false)
This name is not a type or template in this context, but might be something else. ...
We are checking the validity of a default template argument that has been used when naming a template...
The declaration was invalid; do nothing.
static DeclarationName getPrintable(DeclarationName N)
ObjCCategoryDecl - Represents a category declaration.
This is a basic class for representing single OpenMP clause.
The message is sent to 'super'.
static bool hasVisibleDefaultArgument(Sema &S, const ParmDecl *D, llvm::SmallVectorImpl< Module *> *Modules)
static bool isCast(CheckedConversionKind CCK)
bool CollectStats
Flag indicating whether or not to collect detailed statistics.
static void CheckBoolLikeConversion(Sema &S, Expr *E, SourceLocation CC)
Check conversion of given expression to boolean.
TokenKind
Provides a simple uniform namespace for tokens from all C languages.
SourceLocation PragmaLocation
bool RequireNonAbstractType(SourceLocation Loc, QualType T, unsigned DiagID, const Ts &...Args)
Describes the kind of initialization being performed, along with location information for tokens rela...
A compound assignment expression.
void EmitCurrentDiagnostic(unsigned DiagID)
Cause the active diagnostic on the DiagosticsEngine to be emitted.
SourceLocation OptimizeOffPragmaLocation
This represents the last location of a "#pragma clang optimize off" directive if such a directive has...
Defines the clang::Module class, which describes a module in the source code.
Represents a C++11 virt-specifier-seq.
CodeCompleteConsumer * CodeCompleter
Code-completion consumer.
unsigned NumTypos
The number of typos encountered during this expression evaluation context (i.e.
Represents one property declaration in an Objective-C interface.
void SetLateTemplateParser(LateTemplateParserCB *LTP, LateTemplateParserCleanupCB *LTPCleanup, void *P)
OpaquePtr< TemplateName > TemplateTy
llvm::DenseSet< std::pair< Decl *, unsigned > > InstantiatingSpecializations
Specializations whose definitions are currently being instantiated.
llvm::SmallSetVector< CXXRecordDecl *, 16 > AssociatedClassSet
const IdentifierInfo * Namespace
The namespace of this push group.
constexpr XRayInstrMask None
std::unique_ptr< CXXFieldCollector > FieldCollector
FieldCollector - Collects CXXFieldDecls during parsing of C++ classes.
static NameClassification FunctionTemplate(TemplateName Name)
PragmaMSPointersToMembersKind
The name is a dependent name, so the results will differ from one instantiation to the next...
bool IsBuildingRecoveryCallExpr
Flag indicating if Sema is building a recovery call expression.
DeductionFailureInfo MakeDeductionFailureInfo(ASTContext &Context, Sema::TemplateDeductionResult TDK, sema::TemplateDeductionInfo &Info)
Convert from Sema's representation of template deduction information to the form used in overload-can...
A static requirement that can be used in a requires-expression to check properties of types and expre...
OverloadCandidateSet - A set of overload candidates, used in C++ overload resolution (C++ 13...
Constant expression in a noptr-new-declarator.
LocalEagerInstantiationScope(Sema &S)
void setLastDiagnosticIgnored(bool Ignored)
Pretend that the last diagnostic issued was ignored, so any subsequent notes will be suppressed...
ParameterABI
Kinds of parameter ABI.
llvm::DenseMap< ParmVarDecl *, llvm::TinyPtrVector< ParmVarDecl * > > UnparsedDefaultArgInstantiationsMap
TentativeAnalysisScope(Sema &SemaRef)
ASTConsumer & getASTConsumer() const
CUDAFunctionTarget CurrentCUDATarget()
Gets the CUDA target for the current context.
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
SynthesizedFunctionScope(Sema &S, DeclContext *DC)
QualType NSValuePointer
Pointer to NSValue type (NSValue *).
Defines various enumerations that describe declaration and type specifiers.
A POD class for pairing a NamedDecl* with an access specifier.
The expression in a static assertion.
Expression in a case label.
A class for storing results from argument-dependent lookup.
OpaquePtr< QualType > TypeTy
static std::enable_if< IsPartialSpecialization< T >::value, Sema::TemplateDeductionResult >::type FinishTemplateArgumentDeduction(Sema &S, T *Partial, bool IsPartialOrdering, const TemplateArgumentList &TemplateArgs, SmallVectorImpl< DeducedTemplateArgument > &Deduced, TemplateDeductionInfo &Info)
Complete template argument deduction for a partial specialization.
Base class for declarations which introduce a typedef-name.
Abstract interface for a consumer of code-completion information.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Represents a reference to a function parameter pack or init-capture pack that has been substituted bu...
Represents a template argument.
ParserCompletionContext
Describes the context in which code completion occurs.
TagTypeKind
The kind of a tag type.
static NameClassification ContextIndependentExpr(ExprResult E)
OpenMPScheduleClauseModifier
OpenMP modifiers for 'schedule' clause.
Abstract base class used to perform a contextual implicit conversion from an expression to any type p...
Dataflow Directional Tag Classes.
llvm::DenseMap< IdentifierInfo *, SrcLocSet > IdentifierSourceLocations
LateTemplateParserCleanupCB * LateTemplateParserCleanup
SmallVector< CXXBindTemporaryExpr *, 8 > DelayedDecltypeBinds
If we are processing a decltype type, a set of temporary binding expressions for which we have deferr...
ConstexprSpecKind
Define the kind of constexpr specifier.
SourceLocation ImplicitMSInheritanceAttrLoc
Source location for newly created implicit MSInheritanceAttrs.
int ArgumentPackSubstitutionIndex
The current index into pack expansion arguments that will be used for substitution of parameter packs...
Don't merge availability attributes at all.
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
const DeclContext * getCurObjCLexicalContext() const
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
static ImplicitConversionSequence TryImplicitConversion(Sema &S, Expr *From, QualType ToType, bool SuppressUserConversions, bool AllowExplicit, bool InOverloadResolution, bool CStyle, bool AllowObjCWritebackConversion, bool AllowObjCConversionOnExplicit)
TryImplicitConversion - Attempt to perform an implicit conversion from the given expression (Expr) to...
llvm::SmallVector< TypoExpr *, 2 > TypoExprs
Holds TypoExprs that are created from createDelayedTypo.
The base class of all kinds of template declarations (e.g., class, function, etc.).
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
llvm::SmallVector< std::pair< SourceLocation, const BlockDecl * >, 1 > ImplicitlyRetainedSelfLocs
List of SourceLocations where 'self' is implicitly retained inside a block.
We are instantiating a default argument for a function.
OpenMPAtomicDefaultMemOrderClauseKind
OpenMP attributes for 'atomic_default_mem_order' clause.
bool RequireLiteralType(SourceLocation Loc, QualType T, unsigned DiagID, const Ts &...Args)
Reads an AST files chain containing the contents of a translation unit.
Represents a field injected from an anonymous union/struct into the parent scope. ...
bool IsAllowedCUDACall(const FunctionDecl *Caller, const FunctionDecl *Callee)
Determines whether Caller may invoke Callee, based on their CUDA host/device attributes.
static NameClassification VarTemplate(TemplateName Name)
SourceLocation PointerEndLoc
The end location for the first pointer declarator in the file.
Custom deleter to allow FunctionScopeInfos to be kept alive for a short time after they've been poppe...
LateInstantiatedAttribute(const Attr *A, LocalInstantiationScope *S, Decl *D)
A decomposition declaration.
ClassTemplateDecl * StdCoroutineTraitsCache
The C++ "std::coroutine_traits" template, which is defined in <coroutine_traits>
llvm::SmallSet< SourceLocation, 2 > SrcLocSet
A non-depnedent component of the parameter did not match the corresponding component of the argument...
bool GlobalNewDeleteDeclared
A flag to remember whether the implicit forms of operator new and delete have been declared...
The name of a declaration.
Represents the declaration of an Objective-C type parameter.
unsigned size() const
The number of exceptions in the exception specification.
SourceRange InstantiationRange
The source range that covers the construct that cause the instantiation, e.g., the template-id that c...
llvm::SmallPtrSet< SpecialMemberDecl, 4 > SpecialMembersBeingDeclared
The C++ special members which we are currently in the process of declaring.
PragmaClangSection PragmaClangRodataSection
std::pair< CXXRecordDecl *, SourceLocation > VTableUse
The list of classes whose vtables have been used within this translation unit, and the source locatio...
ExpressionEvaluationContext Context
The expression evaluation context.
bool isConstantEvaluated() const
AllocationFunctionScope
The scope in which to find allocation functions.
IncompatibleBlockPointer - The assignment is between two block pointers types that are not compatible...
The lookup found an overload set of literal operator templates, which expect the characters of the sp...
SmallVector< InventedTemplateParameterInfo, 4 > InventedParameterInfos
Stack containing information needed when in C++2a an 'auto' is encountered in a function declaration ...
Emit the diagnostic immediately (i.e., behave like Sema::Diag()).
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
IdentifierResolver IdResolver
Optional< sema::TemplateDeductionInfo * > isSFINAEContext() const
Determines whether we are currently in a context where template argument substitution failures are no...
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
FunctionEmissionStatus
Status of the function emission on the CUDA/HIP/OpenMP host/device attrs.
SpecialMemberOverloadResult(CXXMethodDecl *MD)
Abstract interface for a module loader.
The name refers to a template whose specialization produces a type.
bool isHidden() const
Determine whether this declaration might be hidden from name lookup.
bool isSpecialMember() const
We are declaring an implicit 'operator==' for a defaulted 'operator<=>'.
llvm::MapVector< FieldDecl *, DeleteLocs > DeleteExprs
A dependently-generated diagnostic.
Represents a pointer to an Objective C object.
AvailabilityMergeKind
Describes the kind of merge to perform for availability attributes (including "deprecated", "unavailable", and "availability").
PragmaClangSection PragmaClangDataSection
void LateTemplateParserCB(void *P, LateParsedTemplate &LPT)
Callback to the parser to parse templated functions when needed.
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
Encapsulates the data about a macro definition (e.g.
ObjCMethodDecl * LookupInstanceMethodInGlobalPool(Selector Sel, SourceRange R, bool receiverIdOrClass=false)
LookupInstanceMethodInGlobalPool - Returns the method and warns if there are multiple signatures...
llvm::DenseSet< QualType > InstantiatedNonDependentTypes
Non-dependent types used in templates that have already been instantiated by some template instantiat...
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
DeclarationName VAListTagName
VAListTagName - The declaration name corresponding to __va_list_tag.
EnterExpressionEvaluationContext(Sema &Actions, Sema::ExpressionEvaluationContext NewContext, Decl *LambdaContextDecl=nullptr, Sema::ExpressionEvaluationContextRecord::ExpressionKind ExprContext=Sema::ExpressionEvaluationContextRecord::EK_Other, bool ShouldEnter=true)
Location wrapper for a TemplateArgument.
SmallVector< PragmaAttributeGroup, 2 > PragmaAttributeStack
The template argument was specified in the code or was instantiated with some deduced template argume...
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
CheckTemplateArgumentKind
Specifies the context in which a particular template argument is being checked.
LocalInstantiationScope * Scope
IntToBlockPointer - The assignment converts an int to a block pointer.
Represents a C++ base or member initializer.
ExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc, tok::TokenKind Kind)
ActOnCXXBoolLiteral - Parse {true,false} literals.
const QualType * data() const
The set of exceptions in the exception specification.
The result of a constraint satisfaction check, containing the necessary information to diagnose an un...
DeclContext * getCurLexicalContext() const
UnparsedDefaultArgInstantiationsMap UnparsedDefaultArgInstantiations
A mapping from parameters with unparsed default arguments to the set of instantiations of each parame...
OpenMPScheduleClauseKind
OpenMP attributes for 'schedule' clause.
The name was classified as an ADL-only function name.
The deduced arguments did not satisfy the constraints associated with the template.
SmallVector< ExpressionEvaluationContextRecord, 8 > ExprEvalContexts
A stack of expression evaluation contexts.
llvm::StringRef getCurrentOpenCLExtension() const
bool isInOpenMPDeclareTargetContext() const
Return true inside OpenMP declare target region.
static NameClassification Error()
llvm::SmallSetVector< NamedDecl *, 16 > NamedDeclSetType
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.
Holds information about the various types of exception specification.
OpenMPDefaultClauseKind
OpenMP attributes for 'default' clause.
ArrayRef< TemplateArgument > template_arguments() const
Deduction failed; that's all we know.
static NameClassification Unknown()
bool isUnevaluated() const
ObjCInterfaceDecl * NSArrayDecl
The declaration of the Objective-C NSArray class.
~ArgumentPackSubstitutionIndexRAII()
FPContractStateRAII(Sema &S)
SmallVector< BlockDecl *, 8 > ExprCleanupObjects
ExprCleanupObjects - This is the stack of objects requiring cleanup that are created by the current f...
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
static SourceRange getPrintable(SourceLocation L)
Represents a base class of a C++ class.
bool SavedInNonInstantiationSFINAEContext
Was the enclosing context a non-instantiation SFINAE context?
void ActOnStartOfCompoundStmt(bool IsStmtExpr)
PragmaStack< StringLiteral * > ConstSegStack
Condition in a constexpr if statement.
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
ProcessingContextState ParsingClassState
PragmaClangSection PragmaClangTextSection
ParsedType ObjectType
The type of the object, if we're parsing nested-name-specifier in a member access expression...
void * SkippedDefinitionContext
Describes whether we've seen any nullability information for the given file.
QualType QIDNSCopying
id<NSCopying> type.
RedeclarationKind forRedeclarationInCurContext()
bool isAlreadyInstantiating() const
Determine whether we are already instantiating this specialization in some surrounding active instant...
A template argument list.
Merge availability attributes for a redeclaration, which requires an exact match. ...
The name was classified as a concept name.
SemaDiagnosticBuilder diagnoseNoMatch(Sema &S, SourceLocation Loc, QualType T) override
Emits a diagnostic complaining that the expression does not have integral or enumeration type...
bool isConstantEvaluatedOverride
Used to change context to isConstantEvaluated without pushing a heavy ExpressionEvaluationContextReco...
Expr * NoexceptExpr
Noexcept expression, if this is a computed noexcept specification.
llvm::DenseMap< CanonicalDeclPtr< FunctionDecl >, std::vector< PartialDiagnosticAt > > DeviceDeferredDiags
Diagnostics that are emitted only if we discover that the given function must be codegen'ed.
llvm::DenseMap< NamedDecl *, NamedDecl * > VisibleNamespaceCache
Map from the most recent declaration of a namespace to the most recent visible declaration of that na...
An attributed type is a type to which a type attribute has been applied.
CCEKind
Contexts in which a converted constant expression is required.
static void BuildBasePathArray(const CXXBasePath &Path, CXXCastPath &BasePathArray)
OpaquePtr< DeclGroupRef > DeclGroupPtrTy
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
ExprResult CorrectDelayedTyposInExpr(Expr *E, llvm::function_ref< ExprResult(Expr *)> Filter)
Data structure used to record current or nested expression evaluation contexts.
void * VisContext
VisContext - Manages the stack for #pragma GCC visibility.
Describes the sequence of initializations required to initialize a given object or reference with a s...
The lookup found no match but no diagnostic was issued.
Captures information about "declaration specifiers".
Code completion occurs at the beginning of the initialization statement (or expression) in a for loop...
void LateTemplateParserCleanupCB(void *P)
ActionResult< Expr * > ExprResult
Only look for allocation functions in the global scope.
SourceLocation PragmaPushLocation
Defines Expressions and AST nodes for C++2a concepts.
sema::DelayedDiagnosticPool * getCurrentPool() const
Returns the current delayed-diagnostics pool.
Represents a C++ struct/union/class.
Compatible - the types are compatible according to the standard.
Decl * D
The template function declaration to be late parsed.
sema::FunctionScopeInfo * getCurFunction() const
A requires-expression requirement which is satisfied when a general constraint expression is satisfie...
Look up a friend of a local class.
void PopParsingClass(ParsingClassState state)
A diagnostic message which has been conditionally emitted pending the complete parsing of the current...
OpenMPMapClauseKind
OpenMP mapping kind for 'map' clause.
ObjCIvarDecl - Represents an ObjC instance variable.
void popCodeSynthesisContext()
PoppedFunctionScopePtr PopFunctionScopeInfo(const sema::AnalysisBasedWarnings::Policy *WP=nullptr, const Decl *D=nullptr, QualType BlockType=QualType())
Pop a function (or block or lambda or captured region) scope from the stack.
PragmaClangSection PragmaClangRelroSection
LangOptions::PragmaMSPointersToMembersKind MSPointerToMemberRepresentationMethod
Controls member pointer representation format under the MS ABI.
std::unique_ptr< sema::FunctionScopeInfo, PoppedFunctionScopeDeleter > PoppedFunctionScopePtr
llvm::DenseMap< int, SourceRange > ParsedSubjectMatchRuleSet
Selector RespondsToSelectorSel
will hold 'respondsToSelector:'
TPOC
The context in which partial ordering of function templates occurs.
DefaultedFunctionKind(DefaultedComparisonKind Comp)
DeclContext * CurContext
CurContext - This is the current declaration context of parsing.
TranslationUnitKind
Describes the kind of translation unit being processed.
Declaration of a class template.
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
Writes an AST file containing the contents of a translation unit.
SourceManager & getSourceManager() const
After substituting deduced template arguments, an element of a dependent parameter type did not match...
This represents '#pragma omp declare mapper ...' directive.
We are rewriting a comparison operator in terms of an operator<=>.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
A little helper class (which is basically a smart pointer that forwards info from DiagnosticsEngine) ...
TranslationUnitKind TUKind
The kind of translation unit we are processing.
ExpressionEvaluationContext
Describes how the expressions currently being parsed are evaluated at run-time, if at all...
StringLiteral - This represents a string literal expression, e.g.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Represents a complete lambda introducer.
We are substituting prior template arguments into a new template parameter.
a linked list of methods with the same selector name but different signatures.
std::pair< ObjCMethodList, ObjCMethodList > GlobalMethods
The translation unit is a complete translation unit.
ExprResult CorrectDelayedTyposInExpr(ExprResult ER, VarDecl *InitDecl=nullptr, llvm::function_ref< ExprResult(Expr *)> Filter=[](Expr *E) -> ExprResult { return E;})
ExceptionSpecificationType getExceptionSpecType() const
Get the computed exception specification type.
NonOdrUseReason
The reason why a DeclRefExpr does not constitute an odr-use.
Designation - Represent a full designation, which is a sequence of designators.
FullExprArg MakeFullExpr(Expr *Arg, SourceLocation CC)
The name refers to a variable template whose specialization produces a variable.
static CXXRecordDecl * getCurrentInstantiationOf(QualType T, DeclContext *CurContext)
Find the current instantiation that associated with the given type.
A reference to a declared variable, function, enum, etc.
static SourceRange getPrintable(SourceRange R)
Code completion occurs within the condition of an if, while, switch, or for statement.
virtual ~ContextualImplicitConverter()
llvm::DenseMap< CXXRecordDecl *, bool > VTablesUsed
The set of classes whose vtables have been used within this translation unit, and a bit that will be ...
SourceManager & SourceMgr
CapturedRegionKind
The different kinds of captured statement.
BasePaths - Represents the set of paths from a derived class to one of its (direct or indirect) bases...
Contains a late templated function.
llvm::DenseMap< CanonicalDeclPtr< FunctionDecl >, FunctionDeclAndLoc > DeviceKnownEmittedFns
An inverse call graph, mapping known-emitted functions to one of their known-emitted callers (plus th...
ParamInfo - An array of paraminfo objects is allocated whenever a function declarator is parsed...
A push'd group of PragmaAttributeEntries.
static int getPrintable(int I)
class clang::Sema::DelayedDiagnostics DelayedDiagnostics
This structure contains most locations needed for by an OMPVarListClause.
PragmaStack< unsigned > PackStack
A collection of diagnostics which were delayed.
PoppedFunctionScopeDeleter(Sema *Self)
An instance of this class represents the declaration of a property member.
DefaultedComparisonKind getDefaultedComparisonKind(const FunctionDecl *FD)
A wrapper class around a pointer that always points to its canonical declaration. ...
A trivial tuple used to represent a source range.
IncompatibleObjCQualifiedId - The assignment is between a qualified id type and something else (that ...
This represents a decl that may have a name.
SmallVector< Expr *, 2 > VolatileAssignmentLHSs
Expressions appearing as the LHS of a volatile assignment in this context.
static NameClassification Concept(TemplateName Name)
QualType NSStringPointer
Pointer to NSString type (NSString *).
FullExprArg MakeFullDiscardedValueExpr(Expr *Arg)
Represents C++ using-directive.
The template argument was deduced via template argument deduction.
SourceLocation CurrentPragmaLocation
Look up of an operator name (e.g., operator+) for use with operator overloading.
Describes an entity that is being initialized.
static QualType getPrintable(QualType T)
ComparisonCategoryType
An enumeration representing the different comparison categories types.
The global module fragment, between 'module;' and a module-declaration.
The type of an arbitrary declaration.
This file provides AST data structures related to concepts.
ParsedAttributes - A collection of parsed attributes.
SourceLocation ColonLoc
Location of ':'.
SmallVector< Slot, 2 > Stack
brief A function argument from which we performed template argument
This represents '#pragma omp threadprivate ...' directive.
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
The explicitly-specified template arguments were not valid template arguments for the given template...
The lookup resulted in an error.
This class handles loading and caching of source files into memory.
IncompatibleNestedPointerQualifiers - The assignment is between two nested pointer types...
The symbol does not exist.
Declaration of a template function.
llvm::DenseMap< const EnumDecl *, llvm::APInt > FlagBitsCache
A cache of the flags available in enumerations with the flag_bits attribute.
Code completion occurs in a parenthesized expression, which might also be a type cast.
void PushFunctionScope()
Enter a new function scope.
NullPointerConstantKind
Enumeration used to describe the kind of Null pointer constant returned from isNullPointerConstant()...
NamedDeclSetType UnusedPrivateFields
Set containing all declared private fields that are not used.
Attr - This represents one attribute.
llvm::DenseMap< CanonicalDeclPtr< FunctionDecl >, llvm::MapVector< CanonicalDeclPtr< FunctionDecl >, SourceLocation > > DeviceCallGraph
A partial call graph maintained during CUDA/OpenMP device code compilation to support deferred diagno...
This an attribute introduced by #pragma clang attribute.
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
void CalledExpr(Expr *E)
Integrate an invoked expression into the collected data.
ObjCMethodDecl * DictionaryWithObjectsMethod
The declaration of the dictionaryWithObjects:forKeys:count: method.
A normalized constraint, as defined in C++ [temp.constr.normal], is either an atomic constraint...
Helper class that creates diagnostics with optional template instantiation stacks.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
~TentativeAnalysisScope()
The triviality of a method unaffected by "trivial_abi".
bool hasErrorOccurred() const
Determine whether any SFINAE errors have been trapped.
llvm::DenseMap< ParmVarDecl *, SourceLocation > UnparsedDefaultArgLocs
StandardConversionSequence - represents a standard conversion sequence (C++ 13.3.3.1.1).
SourceLocation CurInitSegLoc