15 #ifndef LLVM_CLANG_SEMA_SEMA_H 16 #define LLVM_CLANG_SEMA_SEMA_H 51 #include "llvm/ADT/ArrayRef.h" 52 #include "llvm/ADT/Optional.h" 53 #include "llvm/ADT/SetVector.h" 54 #include "llvm/ADT/SmallBitVector.h" 55 #include "llvm/ADT/SmallPtrSet.h" 56 #include "llvm/ADT/SmallVector.h" 57 #include "llvm/ADT/TinyPtrVector.h" 65 template <
typename ValueT>
struct DenseMapInfo;
66 template <
typename ValueT,
typename ValueInfoT>
class DenseSet;
68 struct InlineAsmIdentifierInfo;
75 class ASTMutationListener;
85 class CXXBindTemporaryExpr;
87 class CXXConstructorDecl;
88 class CXXConversionDecl;
90 class CXXDestructorDecl;
91 class CXXFieldCollector;
92 class CXXMemberCallExpr;
98 class ClassTemplateDecl;
99 class ClassTemplatePartialSpecializationDecl;
100 class ClassTemplateSpecializationDecl;
101 class VarTemplatePartialSpecializationDecl;
102 class CodeCompleteConsumer;
103 class CodeCompletionAllocator;
104 class CodeCompletionTUInfo;
105 class CodeCompletionResult;
106 class CoroutineBodyStmt;
108 class DeclAccessPair;
111 class DeclaratorDecl;
112 class DeducedTemplateArgument;
113 class DependentDiagnostic;
114 class DesignatedInitExpr;
117 class EnumConstantDecl;
123 class FunctionProtoType;
124 class FunctionTemplateDecl;
125 class ImplicitConversionSequence;
128 class InitializationKind;
129 class InitializationSequence;
130 class InitializedEntity;
131 class IntegerLiteral;
135 class LocalInstantiationScope;
140 class MultiLevelTemplateArgumentList;
142 class ObjCCategoryDecl;
143 class ObjCCategoryImplDecl;
144 class ObjCCompatibleAliasDecl;
145 class ObjCContainerDecl;
147 class ObjCImplementationDecl;
148 class ObjCInterfaceDecl;
150 template <
class T>
class ObjCList;
151 class ObjCMessageExpr;
152 class ObjCMethodDecl;
153 class ObjCPropertyDecl;
154 class ObjCProtocolDecl;
155 class OMPThreadPrivateDecl;
156 class OMPDeclareReductionDecl;
157 class OMPDeclareSimdDecl;
159 struct OverloadCandidate;
160 class OverloadCandidateSet;
165 class PseudoDestructorTypeStorage;
166 class PseudoObjectExpr;
168 class StandardConversionSequence;
172 class TemplateArgument;
173 class TemplateArgumentList;
174 class TemplateArgumentLoc;
176 class TemplateInstantiationCallback;
177 class TemplateParameterList;
178 class TemplatePartialOrderingContext;
179 class TemplateTemplateParmDecl;
183 class TypedefNameDecl;
185 class TypoCorrectionConsumer;
187 class UnresolvedLookupExpr;
188 class UnresolvedMemberExpr;
189 class UnresolvedSetImpl;
190 class UnresolvedSetIterator;
192 class UsingShadowDecl;
195 class VarTemplateSpecializationDecl;
196 class VisibilityAttr;
197 class VisibleDeclConsumer;
198 class IndirectFieldDecl;
199 struct DeductionFailureInfo;
200 class TemplateSpecCandidateSet;
203 class AccessedEntity;
204 class BlockScopeInfo;
206 class CapturedRegionScopeInfo;
207 class CapturingScopeInfo;
208 class CompoundScopeInfo;
209 class DelayedDiagnostic;
210 class DelayedDiagnosticPool;
211 class FunctionScopeInfo;
212 class LambdaScopeInfo;
213 class PossiblyUnreachableDiag;
214 class SemaPPCallbacks;
215 class TemplateDeductionInfo;
218 namespace threadSafety {
225 typedef std::pair<llvm::PointerUnion<const TemplateTypeParmType*, NamedDecl*>,
243 bool SawTypeNullability =
false;
250 llvm::DenseMap<FileID, FileNullability> Map;
261 if (file ==
Cache.File)
262 return Cache.Nullability;
265 if (!
Cache.File.isInvalid()) {
271 Cache.Nullability = Map[file];
272 return Cache.Nullability;
279 void operator=(
const Sema &) =
delete;
285 bool isMultiplexExternalSource;
287 static bool mightHaveNonExternalLinkage(
const DeclaratorDecl *FD);
294 bool shouldLinkPossiblyHiddenDecl(
const NamedDecl *Old,
302 "should not have found a non-externally-declarable previous decl");
388 PSK_Push_Set = PSK_Push | PSK_Set,
389 PSK_Pop_Set = PSK_Pop | PSK_Set,
392 template<
typename ValueType>
399 Slot(llvm::StringRef StackSlotLabel, ValueType Value,
401 : StackSlotLabel(StackSlotLabel), Value(Value),
402 PragmaLocation(PragmaLocation),
403 PragmaPushLocation(PragmaPushLocation) {}
407 llvm::StringRef StackSlotLabel,
425 assert((Action == PSK_Push || Action == PSK_Pop) &&
426 "Can only push / pop #pragma stack sentinels!");
427 Act(CurrentPragmaLocation, Action, Label, CurrentValue);
432 : DefaultValue(Default), CurrentValue(Default) {}
434 bool hasValue()
const {
return CurrentValue != DefaultValue; }
455 static const unsigned kMac68kAlignmentSentinel = ~0U;
541 &ExternalSemaSource::ReadExtVectorDecls, 2, 2>
585 &ExternalSemaSource::ReadTentativeDefinitions, 2, 2>
592 &ExternalSemaSource::ReadUnusedFileScopedDecls, 2, 2>
600 &ExternalSemaSource::ReadDelegatingConstructors, 2, 2>
624 std::unique_ptr<LateParsedTemplate>>
636 LateTemplateParserCleanupCB *LTPCleanup,
638 LateTemplateParser = LTP;
639 LateTemplateParserCleanup = LTPCleanup;
677 state.SavedPool = CurPool;
686 CurPool = state.SavedPool;
693 state.SavedPool = CurPool;
700 assert(CurPool ==
nullptr);
701 CurPool = state.SavedPool;
710 ProcessingContextState SavedContextState;
715 : S(S), SavedContext(S.CurContext),
717 SavedCXXThisTypeOverride(S.CXXThisTypeOverride)
719 assert(ContextToPush &&
"pushing null context");
726 if (!SavedContext)
return;
730 SavedContext =
nullptr;
743 bool PushedCodeSynthesisContext =
false;
747 : S(S), SavedContext(S, DC) {
750 Sema::ExpressionEvaluationContext::PotentiallyEvaluated);
751 if (
auto *FD = dyn_cast<FunctionDecl>(DC))
752 FD->setWillHaveBody(
true);
754 assert(isa<ObjCMethodDecl>(DC));
758 assert(!PushedCodeSynthesisContext);
761 Ctx.
Kind = Sema::CodeSynthesisContext::DefiningSynthesizedFunction;
766 PushedCodeSynthesisContext =
true;
770 if (PushedCodeSynthesisContext)
772 if (
auto *FD = dyn_cast<FunctionDecl>(S.
CurContext))
773 FD->setWillHaveBody(
false);
792 void LoadExternalWeakUndeclaredIdentifiers();
927 PotentiallyEvaluated,
937 PotentiallyEvaluatedIfUsed
993 unsigned NumCleanupObjects,
995 Decl *ManglingContextDecl,
997 : Context(Context), ParentCleanup(ParentCleanup),
998 NumCleanupObjects(NumCleanupObjects), NumTypos(0),
999 ManglingContextDecl(ManglingContextDecl), MangleNumbering(),
1000 ExprContext(ExprContext) {}
1007 return Context == ExpressionEvaluationContext::Unevaluated ||
1008 Context == ExpressionEvaluationContext::UnevaluatedAbstract ||
1009 Context == ExpressionEvaluationContext::UnevaluatedList;
1012 return Context == ExpressionEvaluationContext::ConstantEvaluated;
1028 Decl *&ManglingContextDecl);
1045 llvm::PointerIntPair<CXXMethodDecl*, 2> Pair;
1050 : Pair(MD, MD->isDeleted() ? NoMemberOrDeleted : Success) {}
1060 :
public llvm::FastFoldingSetNode,
1064 : FastFoldingSetNode(ID)
1090 typedef llvm::DenseMap<ParmVarDecl *, llvm::TinyPtrVector<ParmVarDecl *>>
1113 bool isExternalWithNoLinkageType(
ValueDecl *VD);
1116 void getUndefinedButUsed(
1121 const llvm::MapVector<FieldDecl *, DeleteLocs> &
1122 getMismatchingDeleteExpressions()
const;
1150 typedef llvm::PointerIntPair<CXXRecordDecl *, 3, CXXSpecialMember>
1169 void updateOutOfDateSelector(
Selector Sel);
1172 bool isSelfExpr(
Expr *RExpr);
1178 void EmitCurrentDiagnostic(
unsigned DiagID);
1192 void addImplicitTypedef(StringRef Name,
QualType T);
1221 void addExternalSource(ExternalSemaSource *E);
1223 void PrintStats()
const;
1252 if (!isActive())
return;
1271 template<
typename T>
1305 void emitAndClearUnusedLocalTypedefWarnings();
1307 void ActOnStartOfTranslationUnit();
1308 void ActOnEndOfTranslationUnit();
1310 void CheckDelegatingCtorCycles();
1314 void PushFunctionScope();
1321 void RecordParsingTemplateParameterDepth(
unsigned Depth);
1328 const Decl *D =
nullptr,
1332 return FunctionScopes.empty() ? nullptr : FunctionScopes.back();
1337 void setFunctionHasBranchIntoScope();
1338 void setFunctionHasBranchProtectedScope();
1339 void setFunctionHasIndirectGoto();
1341 void PushCompoundScope(
bool IsStmtExpr);
1342 void PopCompoundScope();
1346 bool hasAnyUnrecoverableErrorsInThisFunction()
const;
1356 getCurLambda(
bool IgnoreNonLambdaCapturingScope =
false);
1382 Expr *ArraySize,
unsigned Quals,
1450 void UpdateExceptionSpec(FunctionDecl *FD,
1453 bool CheckDistantExceptionSpec(
QualType T);
1454 bool CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New);
1455 bool CheckEquivalentExceptionSpec(
1458 bool CheckEquivalentExceptionSpec(
1509 std::tuple<
const Ts &...> Args;
1513 llvm::index_sequence<Is...>)
const {
1515 bool Dummy[] = {
false, (DB << getPrintable(std::get<Is>(Args)))...};
1522 assert(DiagID != 0 &&
"no diagnostic for type diagnoser");
1527 emit(DB, llvm::index_sequence_for<Ts...>());
1536 struct ModuleScope {
1538 bool ModuleInterface =
false;
1545 Module *getCurrentModule()
const {
1546 return ModuleScopes.empty() ? nullptr : ModuleScopes.back().Module;
1557 void makeMergedDefinitionVisible(
NamedDecl *ND);
1563 return !D->
isHidden() || isVisibleSlow(D);
1570 return isVisible(D) || hasVisibleDeclarationSlow(D, Modules);
1572 bool hasVisibleDeclarationSlow(
const NamedDecl *D,
1575 bool hasVisibleMergedDefinition(
NamedDecl *Def);
1576 bool hasMergedDefinitionInCurrentModule(
NamedDecl *Def);
1580 bool hasStructuralCompatLayout(
Decl *D,
Decl *Suggested);
1585 bool OnlyNeedComplete =
false);
1588 return hasVisibleDefinition(const_cast<NamedDecl*>(D), &Hidden);
1599 bool hasVisibleExplicitSpecialization(
1604 bool hasVisibleMemberSpecialization(
1610 bool isEquivalentInternalLinkageDeclaration(
const NamedDecl *A,
1612 void diagnoseEquivalentInternalLinkageDeclarations(
1617 return !RequireCompleteTypeImpl(Loc, T,
nullptr);
1624 template <
typename... Ts>
1626 const Ts &...Args) {
1628 return RequireCompleteType(Loc, T, Diagnoser);
1631 void completeExprArrayBound(
Expr *E);
1633 bool RequireCompleteExprType(
Expr *E,
unsigned DiagID);
1635 template <
typename... Ts>
1638 return RequireCompleteExprType(E, Diagnoser);
1645 template <
typename... Ts>
1647 const Ts &...Args) {
1649 return RequireLiteralType(Loc, T, Diagnoser);
1654 TagDecl *OwnedTagDecl =
nullptr);
1660 bool AsUnevaluated =
true);
1679 DeclGroupPtrTy ConvertDeclToDeclGroup(
Decl *Ptr,
Decl *OwnedType =
nullptr);
1681 void DiagnoseUseOfUnimplementedSelectors();
1687 bool isClassName =
false,
bool HasTrailingDot =
false,
1689 bool IsCtorOrDtorName =
false,
1690 bool WantNontrivialTypeSourceInfo =
false,
1691 bool IsClassTemplateDeductionContext =
true,
1700 bool IsTemplateName =
false);
1708 bool IsTemplateTypeArg);
1753 Result.Template = Name;
1759 Result.Template = Name;
1765 Result.Template = Name;
1772 assert(Kind == NC_Type);
1777 assert(Kind == NC_Expression);
1782 assert(Kind == NC_TypeTemplate || Kind == NC_FunctionTemplate ||
1783 Kind == NC_VarTemplate);
1789 case NC_TypeTemplate:
1791 case NC_FunctionTemplate:
1793 case NC_VarTemplate:
1796 llvm_unreachable(
"unsupported name classification.");
1828 bool IsAddressOfOperand,
1829 std::unique_ptr<CorrectionCandidateCallback> CCC =
nullptr);
1837 TemplateTemplateParam,
1849 if (
auto *DRE = dyn_cast<DeclRefExpr>(E.
get()))
1850 return !DRE->hasExplicitTemplateArgs();
1851 if (
auto *ME = dyn_cast<MemberExpr>(E.
get()))
1852 return !ME->hasExplicitTemplateArgs();
1854 if (
auto *DSDRE = dyn_cast<DependentScopeDeclRefExpr>(E.
get()))
1855 return !DSDRE->hasExplicitTemplateArgs();
1856 if (
auto *DSME = dyn_cast<CXXDependentScopeMemberExpr>(E.
get()))
1857 return !DSME->hasExplicitTemplateArgs();
1876 diagnoseIgnoredQualifiers(
unsigned DiagID,
unsigned Quals,
1884 static bool adjustContextForLocalExternDecl(
DeclContext *&DC);
1885 void DiagnoseFunctionSpecifiers(
const DeclSpec &DS);
1886 NamedDecl *getShadowedDeclaration(
const TypedefNameDecl *D,
1891 void CheckShadow(
Scope *S, VarDecl *D);
1902 llvm::DenseMap<const NamedDecl *, const NamedDecl *> ShadowingDecls;
1906 void handleTagNumbering(
const TagDecl *Tag,
Scope *TagScope);
1907 void setTagNameForLinkagePurposes(
TagDecl *TagFromDeclSpec,
1908 TypedefNameDecl *NewTD);
1909 void CheckTypedefForVariablyModifiedType(
Scope *S, TypedefNameDecl *D);
1925 bool CheckVariableDeclaration(VarDecl *NewVD,
LookupResult &Previous);
1926 void CheckVariableDeclarationType(VarDecl *NewVD);
1927 bool DeduceVariableDeclarationType(VarDecl *VDecl,
bool DirectInit,
1929 void CheckCompleteVariableDeclaration(VarDecl *VD);
1931 void MaybeSuggestAddingStaticToDecl(
const FunctionDecl *D);
1940 bool CheckConstexprFunctionDecl(
const FunctionDecl *FD);
1941 bool CheckConstexprFunctionBody(
const FunctionDecl *FD,
Stmt *Body);
1949 bool CheckFunctionDeclaration(
Scope *S,
1951 bool IsMemberSpecialization);
1952 bool shouldLinkDependentDeclWithPrevious(
Decl *D,
Decl *OldDecl);
1953 void CheckMain(FunctionDecl *FD,
const DeclSpec &D);
1954 void CheckMSVCRTEntryPoint(FunctionDecl *FD);
1955 Attr *getImplicitCodeSegOrSectionAttrForFunction(
const FunctionDecl *FD,
bool IsDefinition);
1964 void ActOnParamDefaultArgument(
Decl *param,
1967 void ActOnParamUnparsedDefaultArgument(
Decl *param,
1974 void AddInitializerToDecl(
Decl *dcl,
Expr *init,
bool DirectInit);
1975 void ActOnUninitializedDecl(
Decl *dcl);
1976 void ActOnInitializerError(
Decl *Dcl);
1979 void ActOnCXXForRangeDecl(
Decl *D);
1986 void FinalizeDeclaration(
Decl *D);
1987 DeclGroupPtrTy FinalizeDeclaratorGroup(
Scope *S,
const DeclSpec &DS,
1993 void ActOnDocumentableDecl(
Decl *D);
1998 void CheckForFunctionRedefinition(
1999 FunctionDecl *FD,
const FunctionDecl *EffectiveDefinition =
nullptr,
2006 void ActOnStartOfObjCMethodDef(
Scope *S,
Decl *D);
2008 return D && isa<ObjCMethodDecl>(D);
2019 bool canDelayFunctionBody(
const Declarator &D);
2028 bool canSkipFunctionBody(
Decl *D);
2032 Decl *ActOnFinishFunctionBody(Decl *Decl,
Stmt *Body,
bool IsInstantiation);
2033 Decl *ActOnSkippedFunctionBody(Decl *Decl);
2034 void ActOnFinishInlineFunctionDef(FunctionDecl *D);
2038 void ActOnFinishDelayedAttribute(Scope *S, Decl *D,
ParsedAttributes &Attrs);
2051 void DiagnoseInvalidJumps(
Stmt *Body);
2052 Decl *ActOnFileScopeAsmDecl(
Expr *
expr,
2098 void createImplicitModuleImportForErrorRecovery(
SourceLocation Loc,
2107 ExplicitSpecialization,
2108 PartialSpecialization
2121 Decl *ActOnFinishExportDecl(Scope *S, Decl *
ExportDecl,
2137 return getPrintingPolicy(Context, PP);
2146 void ActOnTranslationUnitScope(Scope *S);
2152 bool IsExplicitInstantiation,
2155 Decl *BuildAnonymousStructOrUnion(Scope *S,
DeclSpec &DS,
2160 Decl *BuildMicrosoftCAnonymousStruct(Scope *S,
DeclSpec &DS,
2181 bool isAcceptableTagRedeclaration(
const TagDecl *Previous,
2193 Decl *ActOnTag(Scope *S,
unsigned TagSpec,
TagUseKind TUK,
2199 bool ScopedEnumUsesClassTag,
TypeResult UnderlyingType,
2200 bool IsTypeSpecifier,
bool IsTemplateParamOrArg,
2203 Decl *ActOnTemplatedFriendTag(Scope *S,
SourceLocation FriendLoc,
2230 Expr *BitfieldWidth,
2238 bool Mutable,
Expr *BitfieldWidth,
2244 bool CheckNontrivialField(
FieldDecl *FD);
2252 TAH_ConsiderTrivialABI
2257 bool Diagnose =
false);
2273 void ActOnTagStartDefinition(Scope *S, Decl *
TagDecl);
2278 bool ActOnDuplicateDefinition(
DeclSpec &DS, Decl *Prev,
2284 SkippedDefinitionContext ActOnTagStartSkippedDefinition(Scope *S, Decl *TD);
2286 Decl *ActOnObjCContainerStartDefinition(Decl *IDecl);
2291 void ActOnStartCXXMemberDeclarations(Scope *S, Decl *
TagDecl,
2293 bool IsFinalSpelledSealed,
2298 void ActOnTagFinishDefinition(Scope *S, Decl *
TagDecl,
2301 void ActOnTagFinishSkippedDefinition(SkippedDefinitionContext Context);
2303 void ActOnObjCContainerFinishDefinition();
2309 void ActOnObjCTemporaryExitContainerContext(
DeclContext *DC);
2310 void ActOnObjCReenterContainerContext(
DeclContext *DC);
2314 void ActOnTagDefinitionError(Scope *S, Decl *
TagDecl);
2322 bool CheckEnumRedeclaration(
SourceLocation EnumLoc,
bool IsScoped,
2323 QualType EnumUnderlyingTy,
bool IsFixed,
2331 Decl *ActOnEnumConstant(Scope *S, Decl *
EnumDecl, Decl *LastEnumConstant,
2343 void PopDeclContext();
2347 void EnterDeclaratorContext(Scope *S,
DeclContext *DC);
2348 void ExitDeclaratorContext(Scope *S);
2351 void ActOnReenterFunctionContext(Scope* S, Decl* D);
2352 void ActOnExitFunctionContext();
2359 FunctionDecl *getCurFunctionDecl();
2369 NamedDecl *getCurFunctionOrMethodDecl();
2372 void PushOnScopeChains(
NamedDecl *D, Scope *S,
bool AddToContext =
true);
2390 bool AllowInlineNamespace =
false);
2394 static Scope *getScopeForDeclContext(Scope *S,
DeclContext *DC);
2399 bool isIncompatibleTypedef(
TypeDecl *Old, TypedefNameDecl *New);
2421 VersionTuple Introduced,
2422 VersionTuple Deprecated,
2423 VersionTuple Obsoleted,
2428 unsigned AttrSpellingListIndex);
2429 TypeVisibilityAttr *mergeTypeVisibilityAttr(Decl *D,
SourceRange Range,
2430 TypeVisibilityAttr::VisibilityType Vis,
2431 unsigned AttrSpellingListIndex);
2433 VisibilityAttr::VisibilityType Vis,
2434 unsigned AttrSpellingListIndex);
2435 UuidAttr *mergeUuidAttr(Decl *D,
SourceRange Range,
2436 unsigned AttrSpellingListIndex, StringRef Uuid);
2437 DLLImportAttr *mergeDLLImportAttr(Decl *D,
SourceRange Range,
2438 unsigned AttrSpellingListIndex);
2439 DLLExportAttr *mergeDLLExportAttr(Decl *D,
SourceRange Range,
2440 unsigned AttrSpellingListIndex);
2442 mergeMSInheritanceAttr(Decl *D,
SourceRange Range,
bool BestCase,
2443 unsigned AttrSpellingListIndex,
2444 MSInheritanceAttr::Spelling SemanticSpelling);
2445 FormatAttr *mergeFormatAttr(Decl *D,
SourceRange Range,
2447 int FirstArg,
unsigned AttrSpellingListIndex);
2448 SectionAttr *mergeSectionAttr(Decl *D,
SourceRange Range, StringRef Name,
2449 unsigned AttrSpellingListIndex);
2450 CodeSegAttr *mergeCodeSegAttr(Decl *D,
SourceRange Range, StringRef Name,
2451 unsigned AttrSpellingListIndex);
2452 AlwaysInlineAttr *mergeAlwaysInlineAttr(Decl *D,
SourceRange Range,
2454 unsigned AttrSpellingListIndex);
2455 MinSizeAttr *mergeMinSizeAttr(Decl *D,
SourceRange Range,
2456 unsigned AttrSpellingListIndex);
2457 OptimizeNoneAttr *mergeOptimizeNoneAttr(Decl *D,
SourceRange Range,
2458 unsigned AttrSpellingListIndex);
2459 InternalLinkageAttr *mergeInternalLinkageAttr(Decl *D,
SourceRange Range,
2461 unsigned AttrSpellingListIndex);
2463 unsigned AttrSpellingListIndex);
2465 void mergeDeclAttributes(
NamedDecl *New, Decl *Old,
2467 void MergeTypedefNameDecl(Scope *S, TypedefNameDecl *New,
2469 bool MergeFunctionDecl(FunctionDecl *New,
NamedDecl *&Old, Scope *S,
2470 bool MergeTypeWithOld);
2471 bool MergeCompatibleFunctionDecls(FunctionDecl *New, FunctionDecl *Old,
2472 Scope *S,
bool MergeTypeWithOld);
2474 void MergeVarDecl(VarDecl *New,
LookupResult &Previous);
2475 void MergeVarDeclTypes(VarDecl *New, VarDecl *Old,
bool MergeTypeWithOld);
2476 void MergeVarDeclExceptionSpecs(VarDecl *New, VarDecl *Old);
2477 bool checkVarDeclRedefinition(VarDecl *OldDefn, VarDecl *NewDefn);
2479 bool MergeCXXFunctionDecl(FunctionDecl *New, FunctionDecl *Old, Scope *S);
2491 AA_Passing_CFAudited
2512 bool IsForUsingDecl);
2513 bool IsOverload(FunctionDecl *New, FunctionDecl *Old,
bool IsForUsingDecl,
2514 bool ConsiderCudaAttrs =
true);
2521 bool isFunctionConsideredUnavailable(FunctionDecl *FD);
2525 bool SuppressUserConversions,
2527 bool InOverloadResolution,
2529 bool AllowObjCWritebackConversion);
2535 bool InOverloadResolution,
2536 QualType& ConvertedType,
bool &IncompatibleObjC);
2538 QualType& ConvertedType,
bool &IncompatibleObjC);
2545 unsigned *ArgPos =
nullptr);
2551 bool CheckPointerConversion(
Expr *From,
QualType ToType,
2553 CXXCastPath& BasePath,
2554 bool IgnoreBaseAccess,
2555 bool Diagnose =
true);
2557 bool InOverloadResolution,
2559 bool CheckMemberPointerConversion(
Expr *From,
QualType ToType,
2561 CXXCastPath &BasePath,
2562 bool IgnoreBaseAccess);
2564 bool CStyle,
bool &ObjCLifetimeConversion);
2567 bool DiagnoseMultipleUserDefinedConversion(
Expr *From,
QualType ToType);
2571 const VarDecl *NRVOCandidate,
2574 bool AllowNRVO =
true);
2581 bool TopLevelOfInitList =
false,
2582 bool AllowExplicit =
false);
2617 bool SuppressConversion =
false)
2618 : Suppress(Suppress), SuppressConversion(SuppressConversion) {}
2660 bool AllowScopedEnumerations;
2664 bool Suppress,
bool SuppressConversion)
2666 AllowScopedEnumerations(AllowScopedEnumerations) {}
2673 return diagnoseNotInt(S, Loc, T);
2683 ExprResult PerformContextualImplicitConversion(
2717 void AddOverloadCandidate(FunctionDecl *Function,
2721 bool SuppressUserConversions =
false,
2722 bool PartialOverloading =
false,
2723 bool AllowExplicit =
false,
2724 ConversionSequenceList EarlyConversions = None);
2729 bool SuppressUserConversions =
false,
2730 bool PartialOverloading =
false,
2731 bool FirstArgumentIsBase =
false);
2737 bool SuppressUserConversion =
false);
2744 bool SuppressUserConversions =
false,
2745 bool PartialOverloading =
false,
2746 ConversionSequenceList EarlyConversions = None);
2755 bool SuppressUserConversions =
false,
2756 bool PartialOverloading =
false);
2762 bool SuppressUserConversions =
false,
2763 bool PartialOverloading =
false);
2768 ConversionSequenceList &Conversions,
2769 bool SuppressUserConversions,
2773 ObjectClassification = {});
2779 bool AllowObjCConversionOnExplicit,
2780 bool AllowResultConversion =
true);
2786 bool AllowObjCConversionOnExplicit,
2787 bool AllowResultConversion =
true);
2800 bool IsAssignmentOperator =
false,
2801 unsigned NumContextualBoolArguments = 0);
2810 bool PartialOverloading =
false);
2813 void NoteOverloadCandidate(
NamedDecl *Found, FunctionDecl *Fn,
2815 bool TakingAddress =
false);
2820 bool TakingAddress =
false);
2825 bool MissingImplicitThis =
false);
2832 std::pair<Expr *, std::string>
2833 findFailedBooleanCondition(
Expr *Cond,
bool AllowTopLevelCond);
2842 bool diagnoseArgDependentDiagnoseIfAttrs(
const FunctionDecl *Function,
2843 const Expr *ThisArg,
2854 bool diagnoseArgIndependentDiagnoseIfAttrs(
const NamedDecl *ND,
2862 bool Complain =
false,
2874 ResolveAddressOfOverloadedFunction(
Expr *AddressOfExpr,
2878 bool *pHadMultipleCandidates =
nullptr);
2881 resolveAddressOfOnlyViableOverloadCandidate(
Expr *E,
2884 bool resolveAndFixAddressOfOnlyViableOverloadCandidate(
2885 ExprResult &SrcExpr,
bool DoFunctionPointerConversion =
false);
2888 ResolveSingleFunctionTemplateSpecialization(
OverloadExpr *ovl,
2889 bool Complain =
false,
2892 bool ResolveAndFixSingleFunctionTemplateSpecialization(
2894 bool DoFunctionPointerConverion =
false,
2895 bool Complain =
false,
2898 unsigned DiagIDForComplaining = 0);
2901 Expr *FixOverloadedFunctionReference(
Expr *E,
2911 bool PartialOverloading =
false);
2918 FRS_DiagnosticIssued
2934 bool AllowTypoCorrection=
true,
2935 bool CalleesAddressIsTaken=
false);
2945 Expr *input,
bool RequiresADL =
true);
2951 bool RequiresADL =
true);
2958 BuildCallToMemberFunction(Scope *S,
Expr *MemExpr,
2969 bool *NoArrowOperatorFound =
nullptr);
2979 bool CheckParameterNames);
2980 void CheckCXXDefaultArguments(FunctionDecl *FD);
2981 void CheckExtraCXXDefaultArguments(
Declarator &D);
2982 Scope *getNonFieldDeclScope(Scope *S);
3016 LookupOrdinaryName = 0,
3064 NotForRedeclaration = 0,
3071 ForExternalRedeclaration
3079 if (cast<Decl>(CurContext)
3080 ->getOwningModuleForLinkage(
true))
3081 return ForVisibleRedeclaration;
3082 return ForExternalRedeclaration;
3116 typedef std::function<ExprResult(Sema &, TypoExpr *, TypoCorrection)>
3122 struct TypoExprState {
3123 std::unique_ptr<TypoCorrectionConsumer> Consumer;
3124 TypoDiagnosticGenerator DiagHandler;
3127 TypoExprState(TypoExprState &&other) noexcept;
3128 TypoExprState &operator=(TypoExprState &&other) noexcept;
3132 llvm::MapVector<TypoExpr *, TypoExprState> DelayedTypos;
3135 TypoExpr *createDelayedTypo(std::unique_ptr<TypoCorrectionConsumer> TCC,
3136 TypoDiagnosticGenerator TDG,
3143 llvm::MapVector<NamespaceDecl*, bool> KnownNamespaces;
3147 bool LoadedExternalKnownNamespaces;
3152 std::unique_ptr<TypoCorrectionConsumer>
3156 std::unique_ptr<CorrectionCandidateCallback> CCC,
3159 bool ErrorRecovery);
3162 const TypoExprState &getTypoExprState(
TypoExpr *TE)
const;
3165 void clearDelayedTypo(
TypoExpr *TE);
3176 = NotForRedeclaration);
3178 bool AllowBuiltinCreation =
false);
3180 bool InUnqualifiedLookup =
false);
3184 bool AllowBuiltinCreation =
false,
3185 bool EnteringContext =
false);
3188 = NotForRedeclaration);
3199 CXXConstructorDecl *LookupDefaultConstructor(
CXXRecordDecl *Class);
3200 CXXConstructorDecl *LookupCopyingConstructor(
CXXRecordDecl *Class,
3203 bool RValueThis,
unsigned ThisQuals);
3204 CXXConstructorDecl *LookupMovingConstructor(
CXXRecordDecl *Class,
3207 bool RValueThis,
unsigned ThisQuals);
3215 bool AllowStringTemplate,
3216 bool DiagnoseMissing);
3217 bool isKnownName(StringRef name);
3224 bool IncludeGlobalScope =
true,
3225 bool LoadExternal =
true);
3228 bool IncludeGlobalScope =
true,
3229 bool IncludeDependentBases =
false,
3230 bool LoadExternal =
true);
3240 std::unique_ptr<CorrectionCandidateCallback> CCC,
3243 bool EnteringContext =
false,
3245 bool RecordFailure =
true);
3250 std::unique_ptr<CorrectionCandidateCallback> CCC,
3251 TypoDiagnosticGenerator TDG,
3254 bool EnteringContext =
false,
3272 CorrectDelayedTyposInExpr(
Expr *E, VarDecl *InitDecl =
nullptr,
3279 return CorrectDelayedTyposInExpr(E,
nullptr, Filter);
3286 return ER.
isInvalid() ? ER : CorrectDelayedTyposInExpr(ER.
get(), Filter);
3292 return CorrectDelayedTyposInExpr(ER,
nullptr, Filter);
3297 bool ErrorRecovery =
true);
3302 bool ErrorRecovery =
true);
3304 void MarkTypoCorrectedFunctionDefinition(
const NamedDecl *F);
3306 void FindAssociatedClassesAndNamespaces(
SourceLocation InstantiationLoc,
3308 AssociatedNamespaceSet &AssociatedNamespaces,
3309 AssociatedClassSet &AssociatedClasses);
3312 bool ConsiderLinkage,
bool AllowInlineNamespace);
3323 Scope *S,
bool ForRedeclaration,
3327 void AddKnownFunctionAttributes(FunctionDecl *FD);
3331 void ProcessPragmaWeak(Scope *S, Decl *D);
3333 void ProcessDeclAttributes(Scope *S, Decl *D,
const Declarator &PD);
3335 void ProcessDeclAttributeDelayed(Decl *D,
3338 bool IncludeCXX11Attributes =
true);
3348 bool isValidPointerAttrType(
QualType T,
bool RefOkay =
false);
3350 bool CheckRegparmAttr(
const ParsedAttr &attr,
unsigned &value);
3352 const FunctionDecl *FD =
nullptr);
3353 bool CheckAttrTarget(
const ParsedAttr &CurrAttr);
3354 bool CheckAttrNoArgs(
const ParsedAttr &CurrAttr);
3355 bool checkStringLiteralArgumentAttr(
const ParsedAttr &
Attr,
unsigned ArgNum,
3360 bool checkMSInheritanceAttrOnDefinition(
3362 MSInheritanceAttr::Spelling SemanticSpelling);
3364 void CheckAlignasUnderalignment(Decl *D);
3369 void adjustMemberFunctionCC(
QualType &T,
bool IsStatic,
bool IsCtorOrDtor,
3375 bool hasExplicitCallingConv(
QualType &T);
3402 bool isContextSensitive,
3403 bool allowArrayTypes);
3412 bool IsProtocolMethodDecl);
3416 bool IsProtocolMethodDecl);
3422 bool IsProtocolMethodDecl);
3434 void ImplMethodsVsClassMethods(Scope *S,
ObjCImplDecl* IMPDecl,
3436 bool IncompleteImpl =
false);
3440 void DiagnoseUnimplementedProperties(Scope *S,
ObjCImplDecl* IMPDecl,
3442 bool SynthesizeProperties);
3445 void diagnoseNullResettableSynthesizedSetters(
const ObjCImplDecl *impDecl);
3449 void DefaultSynthesizeProperties(Scope *S,
ObjCImplDecl *IMPDecl,
3452 void DefaultSynthesizeProperties(Scope *S, Decl *D,
SourceLocation AtEnd);
3462 void DiagnoseUnusedBackingIvarInAccessor(Scope *S,
3481 const bool isReadWrite,
3482 unsigned &Attributes,
3483 const unsigned AttributesAsWritten,
3499 const bool isReadWrite,
3500 const unsigned Attributes,
3501 const unsigned AttributesAsWritten,
3510 void AtomicPropertySetterGetterRules(
ObjCImplDecl* IMPDecl,
3515 void DiagnoseMissingDesignatedInitOverrides(
3534 void MatchAllMethodDeclarations(
const SelectorSet &InsMap,
3535 const SelectorSet &ClsMap,
3536 SelectorSet &InsMapSeen,
3537 SelectorSet &ClsMapSeen,
3540 bool &IncompleteImpl,
3541 bool ImmediateClass,
3542 bool WarnCategoryMethodImpl=
false);
3555 void AddMethodToGlobalPool(
ObjCMethodDecl *Method,
bool impl,
bool instance);
3560 bool receiverIdOrClass,
3570 CollectMultipleMethodsInGlobalPool(
Selector Sel,
3572 bool InstanceFirst,
bool CheckTheOther,
3583 bool receiverIdOrClass);
3595 bool RecordFailure =
true) {
3597 TypoCorrectionFailures[Typo].insert(TypoLoc);
3607 AddMethodToGlobalPool(Method, impl,
true);
3612 AddMethodToGlobalPool(Method, impl,
false);
3617 void AddAnyMethodToGlobalPool(Decl *D);
3622 bool receiverIdOrClass=
false) {
3623 return LookupMethodInGlobalPool(Sel, R, receiverIdOrClass,
3630 bool receiverIdOrClass=
false) {
3631 return LookupMethodInGlobalPool(Sel, R, receiverIdOrClass,
3678 return FullExprArg(ActOnFinishFullExpr(Arg, CC).
get());
3691 bool HasLeadingEmptyMacro =
false);
3693 void ActOnStartOfCompoundStmt(
bool IsStmtExpr);
3694 void ActOnFinishOfCompoundStmt();
3706 S.ActOnFinishOfCompoundStmt();
3725 StmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
3728 void ActOnForEachDeclStmt(DeclGroupPtrTy Decl);
3734 void ActOnCaseStmtBody(Stmt *
CaseStmt, Stmt *SubStmt);
3738 Stmt *SubStmt, Scope *CurScope);
3759 Stmt *Switch, Stmt *Body);
3776 Stmt *First,
Expr *collection,
3778 StmtResult FinishObjCForCollectionStmt(Stmt *ForCollection, Stmt *Body);
3800 Stmt *RangeDecl, Stmt *
Begin, Stmt *
End,
3805 StmtResult FinishCXXForRangeStmt(Stmt *ForRange, Stmt *Body);
3816 void ActOnCapturedRegionStart(
SourceLocation Loc, Scope *CurScope,
3819 void ActOnCapturedRegionStart(
SourceLocation Loc, Scope *CurScope,
3823 void ActOnCapturedRegionError();
3826 unsigned NumParams);
3830 CES_AllowParameters = 1,
3831 CES_AllowDifferentTypes = 2,
3832 CES_AllowExceptionVariables = 4,
3833 CES_FormerDefault = (CES_AllowParameters),
3834 CES_Default = (CES_AllowParameters | CES_AllowDifferentTypes),
3835 CES_AsIfByStdMove = (CES_AllowParameters | CES_AllowDifferentTypes |
3836 CES_AllowExceptionVariables),
3839 VarDecl *getCopyElisionCandidate(
QualType ReturnType,
Expr *E,
3841 bool isCopyElisionCandidate(
QualType ReturnType,
const VarDecl *VD,
3850 bool IsVolatile,
unsigned NumOutputs,
3856 void FillInlineAsmIdentifierInfo(
Expr *Res,
3857 llvm::InlineAsmIdentifierInfo &Info);
3861 bool IsUnevaluatedContext);
3862 bool LookupInlineAsmField(StringRef
Base, StringRef Member,
3864 ExprResult LookupInlineAsmVarDeclField(
Expr *RefExpr, StringRef Member,
3868 StringRef AsmString,
3869 unsigned NumOutputs,
unsigned NumInputs,
3874 LabelDecl *GetOrCreateMSAsmLabel(StringRef ExternalLabelName,
3881 bool Invalid =
false);
3883 Decl *ActOnObjCExceptionDecl(Scope *S,
Declarator &D);
3886 Decl *Parm, Stmt *Body);
3904 VarDecl *BuildExceptionDeclaration(Scope *S,
TypeSourceInfo *TInfo,
3909 Decl *ActOnExceptionDeclarator(Scope *S,
Declarator &D);
3912 Decl *ExDecl, Stmt *HandlerBlock);
3922 void ActOnStartSEHFinallyBlock();
3923 void ActOnAbortSEHFinallyBlock();
3927 void DiagnoseReturnInConstructorExceptionHandler(
CXXTryStmt *TryBlock);
3929 bool ShouldWarnIfUnusedFileScopedDecl(
const DeclaratorDecl *D)
const;
3933 void MarkUnusedFileScopedDecl(
const DeclaratorDecl *D);
3937 void DiagnoseUnusedExprResult(
const Stmt *S);
3938 void DiagnoseUnusedNestedTypedefs(
const RecordDecl *D);
3939 void DiagnoseUnusedDecl(
const NamedDecl *ND);
3953 void DiagnoseEmptyLoopBody(
const Stmt *S,
3954 const Stmt *PossibleBody);
3957 void DiagnoseSelfMove(
const Expr *LHSExpr,
const Expr *RHSExpr,
3962 void diagnoseNullableToNonnullConversion(
QualType DstType,
QualType SrcType,
3971 void PopParsingDeclaration(ParsingDeclState
state, Decl *
decl);
3985 bool ObjCPropertyAccess,
3986 bool AvoidPartialAvailabilityChecks =
false);
3989 UnavailableAttr::ImplicitReason reason);
3992 void DiagnoseUnguardedAvailabilityViolations(Decl *FD);
3997 bool CanUseDecl(
NamedDecl *D,
bool TreatUnavailableAsInvalid);
4000 bool ObjCPropertyAccess =
false,
4001 bool AvoidPartialAvailabilityChecks =
false);
4002 void NoteDeletedFunction(FunctionDecl *FD);
4003 void NoteDeletedInheritingConstructor(CXXConstructorDecl *CD);
4004 std::string getDeletedOrUnavailableSuffix(
const FunctionDecl *FD);
4011 void PushExpressionEvaluationContext(
4014 ExpressionEvaluationContextRecord::EK_Other);
4016 void PushExpressionEvaluationContext(
4019 ExpressionEvaluationContextRecord::EK_Other);
4020 void PopExpressionEvaluationContext();
4022 void DiscardCleanupsInEvaluationContext();
4041 void MarkAnyDeclReferenced(
SourceLocation Loc, Decl *D,
bool MightBeOdrUse);
4042 void MarkFunctionReferenced(
SourceLocation Loc, FunctionDecl *Func,
4043 bool MightBeOdrUse =
true);
4048 void UpdateMarkingForLValueToRValue(
Expr *E);
4049 void CleanupVarDeclMarking();
4092 const unsigned *
const FunctionScopeIndexToStopAt);
4110 void MarkDeclarationsReferencedInExpr(
Expr *E,
4111 bool SkipLocalVariables =
false);
4117 bool ForceComplain =
false,
4118 bool (*IsPlausibleResult)(
QualType) =
nullptr);
4121 bool tryExprAsCall(
Expr &E,
QualType &ZeroArgCallReturnTy,
4131 bool DiagRuntimeBehavior(
SourceLocation Loc,
const Stmt *Statement,
4139 UnqualifiedId &Id,
bool HasTrailingLParen,
bool IsAddressOfOperand,
4140 std::unique_ptr<CorrectionCandidateCallback> CCC =
nullptr,
4141 bool IsInlineAsmIdentifier =
false,
Token *KeywordReplacement =
nullptr);
4150 std::unique_ptr<CorrectionCandidateCallback> CCC,
4156 bool AllowBuiltinCreation=
false);
4161 bool isAddressOfOperand,
4175 BuildAnonymousStructUnionMemberReference(
4180 Expr *baseObjectExpr =
nullptr,
4192 bool IsDefiniteInstance,
4194 bool UseArgumentDependentLookup(
const CXXScopeSpec &SS,
4196 bool HasTrailingLParen);
4201 bool IsAddressOfOperand,
const Scope *S,
4212 bool AcceptInvalidDecl =
false);
4217 bool AcceptInvalidDecl =
false);
4234 Scope *UDLScope =
nullptr);
4243 Scope *UDLScope =
nullptr);
4248 Expr *ControllingExpr,
4254 Expr *ControllingExpr,
4266 bool isQualifiedMemberAccess(
Expr *E);
4278 bool IsType,
void *TyOrEx,
4282 bool CheckVecStepExpr(
Expr *E);
4288 ExprResult ActOnSizeofParameterPackExpr(Scope *S,
4330 bool SuppressQualifierCheck =
false,
4341 bool CheckQualifiedMemberReference(
Expr *BaseExpr,
QualType BaseType,
4361 void ActOnDefaultCtorInitializers(Decl *CDtorDecl);
4363 FunctionDecl *FDecl,
4367 bool ExecConfig =
false);
4370 const Expr *ArgExpr);
4377 Expr *ExecConfig =
nullptr,
4378 bool IsExecConfig =
false);
4383 Expr *Config =
nullptr,
4384 bool IsExecConfig =
false);
4404 ExprResult MaybeConvertParenListExprToParenExpr(Scope *S,
Expr *ME);
4448 void ActOnStartStmtExpr();
4451 void ActOnStmtExprError();
4489 bool CheckCaseExpression(
Expr *E);
4508 CheckMicrosoftIfExistsSymbol(Scope *S,
CXXScopeSpec &SS,
4512 CheckMicrosoftIfExistsSymbol(Scope *S,
SourceLocation KeywordLoc,
4583 llvm::SmallBitVector FullyCheckedComparisonCategories;
4607 bool isInitListConstructor(
const FunctionDecl *Ctor);
4609 Decl *ActOnUsingDirective(Scope *CurScope,
SourceLocation UsingLoc,
4617 Decl *ActOnNamespaceAliasDef(Scope *CurScope,
4634 bool HasTypenameKeyword,
4652 bool CheckInheritingConstructorUsingDecl(
UsingDecl *UD);
4657 CXXConstructorDecl *
4658 findInheritingConstructor(
SourceLocation Loc, CXXConstructorDecl *BaseCtor,
4680 bool HadMultipleCandidates,
bool IsListInitialization,
4681 bool IsStdInitListInitialization,
4682 bool RequiresZeroInit,
unsigned ConstructKind,
4689 CXXConstructorDecl *Constructor,
bool Elidable,
4691 bool HadMultipleCandidates,
bool IsListInitialization,
4692 bool IsStdInitListInitialization,
4693 bool RequiresZeroInit,
unsigned ConstructKind,
4701 CXXConstructorDecl *Constructor,
bool Elidable,
4703 bool IsListInitialization,
4704 bool IsStdInitListInitialization,
bool RequiresZeroInit,
4712 bool CheckCXXDefaultArgExpr(
SourceLocation CallLoc, FunctionDecl *FD,
4723 void FinalizeVarWithDestructor(VarDecl *VD,
const RecordType *DeclInitType);
4737 llvm::SmallPtrSet<CanQualType, 4> ExceptionsSeen;
4740 void ClearExceptions() {
4741 ExceptionsSeen.clear();
4755 "noexcept(expr) should not be a possible result");
4760 unsigned size()
const {
return Exceptions.size(); }
4769 void CalledExpr(
Expr *E);
4775 ESI.
Type = getExceptionSpecType();
4784 tok::kw_false).
get();
4806 ComputeDefaultedCopyAssignmentExceptionSpec(
CXXMethodDecl *MD);
4816 ComputeDefaultedMoveAssignmentExceptionSpec(
CXXMethodDecl *MD);
4827 CXXConstructorDecl *CD);
4840 void checkExceptionSpecification(
bool IsTopLevel,
4850 bool isLibstdcxxEagerExceptionSpecHack(
const Declarator &D);
4855 void actOnDelayedExceptionSpecification(Decl *Method,
4860 Expr *NoexceptExpr);
4868 bool Diagnose =
false);
4876 CXXConstructorDecl *DeclareImplicitDefaultConstructor(
4881 void DefineImplicitDefaultConstructor(
SourceLocation CurrentLocation,
4882 CXXConstructorDecl *Constructor);
4901 void AdjustDestructorExceptionSpec(
CXXRecordDecl *ClassDecl,
4906 CXXConstructorDecl *Constructor);
4914 CXXConstructorDecl *DeclareImplicitCopyConstructor(
CXXRecordDecl *ClassDecl);
4918 void DefineImplicitCopyConstructor(
SourceLocation CurrentLocation,
4919 CXXConstructorDecl *Constructor);
4928 CXXConstructorDecl *DeclareImplicitMoveConstructor(
CXXRecordDecl *ClassDecl);
4932 void DefineImplicitMoveConstructor(
SourceLocation CurrentLocation,
4933 CXXConstructorDecl *Constructor);
4944 void DefineImplicitCopyAssignment(
SourceLocation CurrentLocation,
4957 void DefineImplicitMoveAssignment(
SourceLocation CurrentLocation,
4962 void ForceDeclarationOfImplicitMembers(
CXXRecordDecl *Class);
4965 void CheckImplicitSpecialMemberDeclaration(Scope *S, FunctionDecl *FD);
4969 bool isImplicitlyDeleted(FunctionDecl *FD);
4975 bool checkThisInStaticMemberFunctionType(
CXXMethodDecl *Method);
4979 bool checkThisInStaticMemberFunctionExceptionSpec(
CXXMethodDecl *Method);
4985 bool checkThisInStaticMemberFunctionAttributes(
CXXMethodDecl *Method);
4992 bool CompleteConstructorCall(CXXConstructorDecl *Constructor,
4996 bool AllowExplicit =
false,
4997 bool IsListInitialization =
false);
5005 bool EnteringContext);
5010 bool EnteringContext);
5104 bool Enabled =
true);
5124 bool CheckCXXThisCapture(
SourceLocation Loc,
bool Explicit =
false,
5125 bool BuildAndDiagnose =
true,
5126 const unsigned *
const FunctionScopeIndexToStopAt =
nullptr,
5127 bool ByCopy =
false);
5132 bool isThisOutsideMemberFunctionBody(
QualType BaseType);
5151 bool IsThrownVarInScope);
5162 bool ListInitialization);
5168 bool ListInitialization);
5210 FunctionDecl *&OperatorNew,
5211 FunctionDecl *&OperatorDelete,
5212 bool Diagnose =
true);
5213 void DeclareGlobalNewDelete();
5219 bool Diagnose =
true);
5220 FunctionDecl *FindUsualDeallocationFunction(
SourceLocation StartLoc,
5221 bool CanProvideSize,
5224 FunctionDecl *FindDeallocationFunctionForDestructor(
SourceLocation StartLoc,
5229 bool UseGlobal,
bool ArrayForm,
5232 bool IsDelete,
bool CallCanBeVirtual,
5233 bool WarnOnNonAbstractTypes,
5275 ExprResult ActOnStartCXXMemberReference(Scope *S,
5280 bool &MayBePseudoDestructor);
5309 Expr *MaybeCreateExprWithCleanups(
Expr *SubExpr);
5310 Stmt *MaybeCreateStmtWithCleanups(Stmt *SubStmt);
5314 CreateMaterializeTemporaryExpr(
QualType T,
Expr *Temporary,
5315 bool BoundToLvalueReference);
5318 return ActOnFinishFullExpr(Expr, Expr ? Expr->
getExprLoc()
5322 bool DiscardedValue =
false,
5323 bool IsConstexpr =
false,
5324 bool IsLambdaInitCaptureInitializer =
false);
5332 bool EnteringContext =
false);
5333 bool isDependentScopeSpecifier(
const CXXScopeSpec &SS);
5359 bool isAcceptableNestedNameSpecifier(
const NamedDecl *SD,
5360 bool *CanCorrect =
nullptr);
5382 : ObjectType(ObjectType), Identifier(II), IdentifierLoc(IdLoc),
5383 CCLoc(ColonColonLoc) {
5388 : ObjectType(
ParsedType::make(ObjectType)), Identifier(II),
5389 IdentifierLoc(IdLoc), CCLoc(ColonColonLoc) {
5393 bool isNonTypeNestedNameSpecifier(Scope *S,
CXXScopeSpec &SS,
5396 bool BuildCXXNestedNameSpecifier(Scope *S,
5398 bool EnteringContext,
5401 bool ErrorRecoveryLookup,
5402 bool *IsCorrectedToColon =
nullptr,
5403 bool OnlyNamespace =
false);
5430 bool ActOnCXXNestedNameSpecifier(Scope *S,
5432 bool EnteringContext,
5434 bool ErrorRecoveryLookup =
false,
5435 bool *IsCorrectedToColon =
nullptr,
5436 bool OnlyNamespace =
false);
5440 bool ActOnCXXNestedNameSpecifierDecltype(
CXXScopeSpec &SS,
5444 bool IsInvalidUnlessNestedName(Scope *S,
CXXScopeSpec &SS,
5446 bool EnteringContext);
5471 bool ActOnCXXNestedNameSpecifier(Scope *S,
5474 TemplateTy TemplateName,
5480 bool EnteringContext);
5490 void *SaveNestedNameSpecifierAnnotation(
CXXScopeSpec &SS);
5502 void RestoreNestedNameSpecifierAnnotation(
void *Annotation,
5506 bool ShouldEnterDeclaratorScope(Scope *S,
const CXXScopeSpec &SS);
5514 bool ActOnCXXEnterDeclaratorScope(Scope *S,
CXXScopeSpec &SS);
5521 void ActOnCXXExitDeclaratorScope(Scope *S,
const CXXScopeSpec &SS);
5528 void ActOnCXXEnterDeclInitializer(Scope *S, Decl *Dcl);
5532 void ActOnCXXExitDeclInitializer(Scope *S, Decl *Dcl);
5537 bool KnownDependent,
5546 bool IsConstexprSpecified);
5554 bool ExplicitParams,
5555 bool ExplicitResultType,
5564 return ParsedType::make(buildLambdaInitCaptureInitialization(
5565 Loc, ByRef, Id, InitKind != LambdaCaptureInitKind::CopyInit, Init));
5569 bool DirectInit, Expr *&Init);
5579 unsigned InitStyle, Expr *Init);
5589 void addLambdaParameters(
CXXMethodDecl *CallOperator, Scope *CurScope);
5605 bool IsInstantiation =
false);
5617 bool DiagnoseUnusedLambdaCapture(
SourceRange CaptureRange,
5637 void DefineImplicitLambdaToFunctionPointerConversion(
5647 void DefineImplicitLambdaToBlockPointerConversion(
SourceLocation CurrentLoc,
5689 bool HadMultipleCandidates);
5703 bool WarnMultipleSelectors);
5716 Decl *ActOnStartLinkageSpecification(Scope *S,
5720 Decl *ActOnFinishLinkageSpecification(Scope *S,
5743 void ActOnStartCXXInClassMemberInitializer();
5744 void ActOnFinishCXXInClassMemberInitializer(Decl *VarDecl,
5794 bool SetDelegatingInitializer(CXXConstructorDecl *Constructor,
5797 bool SetCtorInitializers(CXXConstructorDecl *Constructor,
bool AnyErrors,
5812 typedef std::pair<CXXRecordDecl*, SourceLocation>
VTableUse;
5825 void LoadExternalVTableUses();
5830 bool DefinitionRequired =
false);
5847 bool DefineUsedVTables();
5849 void AddImplicitlyDeclaredMembersToClass(
CXXRecordDecl *ClassDecl);
5851 void ActOnMemInitializers(Decl *ConstructorDecl,
5862 void referenceDLLExportedClassMethods();
5864 void propagateDLLAttrToBaseClassTemplate(
5875 void ActOnFinishCXXMemberSpecification(Scope *S,
SourceLocation RLoc,
5879 void ActOnFinishCXXMemberDecls();
5880 void ActOnFinishCXXNonNestedClass(Decl *D);
5882 void ActOnReenterCXXMethodParameter(Scope *S,
ParmVarDecl *Param);
5883 unsigned ActOnReenterTemplateScope(Scope *S, Decl *Template);
5884 void ActOnStartDelayedMemberDeclarations(Scope *S, Decl *Record);
5885 void ActOnStartDelayedCXXMethodDeclaration(Scope *S, Decl *Method);
5886 void ActOnDelayedCXXMethodParameter(Scope *S, Decl *Param);
5887 void ActOnFinishDelayedMemberDeclarations(Scope *S, Decl *Record);
5888 void ActOnFinishDelayedCXXMethodDeclaration(Scope *S, Decl *Method);
5889 void ActOnFinishDelayedMemberInitializers(Decl *Record);
5890 void MarkAsLateParsedTemplate(FunctionDecl *FD, Decl *FnD,
5892 void UnmarkAsLateParsedTemplate(FunctionDecl *FD);
5893 bool IsInsideALocalClassWithinATemplateFunction();
5895 Decl *ActOnStaticAssertDeclaration(
SourceLocation StaticAssertLoc,
5897 Expr *AssertMessageExpr,
5899 Decl *BuildStaticAssertDeclaration(
SourceLocation StaticAssertLoc,
5908 Decl *ActOnFriendTypeDecl(Scope *S,
const DeclSpec &DS,
5915 void CheckConstructor(CXXConstructorDecl *Constructor);
5926 void CheckExplicitlyDefaultedSpecialMember(
CXXMethodDecl *MD);
5927 void CheckExplicitlyDefaultedMemberExceptionSpec(
CXXMethodDecl *MD,
5929 void CheckDelayedMemberExceptionSpecs();
5942 BaseResult ActOnBaseSpecifier(Decl *classdecl,
5952 void ActOnBaseSpecifiers(Decl *ClassDecl,
5964 CXXCastPath *BasePath =
nullptr,
5965 bool IgnoreAccess =
false);
5967 unsigned InaccessibleBaseID,
5968 unsigned AmbigiousBaseConvID,
5971 CXXCastPath *BasePath,
5972 bool IgnoreAccess =
false);
5974 std::string getAmbiguousPathsDisplayString(
CXXBasePaths &Paths);
5976 bool CheckOverridingFunctionAttributes(
const CXXMethodDecl *New,
5981 bool CheckOverridingFunctionReturnType(
const CXXMethodDecl *New,
5986 bool CheckOverridingFunctionExceptionSpec(
const CXXMethodDecl *New,
5992 void CheckOverrideControl(
NamedDecl *D);
5996 void DiagnoseAbsenceOfOverrideControl(
NamedDecl *D);
6001 bool CheckIfOverriddenFunctionIsMarkedFinal(
const CXXMethodDecl *New,
6016 bool SetMemberAccessSpecifier(
NamedDecl *MemberDecl,
6028 bool Diagnose =
true);
6030 CXXConstructorDecl *D,
6033 bool IsCopyBindingRefToTemp =
false);
6035 CXXConstructorDecl *D,
6057 bool ForceCheck =
false,
6058 bool ForceUnprivileged =
false);
6061 bool isSpecialMemberAccessibleForDeletion(
CXXMethodDecl *decl,
6067 void PerformDependentDiagnostics(
const DeclContext *Pattern,
6090 template <
typename... Ts>
6092 const Ts &...Args) {
6094 return RequireNonAbstractType(Loc, T, Diagnoser);
6103 bool CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl);
6105 bool CheckLiteralOperatorDeclaration(FunctionDecl *FnDecl);
6111 bool AllowFunctionTemplates =
true);
6113 bool AllowFunctionTemplates =
true);
6116 QualType ObjectType,
bool EnteringContext,
6117 bool &MemberOfUnknownSpecialization,
6122 bool hasTemplateKeyword,
6125 bool EnteringContext,
6126 TemplateTy &Template,
6127 bool &MemberOfUnknownSpecialization);
6139 TemplateTy &SuggestedTemplate,
6142 bool DiagnoseUninstantiableTemplate(
SourceLocation PointOfInstantiation,
6144 bool InstantiatedFromMember,
6148 bool Complain =
true);
6150 void DiagnoseTemplateParameterShadow(
SourceLocation Loc, Decl *PrevDecl);
6153 NamedDecl *ActOnTypeParameter(Scope *S,
bool Typename,
6158 unsigned Depth,
unsigned Position,
6171 NamedDecl *ActOnTemplateTemplateParameter(Scope *S,
6183 ActOnTemplateParameterList(
unsigned Depth,
6189 Expr *RequiresClause);
6200 TPC_TypeAliasTemplate
6210 bool IsFriend,
bool &IsMemberSpecialization,
bool &Invalid);
6230 void NoteAllFoundTemplates(TemplateName Name);
6232 QualType CheckTemplateIdType(TemplateName Template,
6243 bool IsCtorOrDtorName =
false,
6244 bool IsClassName =
false);
6253 TemplateTy TemplateD,
6275 void diagnoseMissingTemplateArguments(TemplateName Name,
SourceLocation Loc);
6291 TemplateTy &Template,
bool AllowInjectedClassName =
false);
6302 unsigned NumExplicitArgs,
6304 void CheckTemplatePartialSpecialization(
6306 void CheckTemplatePartialSpecialization(
6309 Decl *ActOnTemplateDeclarator(Scope *S,
6321 bool CheckDependentFunctionTemplateSpecialization(FunctionDecl *FD,
6325 bool CheckFunctionTemplateSpecialization(FunctionDecl *FD,
6345 DeclResult ActOnExplicitInstantiation(Scope *S,
6351 SubstDefaultTemplateArgumentIfAvailable(
TemplateDecl *Template,
6357 bool &HasDefaultArg);
6372 CTAK_DeducedFromArrayBound
6375 bool CheckTemplateArgument(
NamedDecl *Param,
6380 unsigned ArgumentPackIndex,
6412 bool PartialTemplateArgs,
6414 bool UpdateArgsWithConversions =
true);
6423 QualType InstantiatedParamType, Expr *Arg,
6468 TPL_TemplateTemplateArgumentMatch
6511 TemplateTy TemplateName,
6527 bool RebuildNestedNameSpecifierInCurrentInstantiation(
CXXScopeSpec &SS);
6529 ExprResult RebuildExprInCurrentInstantiation(Expr *E);
6530 bool RebuildTemplateParamsInCurrentInstantiation(
6548 bool isUnexpandedParameterPackPermitted();
6557 UPPC_Expression = 0,
6650 bool DiagnoseUnexpandedParameterPack(Expr *E,
6660 bool DiagnoseUnexpandedParameterPack(
const CXXScopeSpec &SS,
6683 TemplateName Template,
6834 bool &RetainExpansion,
6862 bool containsUnexpandedParameterPacks(
Declarator &D);
6894 bool AdjustExceptionSpec =
false);
6954 TDK_CUDATargetMismatch
6978 unsigned ArgIdx,
QualType OriginalArgType)
6979 : OriginalParamType(OriginalParamType),
6980 DecomposedParam(DecomposedParam), ArgIdx(ArgIdx),
6981 OriginalArgType(OriginalArgType) {}
6992 unsigned NumExplicitlySpecified, FunctionDecl *&Specialization,
6995 bool PartialOverloading =
false,
6996 llvm::function_ref<
bool()> CheckNonDependent = []{
return false; });
7002 bool PartialOverloading,
7009 FunctionDecl *&Specialization,
7011 bool IsAddressOfFunction =
false);
7022 FunctionDecl *&Specialization,
7024 bool IsAddressOfFunction =
false);
7039 DAR_FailedAlreadyDiagnosed
7048 void DiagnoseAutoDeductionFailure(VarDecl *VDecl, Expr *Init);
7050 bool Diagnose =
true);
7054 void DeclareImplicitDeductionGuides(
TemplateDecl *Template,
7057 QualType DeduceTemplateSpecializationFromInitializer(
7066 TypeLoc getReturnTypeLoc(FunctionDecl *FD)
const;
7068 bool DeduceFunctionTypeFromReturnExpr(FunctionDecl *FD,
7076 unsigned NumCallArguments1,
7077 unsigned NumCallArguments2);
7088 getMoreSpecializedPartialSpecialization(
7103 bool isTemplateTemplateParameterAtLeastAsSpecializedAs(
7109 llvm::SmallBitVector &
Used);
7112 llvm::SmallBitVector &Deduced) {
7113 return MarkDeducedTemplateParameters(Context, FunctionTemplate, Deduced);
7115 static void MarkDeducedTemplateParameters(
ASTContext &Ctx,
7117 llvm::SmallBitVector &Deduced);
7124 getTemplateInstantiationArgs(
NamedDecl *D,
7126 bool RelativeToPrimary =
false,
7127 const FunctionDecl *Pattern =
nullptr);
7218 assert(Kind != DeclaringSpecialMember);
7219 return {TemplateArgs, NumTemplateArgs};
7232 : Kind(TemplateInstantiation), Entity(nullptr), Template(nullptr),
7233 TemplateArgs(nullptr), NumTemplateArgs(0), DeductionInfo(nullptr) {}
7237 bool isInstantiationRecord()
const;
7293 unsigned LastEmittedCodeSynthesisContextDepth = 0;
7300 std::vector<std::unique_ptr<TemplateInstantiationCallback>>
7317 int OldSubstitutionIndex;
7321 : Self(Self), OldSubstitutionIndex(Self.ArgumentPackSubstitutionIndex) {
7330 friend class ArgumentPackSubstitutionRAII;
7337 typedef llvm::DenseMap<Decl *, SmallVector<PartialDiagnosticAt, 1> >
7457 bool AlreadyInstantiating;
7458 bool CheckInstantiationDepth(
SourceLocation PointOfInstantiation,
7464 Decl *Entity,
NamedDecl *Template =
nullptr,
7475 void popCodeSynthesisContext();
7479 return CodeSynthesisContexts.size() > NonInstantiationEntries;
7483 if (!CodeSynthesisContexts.empty() &&
7484 CodeSynthesisContexts.size() != LastEmittedCodeSynthesisContextDepth) {
7485 PrintInstantiationStack();
7486 LastEmittedCodeSynthesisContextDepth = CodeSynthesisContexts.size();
7488 if (PragmaAttributeCurrentTargetDecl)
7489 PrintPragmaAttributeInstantiationPoint();
7491 void PrintInstantiationStack();
7493 void PrintPragmaAttributeInstantiationPoint();
7508 assert(!ExprEvalContexts.empty() &&
7509 "Must be in an expression evaluation context");
7510 return ExprEvalContexts.back().isUnevaluated();
7518 unsigned PrevSFINAEErrors;
7519 bool PrevInNonInstantiationSFINAEContext;
7520 bool PrevAccessCheckingSFINAE;
7521 bool PrevLastDiagnosticIgnored;
7525 : SemaRef(SemaRef), PrevSFINAEErrors(SemaRef.NumSFINAEErrors),
7526 PrevInNonInstantiationSFINAEContext(
7527 SemaRef.InNonInstantiationSFINAEContext),
7528 PrevAccessCheckingSFINAE(SemaRef.AccessCheckingSFINAE),
7529 PrevLastDiagnosticIgnored(
7530 SemaRef.getDiagnostics().isLastDiagnosticIgnored())
7540 = PrevInNonInstantiationSFINAEContext;
7543 PrevLastDiagnosticIgnored);
7560 bool PrevDisableTypoCorrection;
7563 : SemaRef(SemaRef), Trap(SemaRef,
true),
7564 PrevDisableTypoCorrection(SemaRef.DisableTypoCorrection) {
7616 : S(S), Enabled(Enabled) {
7617 if (!Enabled)
return;
7625 S.DefineUsedVTables();
7626 S.PerformPendingInstantiations();
7631 if (!Enabled)
return;
7634 assert(S.VTableUses.empty() &&
7635 "VTableUses should be empty before it is discarded.");
7636 S.VTableUses.swap(SavedVTableUses);
7639 assert(S.PendingInstantiations.empty() &&
7640 "PendingInstantiations should be empty before it is discarded.");
7641 S.PendingInstantiations.swap(SavedPendingInstantiations);
7647 std::deque<PendingImplicitInstantiation> SavedPendingInstantiations;
7663 SavedPendingLocalImplicitInstantiations.swap(
7667 void perform() { S.PerformPendingInstantiations(
true); }
7670 assert(S.PendingLocalImplicitInstantiations.empty() &&
7671 "there shouldn't be any pending local implicit instantiations");
7672 SavedPendingLocalImplicitInstantiations.swap(
7673 S.PendingLocalImplicitInstantiations);
7678 std::deque<PendingImplicitInstantiation>
7679 SavedPendingLocalImplicitInstantiations;
7685 bool HasInteresting =
false;
7691 assert(Infos.size() <= index);
7692 Infos.resize(index);
7693 Infos.push_back(info);
7695 if (!HasInteresting)
7703 if (!HasInteresting)
return nullptr;
7704 Infos.resize(numParams);
7705 return Infos.data();
7709 void PerformPendingInstantiations(
bool LocalOnly =
false);
7714 bool AllowDeducedTST =
false);
7729 unsigned ThisTypeQuals);
7738 int indexAdjustment,
7740 bool ExpectParameterPack);
7779 bool CXXDirectInit);
7791 bool Complain =
true);
7798 bool InstantiateInClassInitializer(
7809 : TmplAttr(A), Scope(S), NewDecl(D)
7815 const Decl *Pattern, Decl *Inst,
7816 LateInstantiatedAttrVec *LateAttrs =
nullptr,
7821 const Decl *Pattern, Decl *Inst,
7822 LateInstantiatedAttrVec *LateAttrs =
nullptr,
7825 bool usesPartialOrExplicitSpecialization(
7829 InstantiateClassTemplateSpecialization(
SourceLocation PointOfInstantiation,
7832 bool Complain =
true);
7834 void InstantiateClassMembers(
SourceLocation PointOfInstantiation,
7839 void InstantiateClassTemplateSpecializationMembers(
7859 void InstantiateExceptionSpec(
SourceLocation PointOfInstantiation,
7860 FunctionDecl *Function);
7864 void InstantiateFunctionDefinition(
SourceLocation PointOfInstantiation,
7865 FunctionDecl *Function,
7866 bool Recursive =
false,
7867 bool DefinitionRequired =
false,
7868 bool AtEndOfTU =
false);
7875 LateInstantiatedAttrVec *LateAttrs =
nullptr,
7881 BuildVariableInstantiation(VarDecl *NewVar, VarDecl *OldVar,
7883 LateInstantiatedAttrVec *LateAttrs,
7886 bool InstantiatingVarTemplate =
false);
7887 void InstantiateVariableInitializer(
7888 VarDecl *Var, VarDecl *OldVar,
7890 void InstantiateVariableDefinition(
SourceLocation PointOfInstantiation,
7891 VarDecl *Var,
bool Recursive =
false,
7892 bool DefinitionRequired =
false,
7893 bool AtEndOfTU =
false);
7895 void InstantiateMemInitializers(CXXConstructorDecl *New,
7896 const CXXConstructorDecl *Tmpl,
7901 bool FindingInstantiatedContext =
false);
7913 OCK_CategoryImplementation
7931 Decl *ActOnStartClassInterface(
7936 Decl *
const *ProtoRefs,
unsigned NumProtoRefs,
7940 void ActOnSuperClassOfClassInterface(Scope *S,
7955 Decl *ActOnCompatibilityAlias(
7960 bool CheckForwardProtocolDeclarationForCircularDependency(
7965 Decl *ActOnStartProtocolInterface(
7971 Decl *ActOnStartCategoryInterface(
7975 Decl *
const *ProtoRefs,
unsigned NumProtoRefs,
7979 Decl *ActOnStartClassImplementation(
7985 Decl *ActOnStartCategoryImplementation(
SourceLocation AtCatImplLoc,
7991 DeclGroupPtrTy ActOnFinishObjCImplementation(Decl *ObjCImpDecl,
8005 void FindProtocolDeclaration(
bool WarnOnDeclarations,
bool ForObjCContainer,
8013 bool SelectProtocolFirst =
false);
8018 void actOnObjCTypeArgsOrProtocolQualifiers(
8031 bool warnOnIncompleteProtocols);
8042 TypeResult actOnObjCTypeArgsAndProtocolQualifiers(
8060 bool FailOnError =
false);
8072 bool FailOnError =
false);
8081 void CheckObjCPropertyAttributes(Decl *PropertyPtrTy,
8083 unsigned &Attributes,
8084 bool propertyInPrimaryClass);
8095 bool OverridingProtocolProperty);
8111 Decl *ActOnPropertyImplDecl(Scope *S,
8126 OSMK_NonRetainingInit
8141 Decl *ActOnMethodDeclaration(
8152 bool isVariadic,
bool MethodDefinition);
8161 bool inferObjCARCLifetime(
ValueDecl *decl);
8196 bool HasTrailingDot,
8215 bool isImplicit =
false);
8218 bool isSuperReceiver,
8232 ExprResult BuildInstanceMessage(Expr *Receiver,
8241 bool isImplicit =
false);
8243 ExprResult BuildInstanceMessageImplicit(Expr *Receiver,
8284 TypedefNameDecl *&TDNDecl,
8285 bool CfToNs,
bool Diagnose =
true);
8289 Expr *&SrcExpr,
bool Diagnose =
true);
8291 bool ConversionToObjCStringLiteralCheck(
QualType DstType, Expr *&SrcExpr,
8292 bool Diagnose =
true);
8332 StringRef SlotLabel, Expr *Alignment);
8335 NonDefaultStateAtInclude,
8341 void DiagnoseUnterminatedPragmaPack();
8354 void ActOnPragmaMSPointersToMembers(
8361 MSVtorDispAttr::Mode Value);
8370 bool UnifySection(StringRef SectionName,
8372 DeclaratorDecl *TheDecl);
8373 bool UnifySection(StringRef SectionName,
8380 llvm::StringRef StackSlotLabel,
8382 llvm::StringRef PragmaName);
8396 void ActOnPragmaDetectMismatch(
SourceLocation Loc, StringRef Name,
8400 void ActOnPragmaUnused(
const Token &Identifier,
8439 void AddAlignmentAttributesForRecord(
RecordDecl *RD);
8442 void AddMsStructLayoutForRecord(
RecordDecl *RD);
8445 void FreePackedContext();
8449 void PushNamespaceVisibilityAttr(
const VisibilityAttr *Attr,
8454 void AddPushedVisibilityAttribute(Decl *RD);
8458 void PopPragmaVisibility(
bool IsNamespaceEnd,
SourceLocation EndLoc);
8461 void FreeVisContext();
8466 void AddCFAuditedAttribute(Decl *D);
8477 void AddPragmaAttributes(Scope *S, Decl *D);
8479 void DiagnoseUnterminatedPragmaAttribute();
8487 return OptimizeOffPragmaLocation;
8493 void AddRangeBasedOptnone(FunctionDecl *FD);
8498 void AddOptnoneAttributeIfNoConflicts(FunctionDecl *FD,
SourceLocation Loc);
8501 void AddAlignedAttr(
SourceRange AttrRange, Decl *D, Expr *E,
8502 unsigned SpellingListIndex,
bool IsPackExpansion);
8504 unsigned SpellingListIndex,
bool IsPackExpansion);
8508 void AddAssumeAlignedAttr(
SourceRange AttrRange, Decl *D, Expr *E, Expr *OE,
8509 unsigned SpellingListIndex);
8513 void AddAllocAlignAttr(
SourceRange AttrRange, Decl *D, Expr *ParamExpr,
8514 unsigned SpellingListIndex);
8518 void AddAlignValueAttr(
SourceRange AttrRange, Decl *D, Expr *E,
8519 unsigned SpellingListIndex);
8523 void AddLaunchBoundsAttr(
SourceRange AttrRange, Decl *D, Expr *MaxThreads,
8524 Expr *MinBlocks,
unsigned SpellingListIndex);
8528 unsigned SpellingListIndex,
bool InInstantiation =
false);
8530 void AddParameterABIAttr(
SourceRange AttrRange, Decl *D,
8533 void AddNSConsumedAttr(
SourceRange AttrRange, Decl *D,
8534 unsigned SpellingListIndex,
bool isNSConsumed,
8549 bool IsImplicit =
false);
8554 bool IsImplicit =
false);
8558 void CheckCompletedCoroutineBody(FunctionDecl *FD, Stmt *&Body);
8566 std::string CurrOpenCLExtension;
8568 llvm::DenseMap<const Type*, std::set<std::string>> OpenCLTypeExtMap;
8570 llvm::DenseMap<const Decl*, std::set<std::string>> OpenCLDeclExtMap;
8573 return CurrOpenCLExtension;
8576 CurrOpenCLExtension = Ext;
8582 void setOpenCLExtensionForType(
QualType T, llvm::StringRef Exts);
8588 void setOpenCLExtensionForDecl(Decl *FD, llvm::StringRef Exts);
8593 void setCurrentOpenCLExtensionForType(
QualType T);
8598 void setCurrentOpenCLExtensionForDecl(Decl *FD);
8600 bool isOpenCLDisabledDecl(Decl *FD);
8612 bool checkOpenCLDisabledDecl(
const NamedDecl &D,
const Expr &E);
8618 void *VarDataSharingAttributesStack;
8620 bool IsInOpenMPDeclareTargetContext =
false;
8622 void InitDataSharingAttributesStack();
8623 void DestroyDataSharingAttributesStack();
8626 bool StrictlyPositive =
true);
8628 unsigned getOpenMPNestingLevel()
const;
8631 void adjustOpenMPTargetScopeIndex(
unsigned &FunctionScopesIndex,
8632 unsigned Level)
const;
8635 void pushOpenMPFunctionRegion();
8650 template <
typename T,
typename DiagLocT,
typename DiagInfoT,
typename MapT>
8651 bool checkOpenCLDisabledTypeOrDecl(T D, DiagLocT DiagLoc, DiagInfoT DiagInfo,
8660 bool isOpenMPCapturedByRef(
const ValueDecl *D,
unsigned Level)
const;
8665 VarDecl *isOpenMPCapturedDecl(
ValueDecl *D)
const;
8672 bool isOpenMPPrivateDecl(
const ValueDecl *D,
unsigned Level)
const;
8682 bool isOpenMPTargetCapturedDecl(
const ValueDecl *D,
unsigned Level)
const;
8693 void EndOpenMPClause();
8695 void EndOpenMPDSABlock(Stmt *CurDirective);
8701 void ActOnOpenMPLoopInitialization(
SourceLocation ForLoc, Stmt *Init);
8706 ExprResult ActOnOpenMPIdExpression(Scope *CurScope,
8710 DeclGroupPtrTy ActOnOpenMPThreadprivateDirective(
8721 DeclGroupPtrTy ActOnOpenMPDeclareReductionDirectiveStart(
8723 ArrayRef<std::pair<QualType, SourceLocation>> ReductionTypes,
8726 void ActOnOpenMPDeclareReductionCombinerStart(Scope *S, Decl *D);
8728 void ActOnOpenMPDeclareReductionCombinerEnd(Decl *D, Expr *Combiner);
8731 VarDecl *ActOnOpenMPDeclareReductionInitializerStart(Scope *S, Decl *D);
8733 void ActOnOpenMPDeclareReductionInitializerEnd(Decl *D, Expr *Initializer,
8734 VarDecl *OmpPrivParm);
8736 DeclGroupPtrTy ActOnOpenMPDeclareReductionDirectiveEnd(
8737 Scope *S, DeclGroupPtrTy DeclReductions,
bool IsValid);
8742 void ActOnFinishOpenMPDeclareTargetDirective();
8744 void ActOnOpenMPDeclareTargetName(Scope *CurScope,
CXXScopeSpec &ScopeSpec,
8746 OMPDeclareTargetDeclAttr::MapTypeTy MT,
8747 NamedDeclSetType &SameDirectiveDecls);
8749 void checkDeclIsAllowedInOpenMPTarget(Expr *E, Decl *D,
8753 return IsInOpenMPDeclareTargetContext;
8756 bool isInOpenMPTargetExecutionDirective()
const;
8760 return !getLangOpts().OpenMPIsDevice || isInOpenMPDeclareTargetContext() ||
8761 isInOpenMPTargetExecutionDirective();
8787 llvm::SmallDenseMap<const ValueDecl *, const Expr *, 4>;
8837 StmtResult ActOnOpenMPParallelForSimdDirective(
8908 StmtResult ActOnOpenMPTargetParallelForDirective(
8950 StmtResult ActOnOpenMPDistributeParallelForDirective(
8955 StmtResult ActOnOpenMPDistributeParallelForSimdDirective(
8960 StmtResult ActOnOpenMPDistributeSimdDirective(
8965 StmtResult ActOnOpenMPTargetParallelForSimdDirective(
8976 StmtResult ActOnOpenMPTeamsDistributeDirective(
8981 StmtResult ActOnOpenMPTeamsDistributeSimdDirective(
8986 StmtResult ActOnOpenMPTeamsDistributeParallelForSimdDirective(
8991 StmtResult ActOnOpenMPTeamsDistributeParallelForDirective(
9002 StmtResult ActOnOpenMPTargetTeamsDistributeDirective(
9007 StmtResult ActOnOpenMPTargetTeamsDistributeParallelForDirective(
9012 StmtResult ActOnOpenMPTargetTeamsDistributeParallelForSimdDirective(
9017 StmtResult ActOnOpenMPTargetTeamsDistributeSimdDirective(
9031 DeclGroupPtrTy ActOnOpenMPDeclareSimdDirective(
9032 DeclGroupPtrTy DG, OMPDeclareSimdDeclAttr::BranchStateTy BS,
9054 OMPClause *ActOnOpenMPNumThreadsClause(Expr *NumThreads,
9059 OMPClause *ActOnOpenMPSafelenClause(Expr *Length,
9068 OMPClause *ActOnOpenMPCollapseClause(Expr *NumForLoops,
9076 Expr *NumForLoops =
nullptr);
9109 OMPClause *ActOnOpenMPSingleExprWithArgClause(
9194 OMPClause *ActOnOpenMPTaskReductionClause(
9201 OMPClause *ActOnOpenMPInReductionClause(
9257 OMPClause *ActOnOpenMPThreadLimitClause(Expr *ThreadLimit,
9266 OMPClause *ActOnOpenMPDistScheduleClause(
9307 CCK_ForBuiltinOverloadedOp
9311 return CCK == CCK_CStyleCast || CCK == CCK_FunctionalCast ||
9312 CCK == CCK_OtherCast;
9320 const CXXCastPath *BasePath =
nullptr,
9322 = CCK_ImplicitConversion);
9339 ExprResult CallExprUnaryConversions(Expr *E);
9343 ExprResult DefaultFunctionArrayConversion(Expr *E,
bool Diagnose =
true);
9348 ExprResult DefaultFunctionArrayLvalueConversion(Expr *E,
9349 bool Diagnose =
true);
9360 ExprResult DefaultArgumentPromotion(Expr *E);
9365 ExprResult TemporaryMaterializationConversion(Expr *E);
9373 VariadicDoesNotApply
9398 bool hasCStrMethod(
const Expr *E);
9402 bool GatherArgumentsForCall(
SourceLocation CallLoc, FunctionDecl *FDecl,
9407 bool AllowExplicit =
false,
9408 bool IsListInitialization =
false);
9413 FunctionDecl *FDecl);
9421 bool IsCompAssign =
false);
9502 bool *Complained =
nullptr);
9507 bool IsValueInFlagEnum(
const EnumDecl *ED,
const llvm::APInt &Val,
9508 bool AllowMask)
const;
9528 bool ConvertRHS =
true);
9546 bool DiagnoseCFAudited =
false,
bool ConvertRHS =
true);
9553 bool IsStringLiteralToNonConstPointerConversion(Expr *From,
QualType ToType);
9555 bool CheckExceptionSpecCompatibility(Expr *From,
QualType ToType);
9559 bool AllowExplicit =
false);
9568 = CCK_ImplicitConversion);
9582 QualType CheckPointerToMemberOperands(
9585 QualType CheckMultiplyDivideOperands(
9590 bool IsCompAssign =
false);
9619 Expr *LHS, Expr *RHS);
9626 QualType CXXCheckConditionalOperands(
9630 bool ConvertArgs =
true);
9633 bool ConvertArgs =
true) {
9634 Expr *E1Tmp = E1.
get(), *E2Tmp = E2.
get();
9636 FindCompositePointerType(Loc, E1Tmp, E2Tmp, ConvertArgs);
9645 bool DiagnoseConditionalForNull(Expr *LHSExpr, Expr *RHSExpr,
9648 void DiagnoseAlwaysNonNullPointer(Expr *E,
9655 bool AllowBothBool,
bool AllowBoolConversion);
9667 bool CheckForConstantInitializer(Expr *e,
QualType t);
9677 Ref_Incompatible = 0,
9688 bool &DerivedToBase,
9689 bool &ObjCConversion,
9690 bool &ObjCLifetimeConversion);
9703 Expr *result,
QualType ¶mType);
9736 bool Diagnose =
true,
9737 bool DiagnoseCFAudited =
false,
9741 Expr *stripARCUnbridgedCast(Expr *e);
9742 void diagnoseARCUnbridgedCast(Expr *e);
9744 bool CheckObjCARCUnavailableWeakConversion(
QualType castType,
9750 void checkRetainCycles(Expr *receiver, Expr *argument);
9751 void checkRetainCycles(VarDecl *Var, Expr *Init);
9759 void checkUnsafeExprAssigns(
SourceLocation Loc, Expr *LHS, Expr *RHS);
9765 bool CheckMessageArgumentTypes(
QualType ReceiverType,
9769 bool isSuperMessage,
9779 bool isClassMessage,
bool isSuperMessage);
9783 void EmitRelatedResultTypeNote(
const Expr *E);
9788 void EmitRelatedResultTypeNoteForReturn(
QualType destType);
9800 : ConditionVar(ConditionVar), Condition(Condition), Invalid(
false),
9801 HasKnownValue(IsConstexpr && Condition.get() &&
9802 !Condition.get()->isValueDependent()),
9803 KnownValue(HasKnownValue &&
9804 !!Condition.get()->EvaluateKnownConstInt(S.Context)) {}
9806 : ConditionVar(nullptr), Condition(nullptr), Invalid(Invalid),
9812 std::pair<VarDecl *, Expr *>
get()
const {
9813 return std::make_pair(cast_or_null<VarDecl>(ConditionVar),
9839 ExprResult CheckConditionVariable(VarDecl *ConditionVar,
9853 bool IsConstexpr =
false);
9857 void DiagnoseAssignmentAsCondition(Expr *E);
9861 void DiagnoseEqualityWithExtraParens(
ParenExpr *ParenE);
9864 ExprResult CheckCXXBooleanCondition(Expr *CondExpr,
bool IsConstexpr =
false);
9869 void ConvertIntegerToTypeWarnOnOverflow(llvm::APSInt &OldVal,
9870 unsigned NewWidth,
bool NewSign,
9876 bool CheckObjCDeclScope(Decl *D);
9894 ExprResult VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result,
9896 bool AllowFold =
true);
9897 ExprResult VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result,
9899 bool AllowFold =
true);
9900 ExprResult VerifyIntegerConstantExpression(Expr *E,
9901 llvm::APSInt *Result =
nullptr);
9909 Expr *BitWidth,
bool *ZeroWidth =
nullptr);
9912 unsigned ForceCUDAHostDeviceDepth = 0;
9918 void PushForceCUDAHostDevice();
9923 bool PopForceCUDAHostDevice();
9928 llvm::DenseMap<CanonicalDeclPtr<FunctionDecl>,
9929 std::vector<PartialDiagnosticAt>>
9960 llvm::DenseMap< CanonicalDeclPtr<FunctionDecl>,
9961 llvm::MapVector<CanonicalDeclPtr<FunctionDecl>,
9997 FunctionDecl *Fn,
Sema &S);
10010 operator bool()
const {
return ImmediateDiag.hasValue(); }
10012 template <
typename T>
10015 if (Diag.ImmediateDiag.hasValue())
10016 *Diag.ImmediateDiag << Value;
10017 else if (Diag.PartialDiag.hasValue())
10018 *Diag.PartialDiag << Value;
10027 bool ShowCallStack;
10073 bool IgnoreImplicitHDAttr =
false);
10078 return IdentifyCUDATarget(dyn_cast<FunctionDecl>(CurContext));
10102 const FunctionDecl *Callee);
10110 const FunctionDecl *Callee) {
10111 return IdentifyCUDAPreference(Caller, Callee) != CFP_Never;
10116 void maybeAddCUDAHostDeviceAttrs(FunctionDecl *FD,
10147 void EraseUnwantedCUDAMatches(
10148 const FunctionDecl *Caller,
10149 SmallVectorImpl<std::pair<DeclAccessPair, FunctionDecl *>> &Matches);
10162 bool inferCUDATargetForImplicitSpecialMember(
CXXRecordDecl *ClassDecl,
10170 bool isEmptyCudaConstructor(
SourceLocation Loc, CXXConstructorDecl *CD);
10181 void checkAllowedCUDAInitializer(VarDecl *VD);
10185 void checkCUDATargetOverload(FunctionDecl *NewFD,
10235 PCC_LocalDeclarationSpecifiers
10238 void CodeCompleteModuleImport(
SourceLocation ImportLoc, ModuleIdPath Path);
10239 void CodeCompleteOrdinaryName(Scope *S,
10241 void CodeCompleteDeclSpec(Scope *S,
DeclSpec &DS,
10242 bool AllowNonIdentifiers,
10243 bool AllowNestedNameSpecifiers);
10246 void CodeCompleteExpression(Scope *S,
10248 void CodeCompleteMemberReferenceExpr(Scope *S, Expr *
Base, Expr *OtherOpBase,
10250 bool IsBaseExprStatement);
10251 void CodeCompletePostfixExpression(Scope *S,
ExprResult LHS);
10252 void CodeCompleteTag(Scope *S,
unsigned TagSpec);
10253 void CodeCompleteTypeQualifiers(
DeclSpec &DS);
10256 void CodeCompleteBracketDeclarator(Scope *S);
10257 void CodeCompleteCase(Scope *S);
10261 void CodeCompleteInitializer(Scope *S, Decl *D);
10262 void CodeCompleteReturn(Scope *S);
10263 void CodeCompleteAfterIf(Scope *S);
10264 void CodeCompleteAssignmentRHS(Scope *S, Expr *LHS);
10266 void CodeCompleteQualifiedId(Scope *S,
CXXScopeSpec &SS,
10267 bool EnteringContext);
10268 void CodeCompleteUsing(Scope *S);
10269 void CodeCompleteUsingDirective(Scope *S);
10270 void CodeCompleteNamespaceDecl(Scope *S);
10271 void CodeCompleteNamespaceAliasDecl(Scope *S);
10272 void CodeCompleteOperatorName(Scope *S);
10273 void CodeCompleteConstructorInitializer(
10278 bool AfterAmpersand);
10280 void CodeCompleteObjCAtDirective(Scope *S);
10281 void CodeCompleteObjCAtVisibility(Scope *S);
10282 void CodeCompleteObjCAtStatement(Scope *S);
10283 void CodeCompleteObjCAtExpression(Scope *S);
10284 void CodeCompleteObjCPropertyFlags(Scope *S,
ObjCDeclSpec &ODS);
10285 void CodeCompleteObjCPropertyGetter(Scope *S);
10286 void CodeCompleteObjCPropertySetter(Scope *S);
10287 void CodeCompleteObjCPassingType(Scope *S,
ObjCDeclSpec &DS,
10289 void CodeCompleteObjCMessageReceiver(Scope *S);
10290 void CodeCompleteObjCSuperMessage(Scope *S,
SourceLocation SuperLoc,
10292 bool AtArgumentExpression);
10293 void CodeCompleteObjCClassMessage(Scope *S, ParsedType Receiver,
10295 bool AtArgumentExpression,
10296 bool IsSuper =
false);
10297 void CodeCompleteObjCInstanceMessage(Scope *S, Expr *Receiver,
10299 bool AtArgumentExpression,
10301 void CodeCompleteObjCForCollection(Scope *S,
10302 DeclGroupPtrTy IterationVar);
10303 void CodeCompleteObjCSelector(Scope *S,
10305 void CodeCompleteObjCProtocolReferences(
10307 void CodeCompleteObjCProtocolDecl(Scope *S);
10308 void CodeCompleteObjCInterfaceDecl(Scope *S);
10309 void CodeCompleteObjCSuperclass(Scope *S,
10312 void CodeCompleteObjCImplementationDecl(Scope *S);
10313 void CodeCompleteObjCInterfaceCategory(Scope *S,
10316 void CodeCompleteObjCImplementationCategory(Scope *S,
10319 void CodeCompleteObjCPropertyDefinition(Scope *S);
10320 void CodeCompleteObjCPropertySynthesizeIvar(Scope *S,
10322 void CodeCompleteObjCMethodDecl(Scope *S,
Optional<bool> IsInstanceMethod,
10323 ParsedType ReturnType);
10324 void CodeCompleteObjCMethodDeclSelector(Scope *S,
10325 bool IsInstanceMethod,
10326 bool AtParameterName,
10327 ParsedType ReturnType,
10329 void CodeCompleteObjCClassPropertyRefExpr(Scope *S,
IdentifierInfo &ClassName,
10331 bool IsBaseExprStatement);
10332 void CodeCompletePreprocessorDirective(
bool InConditional);
10333 void CodeCompleteInPreprocessorConditionalExclusion(Scope *S);
10334 void CodeCompletePreprocessorMacroName(
bool IsDefinition);
10335 void CodeCompletePreprocessorExpression();
10336 void CodeCompletePreprocessorMacroArgument(Scope *S,
10339 unsigned Argument);
10340 void CodeCompleteNaturalLanguage();
10341 void CodeCompleteAvailabilityPlatformName();
10352 unsigned ByteNo)
const;
10355 void CheckArrayAccess(
const Expr *BaseExpr,
const Expr *IndexExpr,
10357 bool AllowOnePastEnd=
true,
bool IndexNegated=
false);
10358 void CheckArrayAccess(
const Expr *E);
10361 struct FormatStringInfo {
10362 unsigned FormatIdx;
10363 unsigned FirstDataArg;
10367 static bool getFormatStringInfo(
const FormatAttr *Format,
bool IsCXXMember,
10368 FormatStringInfo *FSI);
10369 bool CheckFunctionCall(FunctionDecl *FDecl,
CallExpr *TheCall,
10376 void CheckConstructorCall(FunctionDecl *FDecl,
10386 bool CheckObjCString(Expr *Arg);
10387 ExprResult CheckOSLogFormatStringArg(Expr *Arg);
10389 ExprResult CheckBuiltinFunctionCall(FunctionDecl *FDecl,
10390 unsigned BuiltinID,
CallExpr *TheCall);
10392 bool CheckARMBuiltinExclusiveCall(
unsigned BuiltinID,
CallExpr *TheCall,
10393 unsigned MaxWidth);
10394 bool CheckNeonBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10395 bool CheckARMBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10397 bool CheckAArch64BuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10398 bool CheckHexagonBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10399 bool CheckHexagonBuiltinCpu(
unsigned BuiltinID,
CallExpr *TheCall);
10400 bool CheckHexagonBuiltinArgument(
unsigned BuiltinID,
CallExpr *TheCall);
10401 bool CheckMipsBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10402 bool CheckSystemZBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10403 bool CheckX86BuiltinRoundingOrSAE(
unsigned BuiltinID,
CallExpr *TheCall);
10404 bool CheckX86BuiltinGatherScatterScale(
unsigned BuiltinID,
CallExpr *TheCall);
10405 bool CheckX86BuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10406 bool CheckPPCBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10408 bool SemaBuiltinVAStart(
unsigned BuiltinID,
CallExpr *TheCall);
10409 bool SemaBuiltinVAStartARMMicrosoft(
CallExpr *Call);
10410 bool SemaBuiltinUnorderedCompare(
CallExpr *TheCall);
10411 bool SemaBuiltinFPClassification(
CallExpr *TheCall,
unsigned NumArgs);
10412 bool SemaBuiltinVSX(
CallExpr *TheCall);
10413 bool SemaBuiltinOSLogFormat(
CallExpr *TheCall);
10423 bool SemaBuiltinPrefetch(
CallExpr *TheCall);
10424 bool SemaBuiltinAllocaWithAlign(
CallExpr *TheCall);
10425 bool SemaBuiltinAssume(
CallExpr *TheCall);
10426 bool SemaBuiltinAssumeAligned(
CallExpr *TheCall);
10427 bool SemaBuiltinLongjmp(
CallExpr *TheCall);
10428 bool SemaBuiltinSetjmp(
CallExpr *TheCall);
10435 bool SemaBuiltinConstantArg(
CallExpr *TheCall,
int ArgNum,
10436 llvm::APSInt &Result);
10437 bool SemaBuiltinConstantArgRange(
CallExpr *TheCall,
int ArgNum,
int Low,
10438 int High,
bool RangeIsError =
true);
10439 bool SemaBuiltinConstantArgMultiple(
CallExpr *TheCall,
int ArgNum,
10440 unsigned Multiple);
10441 bool SemaBuiltinARMSpecialReg(
unsigned BuiltinID,
CallExpr *TheCall,
10442 int ArgNum,
unsigned ExpectedFieldNum,
10461 static bool GetFormatNSStringIdx(
const FormatAttr *Format,
unsigned &Idx);
10464 bool CheckFormatArguments(
const FormatAttr *Format,
10469 llvm::SmallBitVector &CheckedVarArgs);
10471 bool HasVAListArg,
unsigned format_idx,
10475 llvm::SmallBitVector &CheckedVarArgs);
10477 void CheckAbsoluteValueFunction(
const CallExpr *Call,
10478 const FunctionDecl *FDecl);
10480 void CheckMaxUnsignedZero(
const CallExpr *Call,
const FunctionDecl *FDecl);
10482 void CheckMemaccessArguments(
const CallExpr *Call,
10486 void CheckStrlcpycatArguments(
const CallExpr *Call,
10489 void CheckStrncatArguments(
const CallExpr *Call,
10492 void CheckReturnValExpr(Expr *RetValExp,
QualType lhsType,
10494 bool isObjCMethod =
false,
10495 const AttrVec *Attrs =
nullptr,
10496 const FunctionDecl *FD =
nullptr);
10499 void CheckFloatComparison(
SourceLocation Loc, Expr *LHS, Expr *RHS);
10504 void CheckForIntOverflow(Expr *E);
10505 void CheckUnsequencedOperations(Expr *E);
10510 bool IsConstexpr =
false);
10522 void CheckBreakContinueBinding(Expr *E);
10530 bool DeleteWasArrayForm);
10533 void RegisterTypeTagForDatatype(
const IdentifierInfo *ArgumentKind,
10534 uint64_t MagicValue,
QualType Type,
10535 bool LayoutCompatible,
bool MustBeNull);
10541 Type(Type), LayoutCompatible(LayoutCompatible),
10542 MustBeNull(MustBeNull)
10559 std::unique_ptr<llvm::DenseMap<TypeTagMagicValue, TypeTagData>>
10560 TypeTagForDatatypeMagicValues;
10564 void CheckArgumentWithTypeTag(
const ArgumentWithTypeTagAttr *Attr,
10570 void CheckAddressOfPackedMember(Expr *rhs);
10627 Decl *getObjCDeclContext()
const;
10630 return OriginalLexicalContext ? OriginalLexicalContext : CurContext;
10637 DC = CatD->getClassInterface();
10644 bool PartialOverloading =
false) {
10646 if (NumArgs > 0 && PartialOverloading)
10647 return NumArgs + 1 > NumParams;
10648 return NumArgs > NumParams;
10656 class SavePendingParsedClassStateRAII {
10658 SavePendingParsedClassStateRAII(
Sema &S) : S(S) { swapSavedState(); }
10660 ~SavePendingParsedClassStateRAII() {
10662 "there shouldn't be any pending delayed exception spec checks");
10664 "there shouldn't be any pending delayed defaulted member " 10665 "exception specs");
10667 "there shouldn't be any pending delayed DLL export classes");
10673 decltype(DelayedExceptionSpecChecks) SavedExceptionSpecChecks;
10674 decltype(DelayedDefaultedMemberExceptionSpecs)
10675 SavedDefaultedMemberExceptionSpecs;
10676 decltype(DelayedDllExportClasses) SavedDllExportClasses;
10678 void swapSavedState() {
10680 SavedDefaultedMemberExceptionSpecs.swap(
10688 struct MisalignedMember {
10694 MisalignedMember() : E(), RD(), MD(), Alignment() {}
10697 : E(E), RD(RD), MD(MD), Alignment(Alignment) {}
10698 explicit MisalignedMember(Expr *E)
10699 : MisalignedMember(E,
nullptr,
nullptr,
CharUnits()) {}
10701 bool operator==(
const MisalignedMember &m) {
return this->E == m.E; }
10715 void DiagnoseMisalignedMembers();
10722 void DiscardMisalignedMemberAddress(
const Type *T, Expr *E);
10727 void RefersToMemberWithReducedAlignment(
10736 bool Entered =
true;
10741 Decl *LambdaContextDecl =
nullptr,
10743 Sema::ExpressionEvaluationContextRecord::EK_Other,
10744 bool ShouldEnter =
true)
10745 : Actions(Actions), Entered(ShouldEnter) {
10754 Sema::ExpressionEvaluationContextRecord::EK_Other)
10755 : Actions(Actions) {
10757 NewContext, Sema::ReuseLambdaContextDecl, ExprContext);
10762 bool ShouldEnter =
true)
10763 : Actions(Actions), Entered(
false) {
10771 Sema::ExpressionEvaluationContext::UnevaluatedList);
10818 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.
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).
static void collectUnexpandedParameterPacks(Sema &S, TemplateParameterList *Params, SmallVectorImpl< UnexpandedParameterPack > &Unexpanded)
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)
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
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...
llvm::DenseMap< CanonicalDeclPtr< FunctionDecl >, llvm::MapVector< CanonicalDeclPtr< FunctionDecl >, SourceLocation > > CUDACallGraph
A partial call graph maintained during CUDA compilation to support deferred diagnostics.
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.
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)
llvm::PointerUnion3< TemplateTypeParmDecl *, NonTypeTemplateParmDecl *, TemplateTemplateParmDecl * > TemplateParameter
Stores a template parameter of any kind.
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)
static void LookupVisibleDecls(DeclContext *Ctx, LookupResult &Result, bool QualifiedNameLookup, bool InBaseClass, VisibleDeclConsumer &Consumer, VisibleDeclsRecord &Visited, bool IncludeDependentBases, bool LoadExternal)
Code completion occurs within a class, struct, or union.
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
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.
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.
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
Emit the diagnostic immediately (i.e., behave like Sema::Diag()).
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.
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.
An instance of this object exists for each enum constant that is defined.
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.
llvm::StringRef StackSlotLabel
SmallVector< Scope *, 2 > CurrentSEHFinally
Stack of active SEH __finally scopes. Can be empty.
void setCurrentOpenCLExtension(llvm::StringRef Ext)
Defines the clang::Module class, which describes a module in the source code.
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.
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.
DeclContext * OriginalLexicalContext
Generally null except when we temporarily switch decl contexts, like in.
friend const CUDADiagBuilder & operator<<(const CUDADiagBuilder &Diag, const T &Value)
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.
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.
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)
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.
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.
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
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...
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)
static NameClassification NestedNameSpecifier()
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.
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)
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.
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.
bool inTemplateInstantiation() const
Determine whether we are currently performing template instantiation.
The results of name lookup within a DeclContext.
ImplicitExceptionSpecification(Sema &Self)
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.
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.
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.
Interesting information about a specific parameter that can't simply be reflected in parameter's type...
The iterator over UnresolvedSets.
Token - This structure provides full information about a lexed token.
bool isVisible(const Module *M) const
Determine whether a module is visible.
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
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...
Diagnostic builder for CUDA errors which may or may not be deferred.
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...
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.
Code completion occurs at top-level or namespace context.
A pair of a canonical FunctionDecl and a SourceLocation.
We are instantiating the exception specification for a function template which was deferred until it ...
bool isModuleVisible(const Module *M)
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.
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.
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.
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.
Module * getOwningModule(Decl *Entity)
Get the module owning an entity.
bool isObjCMethodDecl(Decl *D)
ICEConvertDiagnoser(bool AllowScopedEnumerations, bool Suppress, bool SuppressConversion)
Code completion occurs following one or more template headers.
The base type of a class type.
Keeps track of the mangled names of lambda expressions and block literals within a particular context...
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
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.
A set of unresolved declarations.
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.
llvm::DenseMap< CanonicalDeclPtr< FunctionDecl >, std::vector< PartialDiagnosticAt > > CUDADeferredDiags
Diagnostics that are emitted only if we discover that the given function must be codegen'ed.
Scope - A scope is a transient data structure that is used while parsing the program.
The type of a data member.
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().
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.
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 ...
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.
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
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.
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.
The return type of classify().
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.
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.
std::function< void(const TypoCorrection &)> TypoDiagnosticGenerator
SmallVector< PragmaAttributeEntry, 2 > PragmaAttributeStack
Scope * getCurScope() const
Retrieve the parser's current scope.
llvm::PointerIntPair< CXXRecordDecl *, 3, CXXSpecialMember > SpecialMemberDecl
SourceLocation IdentifierLoc
The location of the identifier.
Allows QualTypes to be sorted and hence used in maps and sets.
NameClassification(ParsedType Type)
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...
Pepresents 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 ...
Expr - 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.
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...
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...
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
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()
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.
QualType FindCompositePointerType(SourceLocation Loc, ExprResult &E1, ExprResult &E2, bool ConvertArgs=true)
void PopFunctionScopeInfo(const sema::AnalysisBasedWarnings::Policy *WP=nullptr, const Decl *D=nullptr, const BlockExpr *blkExpr=nullptr)
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.
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.
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.
std::unique_ptr< MangleNumberingContext > MangleNumbering
The context information used to mangle lambda expressions and block literals within this context...
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.
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...
InClassInitStyle
In-class initialization styles for non-static data members.
NameClassification(ExprResult Expr)
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...
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.
Code completion occurs within the list of instance variables in an Objective-C interface, protocol, category, or implementation.
OpenMPProcBindClauseKind
OpenMP attributes for 'proc_bind' clause.
ObjCTypeParamVariance
Describes the variance of a given generic parameter.
bool isTemplateInstantiation(TemplateSpecializationKind Kind)
Determine whether this template specialization kind refers to an instantiation of an entity (as oppos...
PragmaClangSectionKind
pragma clang section kind
ObjCKeywordKind
Provides a namespace for Objective-C keywords which start with an '@'.
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.
This is a legitimate overload: the existing declarations are functions or function templates with dif...
ExprResult ActOnFinishFullExpr(Expr *Expr)
llvm::DenseMap< CanonicalDeclPtr< FunctionDecl >, FunctionDeclAndLoc > CUDAKnownEmittedFns
An inverse call graph, mapping known-emitted functions to one of their known-emitted callers (plus th...
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...
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().
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.
llvm::SmallPtrSet< Expr *, 2 > MaybeODRUseExprs
Store a list of either DeclRefExprs or MemberExprs that contain a reference to a variable (constant) ...
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
Defines enumerations for expression traits intrinsics.
SourceLocation CurrentPragmaLocation
llvm::SmallPtrSet< Expr *, 2 > SavedMaybeODRUseExprs
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...
static SourceRange getPrintable(const Expr *E)
Template argument deduction failed due to inconsistent cv-qualifiers on a template parameter type tha...
Represents the declaration of a struct/union/class/enum.
OpenMPDirectiveKind
OpenMP directives.
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>. ...
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
static T * mergeVisibilityAttr(Sema &S, Decl *D, SourceRange range, typename T::VisibilityType value, unsigned attrSpellingListIndex)
SFINAETrap(Sema &SemaRef, bool AccessCheckingSFINAE=false)
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)
CheckBoolLikeConversion - 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...
PragmaStack< MSVtorDispAttr::Mode > VtorDispStack
Whether to insert vtordisps prior to virtual bases in the Microsoft C++ ABI.
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...
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
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...
OverloadCandidateSet - A set of overload candidates, used in C++ overload resolution (C++ 13...
Constant expression in a noptr-new-declarator.
LocalEagerInstantiationScope(Sema &S)
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)
void setLastDiagnosticIgnored(bool Ignored=true)
Pretend that the last diagnostic issued was ignored, so any subsequent notes will be suppressed...
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 template argument.
ParserCompletionContext
Describes the context in which code completion occurs.
TagTypeKind
The kind of a tag type.
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...
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...
The base class of all kinds of template declarations (e.g., class, function, etc.).
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
We are instantiating a default argument for a function.
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.
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...
DeclarationName - 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...
bool shouldDiagnoseTargetSupportFromOpenMP() const
Return true if (un)supported features for the current target should be diagnosed if OpenMP (offloadin...
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...
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...
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.
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.
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.
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.
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.
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.
std::unique_ptr< sema::FunctionScopeInfo > PreallocatedFunctionScope
bool SavedInNonInstantiationSFINAEContext
Was the enclosing context a non-instantiation SFINAE context?
void ActOnStartOfCompoundStmt(bool IsStmtExpr)
PragmaStack< StringLiteral * > ConstSegStack
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. ...
SemaDiagnosticBuilder diagnoseNoMatch(Sema &S, SourceLocation Loc, QualType T) override
Emits a diagnostic complaining that the expression does not have integral or enumeration type...
Expr * NoexceptExpr
Noexcept expression, if this is a computed noexcept specification.
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
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
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()
LangOptions::PragmaMSPointersToMembersKind MSPointerToMemberRepresentationMethod
Controls member pointer representation format under the MS ABI.
llvm::DenseMap< int, SourceRange > ParsedSubjectMatchRuleSet
Selector RespondsToSelectorSel
will hold 'respondsToSelector:'
TPOC
The context in which partial ordering of function templates occurs.
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...
static void checkUnusedDeclAttributes(Sema &S, const ParsedAttributesView &A)
checkUnusedDeclAttributes - Check a list of attributes to see if it contains any decl attributes that...
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
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.
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.
ParamInfo - An array of paraminfo objects is allocated whenever a function declarator is parsed...
static int getPrintable(int I)
class clang::Sema::DelayedDiagnostics DelayedDiagnostics
PragmaStack< unsigned > PackStack
A collection of diagnostics which were delayed.
Emit the diagnostic immediately, and, if it's a warning or error, also emit a call stack showing how ...
An instance of this class represents the declaration of a property member.
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.
QualType NSStringPointer
Pointer to NSString type (NSString *).
FullExprArg MakeFullDiscardedValueExpr(Expr *Arg)
Represents C++ using-directive.
SmallVector< std::pair< const CXXMethodDecl *, const CXXMethodDecl * >, 2 > DelayedExceptionSpecChecks
All the overriding functions seen during a class definition that had their exception spec checks dela...
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 type of an arbitrary declaration.
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.
SmallVector< std::pair< CXXMethodDecl *, const FunctionProtoType * >, 2 > DelayedDefaultedMemberExceptionSpecs
All the members seen during a class definition which were both explicitly defaulted and had explicitl...
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.
This represents the stack of attributes that were pushed by #pragma clang attribute.
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
ParsedType actOnLambdaInitCaptureInitialization(SourceLocation Loc, bool ByRef, IdentifierInfo *Id, LambdaCaptureInitKind InitKind, Expr *&Init)
Perform initialization analysis of the init-capture and perform any implicit conversions such as an l...
ObjCMethodDecl * DictionaryWithObjectsMethod
The declaration of the dictionaryWithObjects:forKeys:count: method.
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