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 OMPRequiresDecl;
157 class OMPDeclareReductionDecl;
158 class OMPDeclareSimdDecl;
160 struct OverloadCandidate;
161 class OverloadCandidateSet;
166 class PseudoDestructorTypeStorage;
167 class PseudoObjectExpr;
169 class StandardConversionSequence;
173 class TemplateArgument;
174 class TemplateArgumentList;
175 class TemplateArgumentLoc;
177 class TemplateInstantiationCallback;
178 class TemplateParameterList;
179 class TemplatePartialOrderingContext;
180 class TemplateTemplateParmDecl;
184 class TypedefNameDecl;
186 class TypoCorrectionConsumer;
188 class UnresolvedLookupExpr;
189 class UnresolvedMemberExpr;
190 class UnresolvedSetImpl;
191 class UnresolvedSetIterator;
193 class UsingShadowDecl;
196 class VarTemplateSpecializationDecl;
197 class VisibilityAttr;
198 class VisibleDeclConsumer;
199 class IndirectFieldDecl;
200 struct DeductionFailureInfo;
201 class TemplateSpecCandidateSet;
204 class AccessedEntity;
205 class BlockScopeInfo;
207 class CapturedRegionScopeInfo;
208 class CapturingScopeInfo;
209 class CompoundScopeInfo;
210 class DelayedDiagnostic;
211 class DelayedDiagnosticPool;
212 class FunctionScopeInfo;
213 class LambdaScopeInfo;
214 class PossiblyUnreachableDiag;
215 class SemaPPCallbacks;
216 class TemplateDeductionInfo;
219 namespace threadSafety {
226 typedef std::pair<llvm::PointerUnion<const TemplateTypeParmType*, NamedDecl*>,
244 bool SawTypeNullability =
false;
251 llvm::DenseMap<FileID, FileNullability> Map;
262 if (file ==
Cache.File)
263 return Cache.Nullability;
266 if (!
Cache.File.isInvalid()) {
272 Cache.Nullability = Map[file];
273 return Cache.Nullability;
280 void operator=(
const Sema &) =
delete;
286 bool isMultiplexExternalSource;
288 static bool mightHaveNonExternalLinkage(
const DeclaratorDecl *FD);
295 bool shouldLinkPossiblyHiddenDecl(
const NamedDecl *Old,
303 "should not have found a non-externally-declarable previous decl");
310 void setupImplicitSpecialMemberType(
CXXMethodDecl *SpecialMem,
393 PSK_Push_Set = PSK_Push | PSK_Set,
394 PSK_Pop_Set = PSK_Pop | PSK_Set,
397 template<
typename ValueType>
404 Slot(llvm::StringRef StackSlotLabel, ValueType Value,
406 : StackSlotLabel(StackSlotLabel), Value(Value),
407 PragmaLocation(PragmaLocation),
408 PragmaPushLocation(PragmaPushLocation) {}
412 llvm::StringRef StackSlotLabel,
430 assert((Action == PSK_Push || Action == PSK_Pop) &&
431 "Can only push / pop #pragma stack sentinels!");
432 Act(CurrentPragmaLocation, Action, Label, CurrentValue);
437 : DefaultValue(Default), CurrentValue(Default) {}
439 bool hasValue()
const {
return CurrentValue != DefaultValue; }
460 static const unsigned kMac68kAlignmentSentinel = ~0U;
555 &ExternalSemaSource::ReadExtVectorDecls, 2, 2>
599 &ExternalSemaSource::ReadTentativeDefinitions, 2, 2>
606 &ExternalSemaSource::ReadUnusedFileScopedDecls, 2, 2>
614 &ExternalSemaSource::ReadDelegatingConstructors, 2, 2>
646 std::unique_ptr<LateParsedTemplate>>
658 LateTemplateParserCleanupCB *LTPCleanup,
660 LateTemplateParser = LTP;
661 LateTemplateParserCleanup = LTPCleanup;
699 state.SavedPool = CurPool;
708 CurPool = state.SavedPool;
715 state.SavedPool = CurPool;
722 assert(CurPool ==
nullptr);
723 CurPool = state.SavedPool;
732 ProcessingContextState SavedContextState;
737 : S(S), SavedContext(S.CurContext),
739 SavedCXXThisTypeOverride(S.CXXThisTypeOverride)
741 assert(ContextToPush &&
"pushing null context");
748 if (!SavedContext)
return;
752 SavedContext =
nullptr;
765 bool PushedCodeSynthesisContext =
false;
769 : S(S), SavedContext(S, DC) {
772 Sema::ExpressionEvaluationContext::PotentiallyEvaluated);
773 if (
auto *FD = dyn_cast<FunctionDecl>(DC))
774 FD->setWillHaveBody(
true);
776 assert(isa<ObjCMethodDecl>(DC));
780 assert(!PushedCodeSynthesisContext);
783 Ctx.
Kind = Sema::CodeSynthesisContext::DefiningSynthesizedFunction;
788 PushedCodeSynthesisContext =
true;
792 if (PushedCodeSynthesisContext)
794 if (
auto *FD = dyn_cast<FunctionDecl>(S.
CurContext))
795 FD->setWillHaveBody(
false);
814 void LoadExternalWeakUndeclaredIdentifiers();
949 PotentiallyEvaluated,
959 PotentiallyEvaluatedIfUsed
1017 unsigned NumCleanupObjects,
1019 Decl *ManglingContextDecl,
1021 : Context(Context), ParentCleanup(ParentCleanup),
1022 NumCleanupObjects(NumCleanupObjects), NumTypos(0),
1023 ManglingContextDecl(ManglingContextDecl), MangleNumbering(),
1024 ExprContext(ExprContext) {}
1031 return Context == ExpressionEvaluationContext::Unevaluated ||
1032 Context == ExpressionEvaluationContext::UnevaluatedAbstract ||
1033 Context == ExpressionEvaluationContext::UnevaluatedList;
1036 return Context == ExpressionEvaluationContext::ConstantEvaluated;
1055 Decl *&ManglingContextDecl);
1072 llvm::PointerIntPair<CXXMethodDecl*, 2> Pair;
1077 : Pair(MD, MD->isDeleted() ? NoMemberOrDeleted : Success) {}
1087 :
public llvm::FastFoldingSetNode,
1091 : FastFoldingSetNode(ID)
1117 typedef llvm::DenseMap<ParmVarDecl *, llvm::TinyPtrVector<ParmVarDecl *>>
1140 bool isExternalWithNoLinkageType(
ValueDecl *VD);
1143 void getUndefinedButUsed(
1148 const llvm::MapVector<FieldDecl *, DeleteLocs> &
1149 getMismatchingDeleteExpressions()
const;
1177 typedef llvm::PointerIntPair<CXXRecordDecl *, 3, CXXSpecialMember>
1196 void updateOutOfDateSelector(
Selector Sel);
1199 bool isSelfExpr(
Expr *RExpr);
1205 void EmitCurrentDiagnostic(
unsigned DiagID);
1219 void addImplicitTypedef(StringRef Name,
QualType T);
1248 void addExternalSource(ExternalSemaSource *E);
1250 void PrintStats()
const;
1279 if (!isActive())
return;
1298 template<
typename T>
1332 void emitAndClearUnusedLocalTypedefWarnings();
1334 void ActOnStartOfTranslationUnit();
1335 void ActOnEndOfTranslationUnit();
1337 void CheckDelegatingCtorCycles();
1341 void PushFunctionScope();
1348 void RecordParsingTemplateParameterDepth(
unsigned Depth);
1355 const Decl *D =
nullptr,
1359 return FunctionScopes.empty() ? nullptr : FunctionScopes.back();
1364 void setFunctionHasBranchIntoScope();
1365 void setFunctionHasBranchProtectedScope();
1366 void setFunctionHasIndirectGoto();
1368 void PushCompoundScope(
bool IsStmtExpr);
1369 void PopCompoundScope();
1372 bool isCurCompoundStmtAStmtExpr()
const;
1374 bool hasAnyUnrecoverableErrorsInThisFunction()
const;
1384 getCurLambda(
bool IgnoreNonLambdaCapturingScope =
false);
1410 Expr *ArraySize,
unsigned Quals,
1476 void UpdateExceptionSpec(FunctionDecl *FD,
1479 bool CheckDistantExceptionSpec(
QualType T);
1480 bool CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New);
1481 bool CheckEquivalentExceptionSpec(
1484 bool CheckEquivalentExceptionSpec(
1535 std::tuple<
const Ts &...> Args;
1539 llvm::index_sequence<Is...>)
const {
1541 bool Dummy[] = {
false, (DB << getPrintable(std::get<Is>(Args)))...};
1548 assert(DiagID != 0 &&
"no diagnostic for type diagnoser");
1553 emit(DB, llvm::index_sequence_for<Ts...>());
1567 void CheckAddressOfNoDeref(
const Expr *E);
1568 void CheckMemberAccessOfNoDeref(
const MemberExpr *E);
1573 struct ModuleScope {
1575 bool ModuleInterface =
false;
1582 Module *getCurrentModule()
const {
1583 return ModuleScopes.empty() ? nullptr : ModuleScopes.back().Module;
1594 void makeMergedDefinitionVisible(
NamedDecl *ND);
1596 bool isModuleVisible(
const Module *M,
bool ModulePrivate =
false);
1600 return !D->
isHidden() || isVisibleSlow(D);
1607 return isVisible(D) || hasVisibleDeclarationSlow(D, Modules);
1609 bool hasVisibleDeclarationSlow(
const NamedDecl *D,
1612 bool hasVisibleMergedDefinition(
NamedDecl *Def);
1613 bool hasMergedDefinitionInCurrentModule(
NamedDecl *Def);
1617 bool hasStructuralCompatLayout(
Decl *D,
Decl *Suggested);
1622 bool OnlyNeedComplete =
false);
1625 return hasVisibleDefinition(const_cast<NamedDecl*>(D), &Hidden);
1636 bool hasVisibleExplicitSpecialization(
1641 bool hasVisibleMemberSpecialization(
1647 bool isEquivalentInternalLinkageDeclaration(
const NamedDecl *A,
1649 void diagnoseEquivalentInternalLinkageDeclarations(
1656 return !RequireCompleteTypeImpl(Loc, T,
nullptr);
1663 template <
typename... Ts>
1665 const Ts &...Args) {
1667 return RequireCompleteType(Loc, T, Diagnoser);
1670 void completeExprArrayBound(
Expr *E);
1672 bool RequireCompleteExprType(
Expr *E,
unsigned DiagID);
1674 template <
typename... Ts>
1677 return RequireCompleteExprType(E, Diagnoser);
1684 template <
typename... Ts>
1686 const Ts &...Args) {
1688 return RequireLiteralType(Loc, T, Diagnoser);
1693 TagDecl *OwnedTagDecl =
nullptr);
1699 bool AsUnevaluated =
true);
1718 DeclGroupPtrTy ConvertDeclToDeclGroup(
Decl *Ptr,
Decl *OwnedType =
nullptr);
1720 void DiagnoseUseOfUnimplementedSelectors();
1726 bool isClassName =
false,
bool HasTrailingDot =
false,
1728 bool IsCtorOrDtorName =
false,
1729 bool WantNontrivialTypeSourceInfo =
false,
1730 bool IsClassTemplateDeductionContext =
true,
1739 bool IsTemplateName =
false);
1747 bool IsTemplateTypeArg);
1792 Result.Template = Name;
1798 Result.Template = Name;
1804 Result.Template = Name;
1811 assert(Kind == NC_Type);
1816 assert(Kind == NC_Expression);
1821 assert(Kind == NC_TypeTemplate || Kind == NC_FunctionTemplate ||
1822 Kind == NC_VarTemplate);
1828 case NC_TypeTemplate:
1830 case NC_FunctionTemplate:
1832 case NC_VarTemplate:
1835 llvm_unreachable(
"unsupported name classification.");
1867 bool IsAddressOfOperand,
1868 std::unique_ptr<CorrectionCandidateCallback> CCC =
nullptr);
1876 TemplateTemplateParam,
1888 if (
auto *DRE = dyn_cast<DeclRefExpr>(E.
get()))
1889 return !DRE->hasExplicitTemplateArgs();
1890 if (
auto *ME = dyn_cast<MemberExpr>(E.
get()))
1891 return !ME->hasExplicitTemplateArgs();
1893 if (
auto *DSDRE = dyn_cast<DependentScopeDeclRefExpr>(E.
get()))
1894 return !DSDRE->hasExplicitTemplateArgs();
1895 if (
auto *DSME = dyn_cast<CXXDependentScopeMemberExpr>(E.
get()))
1896 return !DSME->hasExplicitTemplateArgs();
1915 diagnoseIgnoredQualifiers(
unsigned DiagID,
unsigned Quals,
1923 static bool adjustContextForLocalExternDecl(
DeclContext *&DC);
1924 void DiagnoseFunctionSpecifiers(
const DeclSpec &DS);
1925 NamedDecl *getShadowedDeclaration(
const TypedefNameDecl *D,
1930 void CheckShadow(
Scope *S, VarDecl *D);
1941 llvm::DenseMap<const NamedDecl *, const NamedDecl *> ShadowingDecls;
1945 void handleTagNumbering(
const TagDecl *Tag,
Scope *TagScope);
1946 void setTagNameForLinkagePurposes(
TagDecl *TagFromDeclSpec,
1947 TypedefNameDecl *NewTD);
1948 void CheckTypedefForVariablyModifiedType(
Scope *S, TypedefNameDecl *D);
1964 bool CheckVariableDeclaration(VarDecl *NewVD,
LookupResult &Previous);
1965 void CheckVariableDeclarationType(VarDecl *NewVD);
1966 bool DeduceVariableDeclarationType(VarDecl *VDecl,
bool DirectInit,
1968 void CheckCompleteVariableDeclaration(VarDecl *VD);
1970 void MaybeSuggestAddingStaticToDecl(
const FunctionDecl *D);
1979 bool CheckConstexprFunctionDecl(
const FunctionDecl *FD);
1980 bool CheckConstexprFunctionBody(
const FunctionDecl *FD,
Stmt *Body);
1988 bool CheckFunctionDeclaration(
Scope *S,
1990 bool IsMemberSpecialization);
1991 bool shouldLinkDependentDeclWithPrevious(
Decl *D,
Decl *OldDecl);
1994 void CheckMain(FunctionDecl *FD,
const DeclSpec &D);
1995 void CheckMSVCRTEntryPoint(FunctionDecl *FD);
1996 Attr *getImplicitCodeSegOrSectionAttrForFunction(
const FunctionDecl *FD,
bool IsDefinition);
2005 void ActOnParamDefaultArgument(
Decl *param,
2008 void ActOnParamUnparsedDefaultArgument(
Decl *param,
2015 void AddInitializerToDecl(
Decl *dcl,
Expr *init,
bool DirectInit);
2016 void ActOnUninitializedDecl(
Decl *dcl);
2017 void ActOnInitializerError(
Decl *Dcl);
2020 void ActOnCXXForRangeDecl(
Decl *D);
2027 void CheckStaticLocalForDllExport(VarDecl *VD);
2028 void FinalizeDeclaration(
Decl *D);
2029 DeclGroupPtrTy FinalizeDeclaratorGroup(
Scope *S,
const DeclSpec &DS,
2035 void ActOnDocumentableDecl(
Decl *D);
2040 void CheckForFunctionRedefinition(
2041 FunctionDecl *FD,
const FunctionDecl *EffectiveDefinition =
nullptr,
2048 void ActOnStartOfObjCMethodDef(
Scope *S,
Decl *D);
2050 return D && isa<ObjCMethodDecl>(D);
2061 bool canDelayFunctionBody(
const Declarator &D);
2070 bool canSkipFunctionBody(
Decl *D);
2074 Decl *ActOnFinishFunctionBody(Decl *Decl,
Stmt *Body,
bool IsInstantiation);
2075 Decl *ActOnSkippedFunctionBody(Decl *Decl);
2076 void ActOnFinishInlineFunctionDef(FunctionDecl *D);
2080 void ActOnFinishDelayedAttribute(Scope *S, Decl *D,
ParsedAttributes &Attrs);
2093 void DiagnoseInvalidJumps(
Stmt *Body);
2094 Decl *ActOnFileScopeAsmDecl(
Expr *
expr,
2140 void createImplicitModuleImportForErrorRecovery(
SourceLocation Loc,
2149 ExplicitSpecialization,
2150 PartialSpecialization
2163 Decl *ActOnFinishExportDecl(Scope *S, Decl *
ExportDecl,
2179 return getPrintingPolicy(Context, PP);
2188 void ActOnTranslationUnitScope(Scope *S);
2194 bool IsExplicitInstantiation,
2197 Decl *BuildAnonymousStructOrUnion(Scope *S,
DeclSpec &DS,
2202 Decl *BuildMicrosoftCAnonymousStruct(Scope *S,
DeclSpec &DS,
2223 bool isAcceptableTagRedeclaration(
const TagDecl *Previous,
2235 Decl *ActOnTag(Scope *S,
unsigned TagSpec,
TagUseKind TUK,
2241 bool ScopedEnumUsesClassTag,
TypeResult UnderlyingType,
2242 bool IsTypeSpecifier,
bool IsTemplateParamOrArg,
2245 Decl *ActOnTemplatedFriendTag(Scope *S,
SourceLocation FriendLoc,
2272 Expr *BitfieldWidth,
2280 bool Mutable,
Expr *BitfieldWidth,
2286 bool CheckNontrivialField(
FieldDecl *FD);
2294 TAH_ConsiderTrivialABI
2299 bool Diagnose =
false);
2315 void ActOnTagStartDefinition(Scope *S, Decl *
TagDecl);
2320 bool ActOnDuplicateDefinition(
DeclSpec &DS, Decl *Prev,
2326 SkippedDefinitionContext ActOnTagStartSkippedDefinition(Scope *S, Decl *TD);
2328 Decl *ActOnObjCContainerStartDefinition(Decl *IDecl);
2333 void ActOnStartCXXMemberDeclarations(Scope *S, Decl *
TagDecl,
2335 bool IsFinalSpelledSealed,
2340 void ActOnTagFinishDefinition(Scope *S, Decl *
TagDecl,
2343 void ActOnTagFinishSkippedDefinition(SkippedDefinitionContext Context);
2345 void ActOnObjCContainerFinishDefinition();
2351 void ActOnObjCTemporaryExitContainerContext(
DeclContext *DC);
2352 void ActOnObjCReenterContainerContext(
DeclContext *DC);
2356 void ActOnTagDefinitionError(Scope *S, Decl *
TagDecl);
2364 bool CheckEnumRedeclaration(
SourceLocation EnumLoc,
bool IsScoped,
2365 QualType EnumUnderlyingTy,
bool IsFixed,
2373 Decl *ActOnEnumConstant(Scope *S, Decl *
EnumDecl, Decl *LastEnumConstant,
2385 void PopDeclContext();
2389 void EnterDeclaratorContext(Scope *S,
DeclContext *DC);
2390 void ExitDeclaratorContext(Scope *S);
2393 void ActOnReenterFunctionContext(Scope* S, Decl* D);
2394 void ActOnExitFunctionContext();
2401 FunctionDecl *getCurFunctionDecl();
2411 NamedDecl *getCurFunctionOrMethodDecl();
2414 void PushOnScopeChains(
NamedDecl *D, Scope *S,
bool AddToContext =
true);
2432 bool AllowInlineNamespace =
false);
2436 static Scope *getScopeForDeclContext(Scope *S,
DeclContext *DC);
2441 bool isIncompatibleTypedef(
TypeDecl *Old, TypedefNameDecl *New);
2463 VersionTuple Introduced,
2464 VersionTuple Deprecated,
2465 VersionTuple Obsoleted,
2468 bool IsStrict, StringRef Replacement,
2470 unsigned AttrSpellingListIndex);
2471 TypeVisibilityAttr *mergeTypeVisibilityAttr(Decl *D,
SourceRange Range,
2472 TypeVisibilityAttr::VisibilityType Vis,
2473 unsigned AttrSpellingListIndex);
2474 VisibilityAttr *mergeVisibilityAttr(Decl *D,
SourceRange Range,
2475 VisibilityAttr::VisibilityType Vis,
2476 unsigned AttrSpellingListIndex);
2477 UuidAttr *mergeUuidAttr(Decl *D,
SourceRange Range,
2478 unsigned AttrSpellingListIndex, StringRef Uuid);
2479 DLLImportAttr *mergeDLLImportAttr(Decl *D,
SourceRange Range,
2480 unsigned AttrSpellingListIndex);
2481 DLLExportAttr *mergeDLLExportAttr(Decl *D,
SourceRange Range,
2482 unsigned AttrSpellingListIndex);
2484 mergeMSInheritanceAttr(Decl *D,
SourceRange Range,
bool BestCase,
2485 unsigned AttrSpellingListIndex,
2486 MSInheritanceAttr::Spelling SemanticSpelling);
2487 FormatAttr *mergeFormatAttr(Decl *D,
SourceRange Range,
2489 int FirstArg,
unsigned AttrSpellingListIndex);
2490 SectionAttr *mergeSectionAttr(Decl *D,
SourceRange Range, StringRef Name,
2491 unsigned AttrSpellingListIndex);
2492 CodeSegAttr *mergeCodeSegAttr(Decl *D,
SourceRange Range, StringRef Name,
2493 unsigned AttrSpellingListIndex);
2494 AlwaysInlineAttr *mergeAlwaysInlineAttr(Decl *D,
SourceRange Range,
2496 unsigned AttrSpellingListIndex);
2497 MinSizeAttr *mergeMinSizeAttr(Decl *D,
SourceRange Range,
2498 unsigned AttrSpellingListIndex);
2499 OptimizeNoneAttr *mergeOptimizeNoneAttr(Decl *D,
SourceRange Range,
2500 unsigned AttrSpellingListIndex);
2501 InternalLinkageAttr *mergeInternalLinkageAttr(Decl *D,
const ParsedAttr &AL);
2502 InternalLinkageAttr *mergeInternalLinkageAttr(Decl *D,
2503 const InternalLinkageAttr &AL);
2504 CommonAttr *mergeCommonAttr(Decl *D,
const ParsedAttr &AL);
2505 CommonAttr *mergeCommonAttr(Decl *D,
const CommonAttr &AL);
2507 void mergeDeclAttributes(
NamedDecl *New, Decl *Old,
2509 void MergeTypedefNameDecl(Scope *S, TypedefNameDecl *New,
2511 bool MergeFunctionDecl(FunctionDecl *New,
NamedDecl *&Old, Scope *S,
2512 bool MergeTypeWithOld);
2513 bool MergeCompatibleFunctionDecls(FunctionDecl *New, FunctionDecl *Old,
2514 Scope *S,
bool MergeTypeWithOld);
2516 void MergeVarDecl(VarDecl *New,
LookupResult &Previous);
2517 void MergeVarDeclTypes(VarDecl *New, VarDecl *Old,
bool MergeTypeWithOld);
2518 void MergeVarDeclExceptionSpecs(VarDecl *New, VarDecl *Old);
2519 bool checkVarDeclRedefinition(VarDecl *OldDefn, VarDecl *NewDefn);
2521 bool MergeCXXFunctionDecl(FunctionDecl *New, FunctionDecl *Old, Scope *S);
2533 AA_Passing_CFAudited
2554 bool IsForUsingDecl);
2555 bool IsOverload(FunctionDecl *New, FunctionDecl *Old,
bool IsForUsingDecl,
2556 bool ConsiderCudaAttrs =
true);
2563 bool isFunctionConsideredUnavailable(FunctionDecl *FD);
2567 bool SuppressUserConversions,
2569 bool InOverloadResolution,
2571 bool AllowObjCWritebackConversion);
2577 bool InOverloadResolution,
2578 QualType& ConvertedType,
bool &IncompatibleObjC);
2580 QualType& ConvertedType,
bool &IncompatibleObjC);
2587 unsigned *ArgPos =
nullptr);
2593 bool CheckPointerConversion(
Expr *From,
QualType ToType,
2595 CXXCastPath& BasePath,
2596 bool IgnoreBaseAccess,
2597 bool Diagnose =
true);
2599 bool InOverloadResolution,
2601 bool CheckMemberPointerConversion(
Expr *From,
QualType ToType,
2603 CXXCastPath &BasePath,
2604 bool IgnoreBaseAccess);
2606 bool CStyle,
bool &ObjCLifetimeConversion);
2609 bool DiagnoseMultipleUserDefinedConversion(
Expr *From,
QualType ToType);
2613 const VarDecl *NRVOCandidate,
2616 bool AllowNRVO =
true);
2623 bool TopLevelOfInitList =
false,
2624 bool AllowExplicit =
false);
2659 bool SuppressConversion =
false)
2660 : Suppress(Suppress), SuppressConversion(SuppressConversion) {}
2702 bool AllowScopedEnumerations;
2706 bool Suppress,
bool SuppressConversion)
2708 AllowScopedEnumerations(AllowScopedEnumerations) {}
2715 return diagnoseNotInt(S, Loc, T);
2725 ExprResult PerformContextualImplicitConversion(
2761 void AddOverloadCandidate(FunctionDecl *Function,
DeclAccessPair FoundDecl,
2764 bool SuppressUserConversions =
false,
2765 bool PartialOverloading =
false,
2766 bool AllowExplicit =
false,
2768 ConversionSequenceList EarlyConversions = None);
2773 bool SuppressUserConversions =
false,
2774 bool PartialOverloading =
false,
2775 bool FirstArgumentIsBase =
false);
2781 bool SuppressUserConversion =
false);
2788 bool SuppressUserConversions =
false,
2789 bool PartialOverloading =
false,
2790 ConversionSequenceList EarlyConversions = None);
2799 bool SuppressUserConversions =
false,
2800 bool PartialOverloading =
false);
2801 void AddTemplateOverloadCandidate(
2805 bool PartialOverloading =
false,
2806 ADLCallKind IsADLCandidate = ADLCallKind::NotADL);
2811 ConversionSequenceList &Conversions,
2812 bool SuppressUserConversions,
2816 ObjectClassification = {});
2822 bool AllowObjCConversionOnExplicit,
2823 bool AllowResultConversion =
true);
2829 bool AllowObjCConversionOnExplicit,
2830 bool AllowResultConversion =
true);
2843 bool IsAssignmentOperator =
false,
2844 unsigned NumContextualBoolArguments = 0);
2853 bool PartialOverloading =
false);
2856 void NoteOverloadCandidate(
NamedDecl *Found, FunctionDecl *Fn,
2858 bool TakingAddress =
false);
2863 bool TakingAddress =
false);
2868 bool MissingImplicitThis =
false);
2872 std::pair<Expr *, std::string> findFailedBooleanCondition(
Expr *Cond);
2881 bool diagnoseArgDependentDiagnoseIfAttrs(
const FunctionDecl *Function,
2882 const Expr *ThisArg,
2893 bool diagnoseArgIndependentDiagnoseIfAttrs(
const NamedDecl *ND,
2901 bool Complain =
false,
2913 ResolveAddressOfOverloadedFunction(
Expr *AddressOfExpr,
2917 bool *pHadMultipleCandidates =
nullptr);
2920 resolveAddressOfOnlyViableOverloadCandidate(
Expr *E,
2923 bool resolveAndFixAddressOfOnlyViableOverloadCandidate(
2924 ExprResult &SrcExpr,
bool DoFunctionPointerConversion =
false);
2927 ResolveSingleFunctionTemplateSpecialization(
OverloadExpr *ovl,
2928 bool Complain =
false,
2931 bool ResolveAndFixSingleFunctionTemplateSpecialization(
2933 bool DoFunctionPointerConverion =
false,
2934 bool Complain =
false,
2937 unsigned DiagIDForComplaining = 0);
2940 Expr *FixOverloadedFunctionReference(
Expr *E,
2950 bool PartialOverloading =
false);
2957 FRS_DiagnosticIssued
2973 bool AllowTypoCorrection=
true,
2974 bool CalleesAddressIsTaken=
false);
2984 Expr *input,
bool RequiresADL =
true);
2990 bool RequiresADL =
true);
2997 BuildCallToMemberFunction(Scope *S,
Expr *MemExpr,
3008 bool *NoArrowOperatorFound =
nullptr);
3018 bool CheckParameterNames);
3019 void CheckCXXDefaultArguments(FunctionDecl *FD);
3020 void CheckExtraCXXDefaultArguments(
Declarator &D);
3021 Scope *getNonFieldDeclScope(Scope *S);
3055 LookupOrdinaryName = 0,
3103 NotForRedeclaration = 0,
3110 ForExternalRedeclaration
3118 if (cast<Decl>(CurContext)
3119 ->getOwningModuleForLinkage(
true))
3120 return ForVisibleRedeclaration;
3121 return ForExternalRedeclaration;
3155 typedef std::function<ExprResult(Sema &, TypoExpr *, TypoCorrection)>
3161 struct TypoExprState {
3162 std::unique_ptr<TypoCorrectionConsumer> Consumer;
3163 TypoDiagnosticGenerator DiagHandler;
3166 TypoExprState(TypoExprState &&other) noexcept;
3167 TypoExprState &operator=(TypoExprState &&other) noexcept;
3171 llvm::MapVector<TypoExpr *, TypoExprState> DelayedTypos;
3174 TypoExpr *createDelayedTypo(std::unique_ptr<TypoCorrectionConsumer> TCC,
3175 TypoDiagnosticGenerator TDG,
3182 llvm::MapVector<NamespaceDecl*, bool> KnownNamespaces;
3186 bool LoadedExternalKnownNamespaces;
3191 std::unique_ptr<TypoCorrectionConsumer>
3195 std::unique_ptr<CorrectionCandidateCallback> CCC,
3198 bool ErrorRecovery);
3201 const TypoExprState &getTypoExprState(
TypoExpr *TE)
const;
3204 void clearDelayedTypo(
TypoExpr *TE);
3215 = NotForRedeclaration);
3217 bool AllowBuiltinCreation =
false);
3219 bool InUnqualifiedLookup =
false);
3223 bool AllowBuiltinCreation =
false,
3224 bool EnteringContext =
false);
3227 = NotForRedeclaration);
3238 CXXConstructorDecl *LookupDefaultConstructor(
CXXRecordDecl *Class);
3239 CXXConstructorDecl *LookupCopyingConstructor(
CXXRecordDecl *Class,
3242 bool RValueThis,
unsigned ThisQuals);
3243 CXXConstructorDecl *LookupMovingConstructor(
CXXRecordDecl *Class,
3246 bool RValueThis,
unsigned ThisQuals);
3254 bool AllowStringTemplate,
3255 bool DiagnoseMissing);
3256 bool isKnownName(StringRef name);
3263 bool IncludeGlobalScope =
true,
3264 bool LoadExternal =
true);
3267 bool IncludeGlobalScope =
true,
3268 bool IncludeDependentBases =
false,
3269 bool LoadExternal =
true);
3279 std::unique_ptr<CorrectionCandidateCallback> CCC,
3282 bool EnteringContext =
false,
3284 bool RecordFailure =
true);
3289 std::unique_ptr<CorrectionCandidateCallback> CCC,
3290 TypoDiagnosticGenerator TDG,
3293 bool EnteringContext =
false,
3311 CorrectDelayedTyposInExpr(
Expr *E, VarDecl *InitDecl =
nullptr,
3318 return CorrectDelayedTyposInExpr(E,
nullptr,
Filter);
3331 return CorrectDelayedTyposInExpr(ER,
nullptr,
Filter);
3336 bool ErrorRecovery =
true);
3341 bool ErrorRecovery =
true);
3343 void MarkTypoCorrectedFunctionDefinition(
const NamedDecl *F);
3345 void FindAssociatedClassesAndNamespaces(
SourceLocation InstantiationLoc,
3347 AssociatedNamespaceSet &AssociatedNamespaces,
3348 AssociatedClassSet &AssociatedClasses);
3351 bool ConsiderLinkage,
bool AllowInlineNamespace);
3362 Scope *S,
bool ForRedeclaration,
3366 void AddKnownFunctionAttributes(FunctionDecl *FD);
3370 void ProcessPragmaWeak(Scope *S, Decl *D);
3372 void ProcessDeclAttributes(Scope *S, Decl *D,
const Declarator &PD);
3374 void ProcessDeclAttributeDelayed(Decl *D,
3377 bool IncludeCXX11Attributes =
true);
3381 void checkUnusedDeclAttributes(
Declarator &D);
3387 bool isValidPointerAttrType(
QualType T,
bool RefOkay =
false);
3389 bool CheckRegparmAttr(
const ParsedAttr &attr,
unsigned &value);
3391 const FunctionDecl *FD =
nullptr);
3392 bool CheckAttrTarget(
const ParsedAttr &CurrAttr);
3393 bool CheckAttrNoArgs(
const ParsedAttr &CurrAttr);
3394 bool checkStringLiteralArgumentAttr(
const ParsedAttr &
Attr,
unsigned ArgNum,
3399 bool checkMSInheritanceAttrOnDefinition(
3401 MSInheritanceAttr::Spelling SemanticSpelling);
3403 void CheckAlignasUnderalignment(Decl *D);
3414 bool hasExplicitCallingConv(
QualType &T);
3427 bool IsProtocolMethodDecl);
3431 bool IsProtocolMethodDecl);
3437 bool IsProtocolMethodDecl);
3449 void ImplMethodsVsClassMethods(Scope *S,
ObjCImplDecl* IMPDecl,
3451 bool IncompleteImpl =
false);
3455 void DiagnoseUnimplementedProperties(Scope *S,
ObjCImplDecl* IMPDecl,
3457 bool SynthesizeProperties);
3460 void diagnoseNullResettableSynthesizedSetters(
const ObjCImplDecl *impDecl);
3464 void DefaultSynthesizeProperties(Scope *S,
ObjCImplDecl *IMPDecl,
3467 void DefaultSynthesizeProperties(Scope *S, Decl *D,
SourceLocation AtEnd);
3477 void DiagnoseUnusedBackingIvarInAccessor(Scope *S,
3496 const bool isReadWrite,
3497 unsigned &Attributes,
3498 const unsigned AttributesAsWritten,
3514 const bool isReadWrite,
3515 const unsigned Attributes,
3516 const unsigned AttributesAsWritten,
3525 void AtomicPropertySetterGetterRules(
ObjCImplDecl* IMPDecl,
3530 void DiagnoseMissingDesignatedInitOverrides(
3549 void MatchAllMethodDeclarations(
const SelectorSet &InsMap,
3550 const SelectorSet &ClsMap,
3551 SelectorSet &InsMapSeen,
3552 SelectorSet &ClsMapSeen,
3555 bool &IncompleteImpl,
3556 bool ImmediateClass,
3557 bool WarnCategoryMethodImpl=
false);
3570 void AddMethodToGlobalPool(
ObjCMethodDecl *Method,
bool impl,
bool instance);
3575 bool receiverIdOrClass,
3585 CollectMultipleMethodsInGlobalPool(
Selector Sel,
3587 bool InstanceFirst,
bool CheckTheOther,
3598 bool receiverIdOrClass);
3610 bool RecordFailure =
true) {
3612 TypoCorrectionFailures[Typo].insert(TypoLoc);
3622 AddMethodToGlobalPool(Method, impl,
true);
3627 AddMethodToGlobalPool(Method, impl,
false);
3632 void AddAnyMethodToGlobalPool(Decl *D);
3637 bool receiverIdOrClass=
false) {
3638 return LookupMethodInGlobalPool(Sel, R, receiverIdOrClass,
3645 bool receiverIdOrClass=
false) {
3646 return LookupMethodInGlobalPool(Sel, R, receiverIdOrClass,
3694 ActOnFinishFullExpr(Arg, CC,
false).
get());
3707 bool HasLeadingEmptyMacro =
false);
3709 void ActOnStartOfCompoundStmt(
bool IsStmtExpr);
3710 void ActOnFinishOfCompoundStmt();
3722 S.ActOnFinishOfCompoundStmt();
3741 StmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
3744 void ActOnForEachDeclStmt(DeclGroupPtrTy Decl);
3750 void ActOnCaseStmtBody(Stmt *
CaseStmt, Stmt *SubStmt);
3754 Stmt *SubStmt, Scope *CurScope);
3775 Stmt *Switch, Stmt *Body);
3792 Stmt *First,
Expr *collection,
3794 StmtResult FinishObjCForCollectionStmt(Stmt *ForCollection, Stmt *Body);
3818 Stmt *RangeDecl, Stmt *
Begin, Stmt *
End,
3823 StmtResult FinishCXXForRangeStmt(Stmt *ForRange, Stmt *Body);
3834 void ActOnCapturedRegionStart(
SourceLocation Loc, Scope *CurScope,
3837 void ActOnCapturedRegionStart(
SourceLocation Loc, Scope *CurScope,
3841 void ActOnCapturedRegionError();
3844 unsigned NumParams);
3848 CES_AllowParameters = 1,
3849 CES_AllowDifferentTypes = 2,
3850 CES_AllowExceptionVariables = 4,
3851 CES_FormerDefault = (CES_AllowParameters),
3852 CES_Default = (CES_AllowParameters | CES_AllowDifferentTypes),
3853 CES_AsIfByStdMove = (CES_AllowParameters | CES_AllowDifferentTypes |
3854 CES_AllowExceptionVariables),
3857 VarDecl *getCopyElisionCandidate(
QualType ReturnType,
Expr *E,
3859 bool isCopyElisionCandidate(
QualType ReturnType,
const VarDecl *VD,
3868 bool IsVolatile,
unsigned NumOutputs,
3874 void FillInlineAsmIdentifierInfo(
Expr *Res,
3875 llvm::InlineAsmIdentifierInfo &Info);
3879 bool IsUnevaluatedContext);
3880 bool LookupInlineAsmField(StringRef
Base, StringRef Member,
3882 ExprResult LookupInlineAsmVarDeclField(
Expr *RefExpr, StringRef Member,
3886 StringRef AsmString,
3887 unsigned NumOutputs,
unsigned NumInputs,
3892 LabelDecl *GetOrCreateMSAsmLabel(StringRef ExternalLabelName,
3899 bool Invalid =
false);
3901 Decl *ActOnObjCExceptionDecl(Scope *S,
Declarator &D);
3904 Decl *Parm, Stmt *Body);
3922 VarDecl *BuildExceptionDeclaration(Scope *S,
TypeSourceInfo *TInfo,
3927 Decl *ActOnExceptionDeclarator(Scope *S,
Declarator &D);
3930 Decl *ExDecl, Stmt *HandlerBlock);
3940 void ActOnStartSEHFinallyBlock();
3941 void ActOnAbortSEHFinallyBlock();
3945 void DiagnoseReturnInConstructorExceptionHandler(
CXXTryStmt *TryBlock);
3947 bool ShouldWarnIfUnusedFileScopedDecl(
const DeclaratorDecl *D)
const;
3951 void MarkUnusedFileScopedDecl(
const DeclaratorDecl *D);
3955 void DiagnoseUnusedExprResult(
const Stmt *S);
3956 void DiagnoseUnusedNestedTypedefs(
const RecordDecl *D);
3957 void DiagnoseUnusedDecl(
const NamedDecl *ND);
3971 void DiagnoseEmptyLoopBody(
const Stmt *S,
3972 const Stmt *PossibleBody);
3975 void DiagnoseSelfMove(
const Expr *LHSExpr,
const Expr *RHSExpr,
3980 void diagnoseNullableToNonnullConversion(
QualType DstType,
QualType SrcType,
3989 void PopParsingDeclaration(ParsingDeclState
state, Decl *
decl);
4003 bool ObjCPropertyAccess,
4004 bool AvoidPartialAvailabilityChecks =
false,
4008 UnavailableAttr::ImplicitReason reason);
4011 void DiagnoseUnguardedAvailabilityViolations(Decl *FD);
4016 bool CanUseDecl(
NamedDecl *D,
bool TreatUnavailableAsInvalid);
4019 bool ObjCPropertyAccess =
false,
4020 bool AvoidPartialAvailabilityChecks =
false,
4022 void NoteDeletedFunction(FunctionDecl *FD);
4023 void NoteDeletedInheritingConstructor(CXXConstructorDecl *CD);
4024 std::string getDeletedOrUnavailableSuffix(
const FunctionDecl *FD);
4031 void PushExpressionEvaluationContext(
4034 ExpressionEvaluationContextRecord::EK_Other);
4036 void PushExpressionEvaluationContext(
4039 ExpressionEvaluationContextRecord::EK_Other);
4040 void PopExpressionEvaluationContext();
4042 void DiscardCleanupsInEvaluationContext();
4061 void MarkAnyDeclReferenced(
SourceLocation Loc, Decl *D,
bool MightBeOdrUse);
4062 void MarkFunctionReferenced(
SourceLocation Loc, FunctionDecl *Func,
4063 bool MightBeOdrUse =
true);
4068 void UpdateMarkingForLValueToRValue(
Expr *E);
4069 void CleanupVarDeclMarking();
4112 const unsigned *
const FunctionScopeIndexToStopAt);
4130 void MarkDeclarationsReferencedInExpr(
Expr *E,
4131 bool SkipLocalVariables =
false);
4137 bool ForceComplain =
false,
4138 bool (*IsPlausibleResult)(
QualType) =
nullptr);
4141 bool tryExprAsCall(
Expr &E,
QualType &ZeroArgCallReturnTy,
4151 bool DiagRuntimeBehavior(
SourceLocation Loc,
const Stmt *Statement,
4159 UnqualifiedId &Id,
bool HasTrailingLParen,
bool IsAddressOfOperand,
4160 std::unique_ptr<CorrectionCandidateCallback> CCC =
nullptr,
4161 bool IsInlineAsmIdentifier =
false,
Token *KeywordReplacement =
nullptr);
4170 std::unique_ptr<CorrectionCandidateCallback> CCC,
4176 bool AllowBuiltinCreation=
false);
4181 bool isAddressOfOperand,
4195 BuildAnonymousStructUnionMemberReference(
4200 Expr *baseObjectExpr =
nullptr,
4212 bool IsDefiniteInstance,
4214 bool UseArgumentDependentLookup(
const CXXScopeSpec &SS,
4216 bool HasTrailingLParen);
4221 bool IsAddressOfOperand,
const Scope *S,
4232 bool AcceptInvalidDecl =
false);
4237 bool AcceptInvalidDecl =
false);
4254 Scope *UDLScope =
nullptr);
4263 Scope *UDLScope =
nullptr);
4268 Expr *ControllingExpr,
4274 Expr *ControllingExpr,
4286 bool isQualifiedMemberAccess(
Expr *E);
4298 bool IsType,
void *TyOrEx,
4302 bool CheckVecStepExpr(
Expr *E);
4308 ExprResult ActOnSizeofParameterPackExpr(Scope *S,
4350 bool SuppressQualifierCheck =
false,
4361 bool CheckQualifiedMemberReference(
Expr *BaseExpr,
QualType BaseType,
4381 void ActOnDefaultCtorInitializers(Decl *CDtorDecl);
4383 FunctionDecl *FDecl,
4387 bool ExecConfig =
false);
4390 const Expr *ArgExpr);
4397 Expr *ExecConfig =
nullptr,
4398 bool IsExecConfig =
false);
4402 Expr *Config =
nullptr,
bool IsExecConfig =
false,
4423 ExprResult MaybeConvertParenListExprToParenExpr(Scope *S,
Expr *ME);
4467 void ActOnStartStmtExpr();
4470 void ActOnStmtExprError();
4508 bool CheckCaseExpression(
Expr *E);
4527 CheckMicrosoftIfExistsSymbol(Scope *S,
CXXScopeSpec &SS,
4531 CheckMicrosoftIfExistsSymbol(Scope *S,
SourceLocation KeywordLoc,
4602 llvm::SmallBitVector FullyCheckedComparisonCategories;
4631 bool isInitListConstructor(
const FunctionDecl *Ctor);
4633 Decl *ActOnUsingDirective(Scope *CurScope,
SourceLocation UsingLoc,
4641 Decl *ActOnNamespaceAliasDef(Scope *CurScope,
4658 bool HasTypenameKeyword,
4676 bool CheckInheritingConstructorUsingDecl(
UsingDecl *UD);
4681 CXXConstructorDecl *
4682 findInheritingConstructor(
SourceLocation Loc, CXXConstructorDecl *BaseCtor,
4704 bool HadMultipleCandidates,
bool IsListInitialization,
4705 bool IsStdInitListInitialization,
4706 bool RequiresZeroInit,
unsigned ConstructKind,
4713 CXXConstructorDecl *Constructor,
bool Elidable,
4715 bool HadMultipleCandidates,
bool IsListInitialization,
4716 bool IsStdInitListInitialization,
4717 bool RequiresZeroInit,
unsigned ConstructKind,
4725 CXXConstructorDecl *Constructor,
bool Elidable,
4727 bool IsListInitialization,
4728 bool IsStdInitListInitialization,
bool RequiresZeroInit,
4736 bool CheckCXXDefaultArgExpr(
SourceLocation CallLoc, FunctionDecl *FD,
4747 void FinalizeVarWithDestructor(VarDecl *VD,
const RecordType *DeclInitType);
4761 llvm::SmallPtrSet<CanQualType, 4> ExceptionsSeen;
4764 void ClearExceptions() {
4765 ExceptionsSeen.clear();
4779 "noexcept(expr) should not be a possible result");
4784 unsigned size()
const {
return Exceptions.size(); }
4793 void CalledExpr(
Expr *E);
4799 ESI.
Type = getExceptionSpecType();
4808 tok::kw_false).
get();
4830 ComputeDefaultedCopyAssignmentExceptionSpec(
CXXMethodDecl *MD);
4840 ComputeDefaultedMoveAssignmentExceptionSpec(
CXXMethodDecl *MD);
4851 CXXConstructorDecl *CD);
4864 void checkExceptionSpecification(
bool IsTopLevel,
4874 bool isLibstdcxxEagerExceptionSpecHack(
const Declarator &D);
4879 void actOnDelayedExceptionSpecification(Decl *Method,
4884 Expr *NoexceptExpr);
4892 bool Diagnose =
false);
4900 CXXConstructorDecl *DeclareImplicitDefaultConstructor(
4905 void DefineImplicitDefaultConstructor(
SourceLocation CurrentLocation,
4906 CXXConstructorDecl *Constructor);
4929 CXXConstructorDecl *Constructor);
4937 CXXConstructorDecl *DeclareImplicitCopyConstructor(
CXXRecordDecl *ClassDecl);
4941 void DefineImplicitCopyConstructor(
SourceLocation CurrentLocation,
4942 CXXConstructorDecl *Constructor);
4951 CXXConstructorDecl *DeclareImplicitMoveConstructor(
CXXRecordDecl *ClassDecl);
4955 void DefineImplicitMoveConstructor(
SourceLocation CurrentLocation,
4956 CXXConstructorDecl *Constructor);
4967 void DefineImplicitCopyAssignment(
SourceLocation CurrentLocation,
4980 void DefineImplicitMoveAssignment(
SourceLocation CurrentLocation,
4985 void ForceDeclarationOfImplicitMembers(
CXXRecordDecl *Class);
4988 void CheckImplicitSpecialMemberDeclaration(Scope *S, FunctionDecl *FD);
4992 bool isImplicitlyDeleted(FunctionDecl *FD);
4998 bool checkThisInStaticMemberFunctionType(
CXXMethodDecl *Method);
5002 bool checkThisInStaticMemberFunctionExceptionSpec(
CXXMethodDecl *Method);
5008 bool checkThisInStaticMemberFunctionAttributes(
CXXMethodDecl *Method);
5015 bool CompleteConstructorCall(CXXConstructorDecl *Constructor,
5019 bool AllowExplicit =
false,
5020 bool IsListInitialization =
false);
5028 bool EnteringContext);
5033 bool EnteringContext);
5127 bool Enabled =
true);
5147 bool CheckCXXThisCapture(
SourceLocation Loc,
bool Explicit =
false,
5148 bool BuildAndDiagnose =
true,
5149 const unsigned *
const FunctionScopeIndexToStopAt =
nullptr,
5150 bool ByCopy =
false);
5155 bool isThisOutsideMemberFunctionBody(
QualType BaseType);
5174 bool IsThrownVarInScope);
5185 bool ListInitialization);
5191 bool ListInitialization);
5213 bool isUnavailableAlignedAllocationFunction(
const FunctionDecl &FD)
const;
5217 void diagnoseUnavailableAlignedAllocation(
const FunctionDecl &FD,
5242 FunctionDecl *&OperatorNew,
5243 FunctionDecl *&OperatorDelete,
5244 bool Diagnose =
true);
5245 void DeclareGlobalNewDelete();
5251 bool Diagnose =
true);
5252 FunctionDecl *FindUsualDeallocationFunction(
SourceLocation StartLoc,
5253 bool CanProvideSize,
5256 FunctionDecl *FindDeallocationFunctionForDestructor(
SourceLocation StartLoc,
5261 bool UseGlobal,
bool ArrayForm,
5264 bool IsDelete,
bool CallCanBeVirtual,
5265 bool WarnOnNonAbstractTypes,
5307 ExprResult ActOnStartCXXMemberReference(Scope *S,
5312 bool &MayBePseudoDestructor);
5341 Expr *MaybeCreateExprWithCleanups(
Expr *SubExpr);
5342 Stmt *MaybeCreateStmtWithCleanups(Stmt *SubStmt);
5346 CreateMaterializeTemporaryExpr(
QualType T,
Expr *Temporary,
5347 bool BoundToLvalueReference);
5350 return ActOnFinishFullExpr(
5354 bool DiscardedValue,
bool IsConstexpr =
false);
5362 bool EnteringContext =
false);
5363 bool isDependentScopeSpecifier(
const CXXScopeSpec &SS);
5389 bool isAcceptableNestedNameSpecifier(
const NamedDecl *SD,
5390 bool *CanCorrect =
nullptr);
5412 : ObjectType(ObjectType), Identifier(II), IdentifierLoc(IdLoc),
5413 CCLoc(ColonColonLoc) {
5418 : ObjectType(
ParsedType::make(ObjectType)), Identifier(II),
5419 IdentifierLoc(IdLoc), CCLoc(ColonColonLoc) {
5423 bool isNonTypeNestedNameSpecifier(Scope *S,
CXXScopeSpec &SS,
5426 bool BuildCXXNestedNameSpecifier(Scope *S,
5428 bool EnteringContext,
5431 bool ErrorRecoveryLookup,
5432 bool *IsCorrectedToColon =
nullptr,
5433 bool OnlyNamespace =
false);
5460 bool ActOnCXXNestedNameSpecifier(Scope *S,
5462 bool EnteringContext,
5464 bool ErrorRecoveryLookup =
false,
5465 bool *IsCorrectedToColon =
nullptr,
5466 bool OnlyNamespace =
false);
5470 bool ActOnCXXNestedNameSpecifierDecltype(
CXXScopeSpec &SS,
5474 bool IsInvalidUnlessNestedName(Scope *S,
CXXScopeSpec &SS,
5476 bool EnteringContext);
5501 bool ActOnCXXNestedNameSpecifier(Scope *S,
5504 TemplateTy TemplateName,
5510 bool EnteringContext);
5520 void *SaveNestedNameSpecifierAnnotation(
CXXScopeSpec &SS);
5532 void RestoreNestedNameSpecifierAnnotation(
void *Annotation,
5536 bool ShouldEnterDeclaratorScope(Scope *S,
const CXXScopeSpec &SS);
5544 bool ActOnCXXEnterDeclaratorScope(Scope *S,
CXXScopeSpec &SS);
5551 void ActOnCXXExitDeclaratorScope(Scope *S,
const CXXScopeSpec &SS);
5558 void ActOnCXXEnterDeclInitializer(Scope *S, Decl *Dcl);
5562 void ActOnCXXExitDeclInitializer(Scope *S, Decl *Dcl);
5567 bool KnownDependent,
5576 bool IsConstexprSpecified);
5584 bool ExplicitParams,
5585 bool ExplicitResultType,
5594 return ParsedType::make(buildLambdaInitCaptureInitialization(
5595 Loc, ByRef, Id, InitKind != LambdaCaptureInitKind::CopyInit, Init));
5599 bool DirectInit, Expr *&Init);
5609 unsigned InitStyle, Expr *Init);
5619 void addLambdaParameters(
5637 bool IsInstantiation =
false);
5649 bool DiagnoseUnusedLambdaCapture(
SourceRange CaptureRange,
5669 void DefineImplicitLambdaToFunctionPointerConversion(
5679 void DefineImplicitLambdaToBlockPointerConversion(
SourceLocation CurrentLoc,
5721 bool HadMultipleCandidates);
5735 bool WarnMultipleSelectors);
5748 Decl *ActOnStartLinkageSpecification(Scope *S,
5752 Decl *ActOnFinishLinkageSpecification(Scope *S,
5775 void ActOnStartCXXInClassMemberInitializer();
5776 void ActOnFinishCXXInClassMemberInitializer(Decl *VarDecl,
5826 bool SetDelegatingInitializer(CXXConstructorDecl *Constructor,
5829 bool SetCtorInitializers(CXXConstructorDecl *Constructor,
bool AnyErrors,
5844 typedef std::pair<CXXRecordDecl*, SourceLocation>
VTableUse;
5857 void LoadExternalVTableUses();
5862 bool DefinitionRequired =
false);
5879 bool DefineUsedVTables();
5881 void AddImplicitlyDeclaredMembersToClass(
CXXRecordDecl *ClassDecl);
5883 void ActOnMemInitializers(Decl *ConstructorDecl,
5894 void referenceDLLExportedClassMethods();
5896 void propagateDLLAttrToBaseClassTemplate(
5907 void ActOnFinishCXXMemberSpecification(Scope *S,
SourceLocation RLoc,
5911 void ActOnFinishCXXMemberDecls();
5912 void ActOnFinishCXXNonNestedClass(Decl *D);
5914 void ActOnReenterCXXMethodParameter(Scope *S,
ParmVarDecl *Param);
5915 unsigned ActOnReenterTemplateScope(Scope *S, Decl *Template);
5916 void ActOnStartDelayedMemberDeclarations(Scope *S, Decl *Record);
5917 void ActOnStartDelayedCXXMethodDeclaration(Scope *S, Decl *Method);
5918 void ActOnDelayedCXXMethodParameter(Scope *S, Decl *Param);
5919 void ActOnFinishDelayedMemberDeclarations(Scope *S, Decl *Record);
5920 void ActOnFinishDelayedCXXMethodDeclaration(Scope *S, Decl *Method);
5921 void ActOnFinishDelayedMemberInitializers(Decl *Record);
5922 void MarkAsLateParsedTemplate(FunctionDecl *FD, Decl *FnD,
5924 void UnmarkAsLateParsedTemplate(FunctionDecl *FD);
5925 bool IsInsideALocalClassWithinATemplateFunction();
5927 Decl *ActOnStaticAssertDeclaration(
SourceLocation StaticAssertLoc,
5929 Expr *AssertMessageExpr,
5931 Decl *BuildStaticAssertDeclaration(
SourceLocation StaticAssertLoc,
5940 Decl *ActOnFriendTypeDecl(Scope *S,
const DeclSpec &DS,
5947 void CheckConstructor(CXXConstructorDecl *Constructor);
5958 void CheckExplicitlyDefaultedSpecialMember(
CXXMethodDecl *MD);
5959 void CheckExplicitlyDefaultedMemberExceptionSpec(
CXXMethodDecl *MD,
5961 void CheckDelayedMemberExceptionSpecs();
5974 BaseResult ActOnBaseSpecifier(Decl *classdecl,
5984 void ActOnBaseSpecifiers(Decl *ClassDecl,
5996 CXXCastPath *BasePath =
nullptr,
5997 bool IgnoreAccess =
false);
5999 unsigned InaccessibleBaseID,
6000 unsigned AmbigiousBaseConvID,
6003 CXXCastPath *BasePath,
6004 bool IgnoreAccess =
false);
6006 std::string getAmbiguousPathsDisplayString(
CXXBasePaths &Paths);
6008 bool CheckOverridingFunctionAttributes(
const CXXMethodDecl *New,
6013 bool CheckOverridingFunctionReturnType(
const CXXMethodDecl *New,
6018 bool CheckOverridingFunctionExceptionSpec(
const CXXMethodDecl *New,
6024 void CheckOverrideControl(
NamedDecl *D);
6028 void DiagnoseAbsenceOfOverrideControl(
NamedDecl *D);
6033 bool CheckIfOverriddenFunctionIsMarkedFinal(
const CXXMethodDecl *New,
6048 bool SetMemberAccessSpecifier(
NamedDecl *MemberDecl,
6060 bool Diagnose =
true);
6062 CXXConstructorDecl *D,
6065 bool IsCopyBindingRefToTemp =
false);
6067 CXXConstructorDecl *D,
6093 bool ForceCheck =
false,
6094 bool ForceUnprivileged =
false);
6098 bool isSpecialMemberAccessibleForDeletion(
CXXMethodDecl *decl,
6104 void PerformDependentDiagnostics(
const DeclContext *Pattern,
6127 template <
typename... Ts>
6129 const Ts &...Args) {
6131 return RequireNonAbstractType(Loc, T, Diagnoser);
6140 bool CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl);
6142 bool CheckLiteralOperatorDeclaration(FunctionDecl *FnDecl);
6148 bool AllowFunctionTemplates =
true);
6150 bool AllowFunctionTemplates =
true);
6153 QualType ObjectType,
bool EnteringContext,
6154 bool &MemberOfUnknownSpecialization,
6159 bool hasTemplateKeyword,
6162 bool EnteringContext,
6163 TemplateTy &Template,
6164 bool &MemberOfUnknownSpecialization);
6176 TemplateTy &SuggestedTemplate,
6179 bool DiagnoseUninstantiableTemplate(
SourceLocation PointOfInstantiation,
6181 bool InstantiatedFromMember,
6185 bool Complain =
true);
6187 void DiagnoseTemplateParameterShadow(
SourceLocation Loc, Decl *PrevDecl);
6190 NamedDecl *ActOnTypeParameter(Scope *S,
bool Typename,
6195 unsigned Depth,
unsigned Position,
6208 NamedDecl *ActOnTemplateTemplateParameter(Scope *S,
6220 ActOnTemplateParameterList(
unsigned Depth,
6226 Expr *RequiresClause);
6237 TPC_TypeAliasTemplate
6248 bool IsFriend,
bool &IsMemberSpecialization,
bool &Invalid);
6268 void NoteAllFoundTemplates(TemplateName Name);
6270 QualType CheckTemplateIdType(TemplateName Template,
6281 bool IsCtorOrDtorName =
false,
6282 bool IsClassName =
false);
6291 TemplateTy TemplateD,
6313 void diagnoseMissingTemplateArguments(TemplateName Name,
SourceLocation Loc);
6329 TemplateTy &Template,
bool AllowInjectedClassName =
false);
6340 unsigned NumExplicitArgs,
6342 void CheckTemplatePartialSpecialization(
6344 void CheckTemplatePartialSpecialization(
6347 Decl *ActOnTemplateDeclarator(Scope *S,
6359 bool CheckDependentFunctionTemplateSpecialization(FunctionDecl *FD,
6363 bool CheckFunctionTemplateSpecialization(
6383 DeclResult ActOnExplicitInstantiation(Scope *S,
6389 SubstDefaultTemplateArgumentIfAvailable(
TemplateDecl *Template,
6395 bool &HasDefaultArg);
6410 CTAK_DeducedFromArrayBound
6413 bool CheckTemplateArgument(
NamedDecl *Param,
6418 unsigned ArgumentPackIndex,
6450 bool PartialTemplateArgs,
6452 bool UpdateArgsWithConversions =
true);
6461 QualType InstantiatedParamType, Expr *Arg,
6506 TPL_TemplateTemplateArgumentMatch
6549 TemplateTy TemplateName,
6565 bool RebuildNestedNameSpecifierInCurrentInstantiation(
CXXScopeSpec &SS);
6567 ExprResult RebuildExprInCurrentInstantiation(Expr *E);
6568 bool RebuildTemplateParamsInCurrentInstantiation(
6586 bool isUnexpandedParameterPackPermitted();
6595 UPPC_Expression = 0,
6688 bool DiagnoseUnexpandedParameterPack(Expr *E,
6698 bool DiagnoseUnexpandedParameterPack(
const CXXScopeSpec &SS,
6721 TemplateName Template,
6872 bool &RetainExpansion,
6900 bool containsUnexpandedParameterPacks(
Declarator &D);
6932 bool AdjustExceptionSpec =
false);
6992 TDK_CUDATargetMismatch
7016 unsigned ArgIdx,
QualType OriginalArgType)
7017 : OriginalParamType(OriginalParamType),
7018 DecomposedParam(DecomposedParam), ArgIdx(ArgIdx),
7019 OriginalArgType(OriginalArgType) {}
7030 unsigned NumExplicitlySpecified, FunctionDecl *&Specialization,
7033 bool PartialOverloading =
false,
7034 llvm::function_ref<
bool()> CheckNonDependent = []{
return false; });
7040 bool PartialOverloading,
7047 FunctionDecl *&Specialization,
7049 bool IsAddressOfFunction =
false);
7060 FunctionDecl *&Specialization,
7062 bool IsAddressOfFunction =
false);
7077 DAR_FailedAlreadyDiagnosed
7086 void DiagnoseAutoDeductionFailure(VarDecl *VDecl, Expr *Init);
7088 bool Diagnose =
true);
7092 void DeclareImplicitDeductionGuides(
TemplateDecl *Template,
7095 QualType DeduceTemplateSpecializationFromInitializer(
7104 TypeLoc getReturnTypeLoc(FunctionDecl *FD)
const;
7106 bool DeduceFunctionTypeFromReturnExpr(FunctionDecl *FD,
7114 unsigned NumCallArguments1,
7115 unsigned NumCallArguments2);
7126 getMoreSpecializedPartialSpecialization(
7141 bool isTemplateTemplateParameterAtLeastAsSpecializedAs(
7147 llvm::SmallBitVector &
Used);
7150 llvm::SmallBitVector &Deduced) {
7151 return MarkDeducedTemplateParameters(Context, FunctionTemplate, Deduced);
7153 static void MarkDeducedTemplateParameters(
ASTContext &Ctx,
7155 llvm::SmallBitVector &Deduced);
7162 getTemplateInstantiationArgs(
NamedDecl *D,
7164 bool RelativeToPrimary =
false,
7165 const FunctionDecl *Pattern =
nullptr);
7260 assert(Kind != DeclaringSpecialMember);
7261 return {TemplateArgs, NumTemplateArgs};
7274 : Kind(TemplateInstantiation), Entity(nullptr), Template(nullptr),
7275 TemplateArgs(nullptr), NumTemplateArgs(0), DeductionInfo(nullptr) {}
7279 bool isInstantiationRecord()
const;
7335 unsigned LastEmittedCodeSynthesisContextDepth = 0;
7342 std::vector<std::unique_ptr<TemplateInstantiationCallback>>
7359 int OldSubstitutionIndex;
7363 : Self(Self), OldSubstitutionIndex(Self.ArgumentPackSubstitutionIndex) {
7372 friend class ArgumentPackSubstitutionRAII;
7379 typedef llvm::DenseMap<Decl *, SmallVector<PartialDiagnosticAt, 1> >
7499 bool AlreadyInstantiating;
7500 bool CheckInstantiationDepth(
SourceLocation PointOfInstantiation,
7506 Decl *Entity,
NamedDecl *Template =
nullptr,
7517 void popCodeSynthesisContext();
7521 return CodeSynthesisContexts.size() > NonInstantiationEntries;
7525 if (!CodeSynthesisContexts.empty() &&
7526 CodeSynthesisContexts.size() != LastEmittedCodeSynthesisContextDepth) {
7527 PrintInstantiationStack();
7528 LastEmittedCodeSynthesisContextDepth = CodeSynthesisContexts.size();
7530 if (PragmaAttributeCurrentTargetDecl)
7531 PrintPragmaAttributeInstantiationPoint();
7533 void PrintInstantiationStack();
7535 void PrintPragmaAttributeInstantiationPoint();
7550 assert(!ExprEvalContexts.empty() &&
7551 "Must be in an expression evaluation context");
7552 return ExprEvalContexts.back().isUnevaluated();
7560 unsigned PrevSFINAEErrors;
7561 bool PrevInNonInstantiationSFINAEContext;
7562 bool PrevAccessCheckingSFINAE;
7563 bool PrevLastDiagnosticIgnored;
7567 : SemaRef(SemaRef), PrevSFINAEErrors(SemaRef.NumSFINAEErrors),
7568 PrevInNonInstantiationSFINAEContext(
7569 SemaRef.InNonInstantiationSFINAEContext),
7570 PrevAccessCheckingSFINAE(SemaRef.AccessCheckingSFINAE),
7571 PrevLastDiagnosticIgnored(
7572 SemaRef.getDiagnostics().isLastDiagnosticIgnored())
7582 = PrevInNonInstantiationSFINAEContext;
7585 PrevLastDiagnosticIgnored);
7602 bool PrevDisableTypoCorrection;
7605 : SemaRef(SemaRef), Trap(SemaRef,
true),
7606 PrevDisableTypoCorrection(SemaRef.DisableTypoCorrection) {
7658 : S(S), Enabled(Enabled) {
7659 if (!Enabled)
return;
7667 S.DefineUsedVTables();
7668 S.PerformPendingInstantiations();
7673 if (!Enabled)
return;
7676 assert(S.VTableUses.empty() &&
7677 "VTableUses should be empty before it is discarded.");
7678 S.VTableUses.swap(SavedVTableUses);
7681 assert(S.PendingInstantiations.empty() &&
7682 "PendingInstantiations should be empty before it is discarded.");
7683 S.PendingInstantiations.swap(SavedPendingInstantiations);
7689 std::deque<PendingImplicitInstantiation> SavedPendingInstantiations;
7705 SavedPendingLocalImplicitInstantiations.swap(
7709 void perform() { S.PerformPendingInstantiations(
true); }
7712 assert(S.PendingLocalImplicitInstantiations.empty() &&
7713 "there shouldn't be any pending local implicit instantiations");
7714 SavedPendingLocalImplicitInstantiations.swap(
7715 S.PendingLocalImplicitInstantiations);
7720 std::deque<PendingImplicitInstantiation>
7721 SavedPendingLocalImplicitInstantiations;
7727 bool HasInteresting =
false;
7733 assert(Infos.size() <= index);
7734 Infos.resize(index);
7735 Infos.push_back(info);
7737 if (!HasInteresting)
7745 if (!HasInteresting)
return nullptr;
7746 Infos.resize(numParams);
7747 return Infos.data();
7751 void PerformPendingInstantiations(
bool LocalOnly =
false);
7756 bool AllowDeducedTST =
false);
7780 int indexAdjustment,
7782 bool ExpectParameterPack);
7821 bool CXXDirectInit);
7833 bool Complain =
true);
7840 bool InstantiateInClassInitializer(
7851 : TmplAttr(A), Scope(S), NewDecl(D)
7857 const Decl *Pattern, Decl *Inst,
7858 LateInstantiatedAttrVec *LateAttrs =
nullptr,
7863 const Decl *Pattern, Decl *Inst,
7864 LateInstantiatedAttrVec *LateAttrs =
nullptr,
7867 bool usesPartialOrExplicitSpecialization(
7871 InstantiateClassTemplateSpecialization(
SourceLocation PointOfInstantiation,
7874 bool Complain =
true);
7876 void InstantiateClassMembers(
SourceLocation PointOfInstantiation,
7881 void InstantiateClassTemplateSpecializationMembers(
7901 void InstantiateExceptionSpec(
SourceLocation PointOfInstantiation,
7902 FunctionDecl *Function);
7906 void InstantiateFunctionDefinition(
SourceLocation PointOfInstantiation,
7907 FunctionDecl *Function,
7908 bool Recursive =
false,
7909 bool DefinitionRequired =
false,
7910 bool AtEndOfTU =
false);
7917 LateInstantiatedAttrVec *LateAttrs =
nullptr,
7923 BuildVariableInstantiation(VarDecl *NewVar, VarDecl *OldVar,
7925 LateInstantiatedAttrVec *LateAttrs,
7928 bool InstantiatingVarTemplate =
false);
7929 void InstantiateVariableInitializer(
7930 VarDecl *Var, VarDecl *OldVar,
7932 void InstantiateVariableDefinition(
SourceLocation PointOfInstantiation,
7933 VarDecl *Var,
bool Recursive =
false,
7934 bool DefinitionRequired =
false,
7935 bool AtEndOfTU =
false);
7937 void InstantiateMemInitializers(CXXConstructorDecl *New,
7938 const CXXConstructorDecl *Tmpl,
7943 bool FindingInstantiatedContext =
false);
7955 OCK_CategoryImplementation
7973 Decl *ActOnStartClassInterface(
7978 Decl *
const *ProtoRefs,
unsigned NumProtoRefs,
7982 void ActOnSuperClassOfClassInterface(Scope *S,
7997 Decl *ActOnCompatibilityAlias(
8002 bool CheckForwardProtocolDeclarationForCircularDependency(
8007 Decl *ActOnStartProtocolInterface(
8013 Decl *ActOnStartCategoryInterface(
8017 Decl *
const *ProtoRefs,
unsigned NumProtoRefs,
8021 Decl *ActOnStartClassImplementation(
8027 Decl *ActOnStartCategoryImplementation(
SourceLocation AtCatImplLoc,
8033 DeclGroupPtrTy ActOnFinishObjCImplementation(Decl *ObjCImpDecl,
8047 void FindProtocolDeclaration(
bool WarnOnDeclarations,
bool ForObjCContainer,
8055 bool SelectProtocolFirst =
false);
8060 void actOnObjCTypeArgsOrProtocolQualifiers(
8073 bool warnOnIncompleteProtocols);
8084 TypeResult actOnObjCTypeArgsAndProtocolQualifiers(
8102 bool FailOnError =
false);
8114 bool FailOnError =
false);
8119 void CheckObjCPropertyAttributes(Decl *PropertyPtrTy,
8121 unsigned &Attributes,
8122 bool propertyInPrimaryClass);
8133 bool OverridingProtocolProperty);
8149 Decl *ActOnPropertyImplDecl(Scope *S,
8164 OSMK_NonRetainingInit
8179 Decl *ActOnMethodDeclaration(
8190 bool isVariadic,
bool MethodDefinition);
8199 bool inferObjCARCLifetime(
ValueDecl *decl);
8234 bool HasTrailingDot,
8253 bool isImplicit =
false);
8256 bool isSuperReceiver,
8270 ExprResult BuildInstanceMessage(Expr *Receiver,
8279 bool isImplicit =
false);
8281 ExprResult BuildInstanceMessageImplicit(Expr *Receiver,
8322 TypedefNameDecl *&TDNDecl,
8323 bool CfToNs,
bool Diagnose =
true);
8327 Expr *&SrcExpr,
bool Diagnose =
true);
8329 bool ConversionToObjCStringLiteralCheck(
QualType DstType, Expr *&SrcExpr,
8330 bool Diagnose =
true);
8370 StringRef SlotLabel, Expr *Alignment);
8373 NonDefaultStateAtInclude,
8379 void DiagnoseUnterminatedPragmaPack();
8392 void ActOnPragmaMSPointersToMembers(
8399 MSVtorDispAttr::Mode Value);
8408 bool UnifySection(StringRef SectionName,
8410 DeclaratorDecl *TheDecl);
8411 bool UnifySection(StringRef SectionName,
8418 llvm::StringRef StackSlotLabel,
8420 llvm::StringRef PragmaName);
8434 void ActOnPragmaDetectMismatch(
SourceLocation Loc, StringRef Name,
8438 void ActOnPragmaUnused(
const Token &Identifier,
8481 void AddAlignmentAttributesForRecord(
RecordDecl *RD);
8484 void AddMsStructLayoutForRecord(
RecordDecl *RD);
8487 void FreePackedContext();
8491 void PushNamespaceVisibilityAttr(
const VisibilityAttr *Attr,
8496 void AddPushedVisibilityAttribute(Decl *RD);
8500 void PopPragmaVisibility(
bool IsNamespaceEnd,
SourceLocation EndLoc);
8503 void FreeVisContext();
8508 void AddCFAuditedAttribute(Decl *D);
8510 void ActOnPragmaAttributeAttribute(
ParsedAttr &Attribute,
8522 void AddPragmaAttributes(Scope *S, Decl *D);
8524 void DiagnoseUnterminatedPragmaAttribute();
8532 return OptimizeOffPragmaLocation;
8538 void AddRangeBasedOptnone(FunctionDecl *FD);
8543 void AddOptnoneAttributeIfNoConflicts(FunctionDecl *FD,
SourceLocation Loc);
8546 void AddAlignedAttr(
SourceRange AttrRange, Decl *D, Expr *E,
8547 unsigned SpellingListIndex,
bool IsPackExpansion);
8549 unsigned SpellingListIndex,
bool IsPackExpansion);
8553 void AddAssumeAlignedAttr(
SourceRange AttrRange, Decl *D, Expr *E, Expr *OE,
8554 unsigned SpellingListIndex);
8558 void AddAllocAlignAttr(
SourceRange AttrRange, Decl *D, Expr *ParamExpr,
8559 unsigned SpellingListIndex);
8563 void AddAlignValueAttr(
SourceRange AttrRange, Decl *D, Expr *E,
8564 unsigned SpellingListIndex);
8568 void AddLaunchBoundsAttr(
SourceRange AttrRange, Decl *D, Expr *MaxThreads,
8569 Expr *MinBlocks,
unsigned SpellingListIndex);
8573 unsigned SpellingListIndex,
bool InInstantiation =
false);
8575 void AddParameterABIAttr(
SourceRange AttrRange, Decl *D,
8579 void AddXConsumedAttr(Decl *D,
SourceRange SR,
unsigned SpellingIndex,
8594 bool IsImplicit =
false);
8599 bool IsImplicit =
false);
8603 void CheckCompletedCoroutineBody(FunctionDecl *FD, Stmt *&Body);
8611 std::string CurrOpenCLExtension;
8613 llvm::DenseMap<const Type*, std::set<std::string>> OpenCLTypeExtMap;
8615 llvm::DenseMap<const Decl*, std::set<std::string>> OpenCLDeclExtMap;
8618 return CurrOpenCLExtension;
8624 std::string getOpenCLExtensionsFromDeclExtMap(FunctionDecl *FD);
8629 std::string getOpenCLExtensionsFromTypeExtMap(
FunctionType *FT);
8632 template<
typename T,
typename MapT>
8633 std::string getOpenCLExtensionsFromExtMap(T* FT, MapT &Map);
8636 CurrOpenCLExtension = Ext;
8642 void setOpenCLExtensionForType(
QualType T, llvm::StringRef Exts);
8648 void setOpenCLExtensionForDecl(Decl *FD, llvm::StringRef Exts);
8653 void setCurrentOpenCLExtensionForType(
QualType T);
8658 void setCurrentOpenCLExtensionForDecl(Decl *FD);
8660 bool isOpenCLDisabledDecl(Decl *FD);
8672 bool checkOpenCLDisabledDecl(
const NamedDecl &D,
const Expr &E);
8678 void *VarDataSharingAttributesStack;
8680 unsigned DeclareTargetNestingLevel = 0;
8682 void InitDataSharingAttributesStack();
8683 void DestroyDataSharingAttributesStack();
8686 bool StrictlyPositive =
true);
8688 unsigned getOpenMPNestingLevel()
const;
8691 void adjustOpenMPTargetScopeIndex(
unsigned &FunctionScopesIndex,
8692 unsigned Level)
const;
8695 void pushOpenMPFunctionRegion();
8710 template <
typename T,
typename DiagLocT,
typename DiagInfoT,
typename MapT>
8711 bool checkOpenCLDisabledTypeOrDecl(T D, DiagLocT DiagLoc, DiagInfoT DiagInfo,
8720 bool isOpenMPCapturedByRef(
const ValueDecl *D,
unsigned Level)
const;
8725 VarDecl *isOpenMPCapturedDecl(
ValueDecl *D);
8731 void startOpenMPLoop();
8736 bool isOpenMPPrivateDecl(
const ValueDecl *D,
unsigned Level)
const;
8746 bool isOpenMPTargetCapturedDecl(
const ValueDecl *D,
unsigned Level)
const;
8757 void EndOpenMPClause();
8759 void EndOpenMPDSABlock(Stmt *CurDirective);
8765 void ActOnOpenMPLoopInitialization(
SourceLocation ForLoc, Stmt *Init);
8770 ExprResult ActOnOpenMPIdExpression(Scope *CurScope,
8774 DeclGroupPtrTy ActOnOpenMPThreadprivateDirective(
8791 DeclGroupPtrTy ActOnOpenMPDeclareReductionDirectiveStart(
8793 ArrayRef<std::pair<QualType, SourceLocation>> ReductionTypes,
8796 void ActOnOpenMPDeclareReductionCombinerStart(Scope *S, Decl *D);
8798 void ActOnOpenMPDeclareReductionCombinerEnd(Decl *D, Expr *Combiner);
8801 VarDecl *ActOnOpenMPDeclareReductionInitializerStart(Scope *S, Decl *D);
8803 void ActOnOpenMPDeclareReductionInitializerEnd(Decl *D, Expr *Initializer,
8804 VarDecl *OmpPrivParm);
8806 DeclGroupPtrTy ActOnOpenMPDeclareReductionDirectiveEnd(
8807 Scope *S, DeclGroupPtrTy DeclReductions,
bool IsValid);
8812 void ActOnFinishOpenMPDeclareTargetDirective();
8814 void ActOnOpenMPDeclareTargetName(Scope *CurScope,
CXXScopeSpec &ScopeSpec,
8816 OMPDeclareTargetDeclAttr::MapTypeTy MT,
8817 NamedDeclSetType &SameDirectiveDecls);
8820 checkDeclIsAllowedInOpenMPTarget(Expr *E, Decl *D,
8824 return DeclareTargetNestingLevel > 0;
8827 bool isInOpenMPTargetExecutionDirective()
const;
8831 return !getLangOpts().OpenMPIsDevice || isInOpenMPDeclareTargetContext() ||
8832 isInOpenMPTargetExecutionDirective();
8858 llvm::SmallDenseMap<const ValueDecl *, const Expr *, 4>;
8908 StmtResult ActOnOpenMPParallelForSimdDirective(
8979 StmtResult ActOnOpenMPTargetParallelForDirective(
9021 StmtResult ActOnOpenMPDistributeParallelForDirective(
9026 StmtResult ActOnOpenMPDistributeParallelForSimdDirective(
9031 StmtResult ActOnOpenMPDistributeSimdDirective(
9036 StmtResult ActOnOpenMPTargetParallelForSimdDirective(
9047 StmtResult ActOnOpenMPTeamsDistributeDirective(
9052 StmtResult ActOnOpenMPTeamsDistributeSimdDirective(
9057 StmtResult ActOnOpenMPTeamsDistributeParallelForSimdDirective(
9062 StmtResult ActOnOpenMPTeamsDistributeParallelForDirective(
9073 StmtResult ActOnOpenMPTargetTeamsDistributeDirective(
9078 StmtResult ActOnOpenMPTargetTeamsDistributeParallelForDirective(
9083 StmtResult ActOnOpenMPTargetTeamsDistributeParallelForSimdDirective(
9088 StmtResult ActOnOpenMPTargetTeamsDistributeSimdDirective(
9102 DeclGroupPtrTy ActOnOpenMPDeclareSimdDirective(
9103 DeclGroupPtrTy DG, OMPDeclareSimdDeclAttr::BranchStateTy BS,
9125 OMPClause *ActOnOpenMPNumThreadsClause(Expr *NumThreads,
9130 OMPClause *ActOnOpenMPSafelenClause(Expr *Length,
9139 OMPClause *ActOnOpenMPCollapseClause(Expr *NumForLoops,
9147 Expr *NumForLoops =
nullptr);
9180 OMPClause *ActOnOpenMPSingleExprWithArgClause(
9244 OMPClause *ActOnOpenMPAtomicDefaultMemOrderClause(
9287 OMPClause *ActOnOpenMPTaskReductionClause(
9294 OMPClause *ActOnOpenMPInReductionClause(
9351 OMPClause *ActOnOpenMPThreadLimitClause(Expr *ThreadLimit,
9360 OMPClause *ActOnOpenMPDistScheduleClause(
9401 CCK_ForBuiltinOverloadedOp
9405 return CCK == CCK_CStyleCast || CCK == CCK_FunctionalCast ||
9406 CCK == CCK_OtherCast;
9414 const CXXCastPath *BasePath =
nullptr,
9416 = CCK_ImplicitConversion);
9433 ExprResult CallExprUnaryConversions(Expr *E);
9437 ExprResult DefaultFunctionArrayConversion(Expr *E,
bool Diagnose =
true);
9442 ExprResult DefaultFunctionArrayLvalueConversion(Expr *E,
9443 bool Diagnose =
true);
9454 ExprResult DefaultArgumentPromotion(Expr *E);
9459 ExprResult TemporaryMaterializationConversion(Expr *E);
9467 VariadicDoesNotApply
9492 bool hasCStrMethod(
const Expr *E);
9496 bool GatherArgumentsForCall(
SourceLocation CallLoc, FunctionDecl *FDecl,
9501 bool AllowExplicit =
false,
9502 bool IsListInitialization =
false);
9507 FunctionDecl *FDecl);
9515 bool IsCompAssign =
false);
9596 bool *Complained =
nullptr);
9601 bool IsValueInFlagEnum(
const EnumDecl *ED,
const llvm::APInt &Val,
9602 bool AllowMask)
const;
9622 bool ConvertRHS =
true);
9640 bool DiagnoseCFAudited =
false,
bool ConvertRHS =
true);
9647 bool IsStringLiteralToNonConstPointerConversion(Expr *From,
QualType ToType);
9649 bool CheckExceptionSpecCompatibility(Expr *From,
QualType ToType);
9653 bool AllowExplicit =
false);
9662 = CCK_ImplicitConversion);
9680 QualType CheckPointerToMemberOperands(
9683 QualType CheckMultiplyDivideOperands(
9688 bool IsCompAssign =
false);
9717 Expr *LHS, Expr *RHS);
9724 QualType CXXCheckConditionalOperands(
9728 bool ConvertArgs =
true);
9731 bool ConvertArgs =
true) {
9732 Expr *E1Tmp = E1.
get(), *E2Tmp = E2.
get();
9734 FindCompositePointerType(Loc, E1Tmp, E2Tmp, ConvertArgs);
9743 bool DiagnoseConditionalForNull(Expr *LHSExpr, Expr *RHSExpr,
9746 void DiagnoseAlwaysNonNullPointer(Expr *E,
9753 bool AllowBothBool,
bool AllowBoolConversion);
9765 bool CheckForConstantInitializer(Expr *e,
QualType t);
9775 Ref_Incompatible = 0,
9786 bool &DerivedToBase,
9787 bool &ObjCConversion,
9788 bool &ObjCLifetimeConversion);
9801 Expr *result,
QualType ¶mType);
9834 bool Diagnose =
true,
9835 bool DiagnoseCFAudited =
false,
9839 Expr *stripARCUnbridgedCast(Expr *e);
9840 void diagnoseARCUnbridgedCast(Expr *e);
9842 bool CheckObjCARCUnavailableWeakConversion(
QualType castType,
9848 void checkRetainCycles(Expr *receiver, Expr *argument);
9849 void checkRetainCycles(VarDecl *Var, Expr *Init);
9857 void checkUnsafeExprAssigns(
SourceLocation Loc, Expr *LHS, Expr *RHS);
9863 bool CheckMessageArgumentTypes(
const Expr *Receiver,
QualType ReceiverType,
9874 QualType getMessageSendResultType(
const Expr *Receiver,
QualType ReceiverType,
9876 bool isSuperMessage);
9880 void EmitRelatedResultTypeNote(
const Expr *E);
9885 void EmitRelatedResultTypeNoteForReturn(
QualType destType);
9897 : ConditionVar(ConditionVar), Condition(Condition), Invalid(
false),
9898 HasKnownValue(IsConstexpr && Condition.get() &&
9899 !Condition.get()->isValueDependent()),
9900 KnownValue(HasKnownValue &&
9901 !!Condition.get()->EvaluateKnownConstInt(S.Context)) {}
9903 : ConditionVar(nullptr), Condition(nullptr), Invalid(Invalid),
9909 std::pair<VarDecl *, Expr *>
get()
const {
9910 return std::make_pair(cast_or_null<VarDecl>(ConditionVar),
9936 ExprResult CheckConditionVariable(VarDecl *ConditionVar,
9950 bool IsConstexpr =
false);
9954 void DiagnoseAssignmentAsCondition(Expr *E);
9958 void DiagnoseEqualityWithExtraParens(
ParenExpr *ParenE);
9961 ExprResult CheckCXXBooleanCondition(Expr *CondExpr,
bool IsConstexpr =
false);
9966 void ConvertIntegerToTypeWarnOnOverflow(llvm::APSInt &OldVal,
9967 unsigned NewWidth,
bool NewSign,
9973 bool CheckObjCDeclScope(Decl *D);
9991 ExprResult VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result,
9993 bool AllowFold =
true);
9994 ExprResult VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result,
9996 bool AllowFold =
true);
9997 ExprResult VerifyIntegerConstantExpression(Expr *E,
9998 llvm::APSInt *Result =
nullptr);
10005 QualType FieldTy,
bool IsMsStruct,
10006 Expr *BitWidth,
bool *ZeroWidth =
nullptr);
10009 unsigned ForceCUDAHostDeviceDepth = 0;
10015 void PushForceCUDAHostDevice();
10020 bool PopForceCUDAHostDevice();
10025 llvm::DenseMap<CanonicalDeclPtr<FunctionDecl>,
10026 std::vector<PartialDiagnosticAt>>
10057 llvm::DenseMap< CanonicalDeclPtr<FunctionDecl>,
10058 llvm::MapVector<CanonicalDeclPtr<FunctionDecl>,
10094 FunctionDecl *Fn,
Sema &S);
10107 operator bool()
const {
return ImmediateDiag.hasValue(); }
10109 template <
typename T>
10112 if (Diag.ImmediateDiag.hasValue())
10113 *Diag.ImmediateDiag << Value;
10114 else if (Diag.PartialDiag.hasValue())
10115 *Diag.PartialDiag << Value;
10124 bool ShowCallStack;
10170 bool IgnoreImplicitHDAttr =
false);
10175 return IdentifyCUDATarget(dyn_cast<FunctionDecl>(CurContext));
10199 const FunctionDecl *Callee);
10207 const FunctionDecl *Callee) {
10208 return IdentifyCUDAPreference(Caller, Callee) != CFP_Never;
10213 void maybeAddCUDAHostDeviceAttrs(FunctionDecl *FD,
10244 void EraseUnwantedCUDAMatches(
10245 const FunctionDecl *Caller,
10246 SmallVectorImpl<std::pair<DeclAccessPair, FunctionDecl *>> &Matches);
10259 bool inferCUDATargetForImplicitSpecialMember(
CXXRecordDecl *ClassDecl,
10267 bool isEmptyCudaConstructor(
SourceLocation Loc, CXXConstructorDecl *CD);
10278 void checkAllowedCUDAInitializer(VarDecl *VD);
10282 void checkCUDATargetOverload(FunctionDecl *NewFD,
10332 PCC_LocalDeclarationSpecifiers
10335 void CodeCompleteModuleImport(
SourceLocation ImportLoc, ModuleIdPath Path);
10336 void CodeCompleteOrdinaryName(Scope *S,
10338 void CodeCompleteDeclSpec(Scope *S,
DeclSpec &DS,
10339 bool AllowNonIdentifiers,
10340 bool AllowNestedNameSpecifiers);
10343 void CodeCompleteExpression(Scope *S,
10345 void CodeCompleteExpression(Scope *S,
QualType PreferredType);
10346 void CodeCompleteMemberReferenceExpr(Scope *S, Expr *
Base, Expr *OtherOpBase,
10348 bool IsBaseExprStatement);
10349 void CodeCompletePostfixExpression(Scope *S,
ExprResult LHS);
10350 void CodeCompleteTag(Scope *S,
unsigned TagSpec);
10351 void CodeCompleteTypeQualifiers(
DeclSpec &DS);
10354 void CodeCompleteBracketDeclarator(Scope *S);
10355 void CodeCompleteCase(Scope *S);
10364 QualType ProduceCtorInitMemberSignatureHelp(Scope *S, Decl *ConstructorDecl,
10366 ParsedType TemplateTypeTy,
10370 void CodeCompleteInitializer(Scope *S, Decl *D);
10371 void CodeCompleteReturn(Scope *S);
10372 void CodeCompleteAfterIf(Scope *S);
10373 void CodeCompleteBinaryRHS(Scope *S, Expr *LHS,
tok::TokenKind Op);
10375 void CodeCompleteQualifiedId(Scope *S,
CXXScopeSpec &SS,
10376 bool EnteringContext,
QualType BaseType);
10377 void CodeCompleteUsing(Scope *S);
10378 void CodeCompleteUsingDirective(Scope *S);
10379 void CodeCompleteNamespaceDecl(Scope *S);
10380 void CodeCompleteNamespaceAliasDecl(Scope *S);
10381 void CodeCompleteOperatorName(Scope *S);
10382 void CodeCompleteConstructorInitializer(
10387 bool AfterAmpersand);
10389 void CodeCompleteObjCAtDirective(Scope *S);
10390 void CodeCompleteObjCAtVisibility(Scope *S);
10391 void CodeCompleteObjCAtStatement(Scope *S);
10392 void CodeCompleteObjCAtExpression(Scope *S);
10393 void CodeCompleteObjCPropertyFlags(Scope *S,
ObjCDeclSpec &ODS);
10394 void CodeCompleteObjCPropertyGetter(Scope *S);
10395 void CodeCompleteObjCPropertySetter(Scope *S);
10396 void CodeCompleteObjCPassingType(Scope *S,
ObjCDeclSpec &DS,
10398 void CodeCompleteObjCMessageReceiver(Scope *S);
10399 void CodeCompleteObjCSuperMessage(Scope *S,
SourceLocation SuperLoc,
10401 bool AtArgumentExpression);
10402 void CodeCompleteObjCClassMessage(Scope *S, ParsedType Receiver,
10404 bool AtArgumentExpression,
10405 bool IsSuper =
false);
10406 void CodeCompleteObjCInstanceMessage(Scope *S, Expr *Receiver,
10408 bool AtArgumentExpression,
10410 void CodeCompleteObjCForCollection(Scope *S,
10411 DeclGroupPtrTy IterationVar);
10412 void CodeCompleteObjCSelector(Scope *S,
10414 void CodeCompleteObjCProtocolReferences(
10416 void CodeCompleteObjCProtocolDecl(Scope *S);
10417 void CodeCompleteObjCInterfaceDecl(Scope *S);
10418 void CodeCompleteObjCSuperclass(Scope *S,
10421 void CodeCompleteObjCImplementationDecl(Scope *S);
10422 void CodeCompleteObjCInterfaceCategory(Scope *S,
10425 void CodeCompleteObjCImplementationCategory(Scope *S,
10428 void CodeCompleteObjCPropertyDefinition(Scope *S);
10429 void CodeCompleteObjCPropertySynthesizeIvar(Scope *S,
10431 void CodeCompleteObjCMethodDecl(Scope *S,
Optional<bool> IsInstanceMethod,
10432 ParsedType ReturnType);
10433 void CodeCompleteObjCMethodDeclSelector(Scope *S,
10434 bool IsInstanceMethod,
10435 bool AtParameterName,
10436 ParsedType ReturnType,
10438 void CodeCompleteObjCClassPropertyRefExpr(Scope *S,
IdentifierInfo &ClassName,
10440 bool IsBaseExprStatement);
10441 void CodeCompletePreprocessorDirective(
bool InConditional);
10442 void CodeCompleteInPreprocessorConditionalExclusion(Scope *S);
10443 void CodeCompletePreprocessorMacroName(
bool IsDefinition);
10444 void CodeCompletePreprocessorExpression();
10445 void CodeCompletePreprocessorMacroArgument(Scope *S,
10448 unsigned Argument);
10449 void CodeCompleteIncludedFile(llvm::StringRef Dir,
bool IsAngled);
10450 void CodeCompleteNaturalLanguage();
10451 void CodeCompleteAvailabilityPlatformName();
10462 unsigned ByteNo)
const;
10465 void CheckArrayAccess(
const Expr *BaseExpr,
const Expr *IndexExpr,
10467 bool AllowOnePastEnd=
true,
bool IndexNegated=
false);
10468 void CheckArrayAccess(
const Expr *E);
10471 struct FormatStringInfo {
10472 unsigned FormatIdx;
10473 unsigned FirstDataArg;
10477 static bool getFormatStringInfo(
const FormatAttr *Format,
bool IsCXXMember,
10478 FormatStringInfo *FSI);
10479 bool CheckFunctionCall(FunctionDecl *FDecl,
CallExpr *TheCall,
10486 void CheckConstructorCall(FunctionDecl *FDecl,
10496 bool CheckObjCString(Expr *Arg);
10497 ExprResult CheckOSLogFormatStringArg(Expr *Arg);
10499 ExprResult CheckBuiltinFunctionCall(FunctionDecl *FDecl,
10500 unsigned BuiltinID,
CallExpr *TheCall);
10502 bool CheckARMBuiltinExclusiveCall(
unsigned BuiltinID,
CallExpr *TheCall,
10503 unsigned MaxWidth);
10504 bool CheckNeonBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10505 bool CheckARMBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10507 bool CheckAArch64BuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10508 bool CheckHexagonBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10509 bool CheckHexagonBuiltinCpu(
unsigned BuiltinID,
CallExpr *TheCall);
10510 bool CheckHexagonBuiltinArgument(
unsigned BuiltinID,
CallExpr *TheCall);
10511 bool CheckMipsBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10512 bool CheckSystemZBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10513 bool CheckX86BuiltinRoundingOrSAE(
unsigned BuiltinID,
CallExpr *TheCall);
10514 bool CheckX86BuiltinGatherScatterScale(
unsigned BuiltinID,
CallExpr *TheCall);
10515 bool CheckX86BuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10516 bool CheckPPCBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10518 bool SemaBuiltinVAStart(
unsigned BuiltinID,
CallExpr *TheCall);
10519 bool SemaBuiltinVAStartARMMicrosoft(
CallExpr *Call);
10520 bool SemaBuiltinUnorderedCompare(
CallExpr *TheCall);
10521 bool SemaBuiltinFPClassification(
CallExpr *TheCall,
unsigned NumArgs);
10522 bool SemaBuiltinVSX(
CallExpr *TheCall);
10523 bool SemaBuiltinOSLogFormat(
CallExpr *TheCall);
10533 bool SemaBuiltinPrefetch(
CallExpr *TheCall);
10534 bool SemaBuiltinAllocaWithAlign(
CallExpr *TheCall);
10535 bool SemaBuiltinAssume(
CallExpr *TheCall);
10536 bool SemaBuiltinAssumeAligned(
CallExpr *TheCall);
10537 bool SemaBuiltinLongjmp(
CallExpr *TheCall);
10538 bool SemaBuiltinSetjmp(
CallExpr *TheCall);
10545 bool SemaBuiltinConstantArg(
CallExpr *TheCall,
int ArgNum,
10546 llvm::APSInt &Result);
10547 bool SemaBuiltinConstantArgRange(
CallExpr *TheCall,
int ArgNum,
int Low,
10548 int High,
bool RangeIsError =
true);
10549 bool SemaBuiltinConstantArgMultiple(
CallExpr *TheCall,
int ArgNum,
10550 unsigned Multiple);
10551 bool SemaBuiltinARMSpecialReg(
unsigned BuiltinID,
CallExpr *TheCall,
10552 int ArgNum,
unsigned ExpectedFieldNum,
10571 static bool GetFormatNSStringIdx(
const FormatAttr *Format,
unsigned &Idx);
10574 bool CheckFormatArguments(
const FormatAttr *Format,
10579 llvm::SmallBitVector &CheckedVarArgs);
10581 bool HasVAListArg,
unsigned format_idx,
10585 llvm::SmallBitVector &CheckedVarArgs);
10587 void CheckAbsoluteValueFunction(
const CallExpr *Call,
10588 const FunctionDecl *FDecl);
10590 void CheckMaxUnsignedZero(
const CallExpr *Call,
const FunctionDecl *FDecl);
10592 void CheckMemaccessArguments(
const CallExpr *Call,
10596 void CheckStrlcpycatArguments(
const CallExpr *Call,
10599 void CheckStrncatArguments(
const CallExpr *Call,
10602 void CheckReturnValExpr(Expr *RetValExp,
QualType lhsType,
10604 bool isObjCMethod =
false,
10605 const AttrVec *Attrs =
nullptr,
10606 const FunctionDecl *FD =
nullptr);
10609 void CheckFloatComparison(
SourceLocation Loc, Expr *LHS, Expr *RHS);
10614 void CheckForIntOverflow(Expr *E);
10615 void CheckUnsequencedOperations(Expr *E);
10620 bool IsConstexpr =
false);
10629 bool DeclIsField =
true);
10633 void CheckBreakContinueBinding(Expr *E);
10641 bool DeleteWasArrayForm);
10644 void RegisterTypeTagForDatatype(
const IdentifierInfo *ArgumentKind,
10645 uint64_t MagicValue,
QualType Type,
10646 bool LayoutCompatible,
bool MustBeNull);
10652 Type(Type), LayoutCompatible(LayoutCompatible),
10653 MustBeNull(MustBeNull)
10670 std::unique_ptr<llvm::DenseMap<TypeTagMagicValue, TypeTagData>>
10671 TypeTagForDatatypeMagicValues;
10675 void CheckArgumentWithTypeTag(
const ArgumentWithTypeTagAttr *Attr,
10681 void CheckAddressOfPackedMember(Expr *rhs);
10738 Decl *getObjCDeclContext()
const;
10741 return OriginalLexicalContext ? OriginalLexicalContext : CurContext;
10748 DC = CatD->getClassInterface();
10755 bool PartialOverloading =
false) {
10757 if (NumArgs > 0 && PartialOverloading)
10758 return NumArgs + 1 > NumParams;
10759 return NumArgs > NumParams;
10767 class SavePendingParsedClassStateRAII {
10769 SavePendingParsedClassStateRAII(
Sema &S) : S(S) { swapSavedState(); }
10771 ~SavePendingParsedClassStateRAII() {
10773 "there shouldn't be any pending delayed exception spec checks");
10775 "there shouldn't be any pending delayed exception spec checks");
10777 "there shouldn't be any pending delayed defaulted member " 10778 "exception specs");
10780 "there shouldn't be any pending delayed DLL export classes");
10786 decltype(DelayedOverridingExceptionSpecChecks)
10787 SavedOverridingExceptionSpecChecks;
10788 decltype(DelayedEquivalentExceptionSpecChecks)
10789 SavedEquivalentExceptionSpecChecks;
10790 decltype(DelayedDefaultedMemberExceptionSpecs)
10791 SavedDefaultedMemberExceptionSpecs;
10792 decltype(DelayedDllExportClasses) SavedDllExportClasses;
10794 void swapSavedState() {
10795 SavedOverridingExceptionSpecChecks.swap(
10797 SavedEquivalentExceptionSpecChecks.swap(
10799 SavedDefaultedMemberExceptionSpecs.swap(
10807 struct MisalignedMember {
10813 MisalignedMember() : E(), RD(), MD(), Alignment() {}
10816 : E(E), RD(RD), MD(MD), Alignment(Alignment) {}
10817 explicit MisalignedMember(Expr *E)
10818 : MisalignedMember(E,
nullptr,
nullptr,
CharUnits()) {}
10820 bool operator==(
const MisalignedMember &m) {
return this->E == m.E; }
10834 void DiagnoseMisalignedMembers();
10841 void DiscardMisalignedMemberAddress(
const Type *T, Expr *E);
10846 void RefersToMemberWithReducedAlignment(
10855 bool Entered =
true;
10860 Decl *LambdaContextDecl =
nullptr,
10862 Sema::ExpressionEvaluationContextRecord::EK_Other,
10863 bool ShouldEnter =
true)
10864 : Actions(Actions), Entered(ShouldEnter) {
10873 Sema::ExpressionEvaluationContextRecord::EK_Other)
10874 : Actions(Actions) {
10876 NewContext, Sema::ReuseLambdaContextDecl, ExprContext);
10881 bool ShouldEnter =
true)
10882 : Actions(Actions), Entered(
false) {
10890 Sema::ExpressionEvaluationContext::UnevaluatedList);
10936 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)
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.
SmallVector< std::pair< const CXXMethodDecl *, const CXXMethodDecl * >, 2 > DelayedOverridingExceptionSpecChecks
All the overriding functions seen during a class definition that had their exception spec checks dela...
llvm::StringRef StackSlotLabel
SmallVector< Scope *, 2 > CurrentSEHFinally
Stack of active SEH __finally scopes. Can be empty.
void setCurrentOpenCLExtension(llvm::StringRef Ext)
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.
SmallVector< PragmaAttributeEntry, 2 > Entries
llvm::MapVector< const FunctionDecl *, std::unique_ptr< LateParsedTemplate > > LateParsedTemplateMapT
~SynthesizedFunctionScope()
MissingImportKind
Kinds of missing import.
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Declaration of a variable template.
TemplateParamListContext
The context in which we are checking a template parameter list.
Represent a C++ namespace.
Template argument deduction produced inconsistent deduced values for the given template parameter...
RedeclarationKind
Specifies whether (or how) name lookup is being performed for a redeclaration (vs.
static FunctionDeclAndLoc getEmptyKey()
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
LazyVector< const DeclaratorDecl *, ExternalSemaSource, &ExternalSemaSource::ReadUnusedFileScopedDecls, 2, 2 > UnusedFileScopedDeclsType
A container of type source information.
static const IdentifierInfo * getPrintable(const IdentifierInfo *II)
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
ExprResult ActOnFinishFullExpr(Expr *Expr, bool DiscardedValue)
RAII object used to temporarily allow the C++ 'this' expression to be used, with the given qualifiers...
llvm::MapVector< NamedDecl *, SourceLocation > UndefinedButUsed
UndefinedInternals - all the used, undefined objects which require a definition in this translation u...
The lookup found a single 'cooked' literal operator, which expects a normal literal to be built and p...
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)
SmallVector< std::pair< FunctionDecl *, FunctionDecl * >, 2 > DelayedEquivalentExceptionSpecChecks
All the function redeclarations seen during a class definition that had their exception spec checks d...
IncompatibleObjCWeakRef - Assigning a weak-unavailable object to an object with __weak qualifier...
Enumerator value with fixed underlying type.
Value of a non-type template parameter.
Represents a class type in Objective C.
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.
The iterator over UnresolvedSets.
Token - This structure provides full information about a lexed token.
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 ...
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.
CaseStmt - Represent a case statement.
NonTagKind
Common ways to introduce type names without a tag for use in diagnostics.
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
void popUndelayed(DelayedDiagnosticsState state)
Undo a previous pushUndelayed().
SourceLocation Loc
The location of the push attribute.
Represents a C++ nested-name-specifier or a global scope specifier.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Represents an Objective-C protocol declaration.
llvm::DenseMap< Decl *, SmallVector< PartialDiagnosticAt, 1 > > SuppressedDiagnosticsMap
For each declaration that involved template argument deduction, the set of diagnostics that were supp...
ArrayTypeTrait
Names for the array type traits.
const internal::VariadicDynCastAllOfMatcher< Stmt, CastExpr > castExpr
Matches any cast nodes of Clang's AST.
static bool checkAddressOfFunctionIsAvailable(Sema &S, const FunctionDecl *FD, bool Complain, bool InOverloadResolution, SourceLocation Loc)
Returns true if we can take the address of the function.
void incrementMSManglingNumber()
ObjCInterfaceDecl * NSNumberDecl
The declaration of the Objective-C NSNumber class.
const LangOptions & getLangOpts() const
QualType OriginalParamType
sema::AnalysisBasedWarnings AnalysisWarnings
Worker object for performing CFG-based warnings.
SmallVector< BoundNodes, 1 > match(MatcherT Matcher, const NodeT &Node, ASTContext &Context)
Returns the results of matching Matcher on Node.
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
This represents '#pragma omp requires...' directive.
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 ...
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...
llvm::SmallPtrSet< const Expr *, 8 > PossibleDerefs
Preprocessor & getPreprocessor() const
IdentifierInfo * Identifier
The identifier preceding the '::'.
bool RequireCompleteType(SourceLocation Loc, QualType T, unsigned DiagID, const Ts &...Args)
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
ObjCMethodDecl * ArrayWithObjectsMethod
The declaration of the arrayWithObjects:count: method.
const FunctionProtoType::ExtParameterInfo * getPointerOrNull(unsigned numParams)
Return a pointer (suitable for setting in an ExtProtoInfo) to the ExtParameterInfo array we've built ...
void addContextNote(SourceLocation UseLoc)
SmallVector< attr::SubjectMatchRule, 4 > MatchRules
After substituting deduced template arguments, a dependent parameter type did not match the correspon...
Represents a C++ conversion function within a class.
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.
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...
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) ...
We are computing the exception specification for a defaulted special member function.
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
Defines enumerations for expression traits intrinsics.
SourceLocation CurrentPragmaLocation
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
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)
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
const IdentifierInfo * Namespace
The namespace of this push group.
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.
if(!SameAsAllPredecessors) State -> printDOT(Out, N->getLocationContext())
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.
OpenMPAtomicDefaultMemOrderClauseKind
OpenMP attributes for 'atomic_default_mem_order' clause.
bool RequireLiteralType(SourceLocation Loc, QualType T, unsigned DiagID, const Ts &...Args)
Reads an AST files chain containing the contents of a translation unit.
Represents a field injected from an anonymous union/struct into the parent scope. ...
bool IsAllowedCUDACall(const FunctionDecl *Caller, const FunctionDecl *Callee)
Determines whether Caller may invoke Callee, based on their CUDA host/device attributes.
static NameClassification VarTemplate(TemplateName Name)
SourceLocation PointerEndLoc
The end location for the first pointer declarator in the file.
Interesting information about a specific parameter that can't simply be reflected in parameter's type...
LateInstantiatedAttribute(const Attr *A, LocalInstantiationScope *S, Decl *D)
A decomposition declaration.
ClassTemplateDecl * StdCoroutineTraitsCache
The C++ "std::coroutine_traits" template, which is defined in <coroutine_traits>
llvm::SmallSet< SourceLocation, 2 > SrcLocSet
A non-depnedent component of the parameter did not match the corresponding component of the argument...
bool GlobalNewDeleteDeclared
A flag to remember whether the implicit forms of operator new and delete have been declared...
The name of a declaration.
Represents the declaration of an Objective-C type parameter.
unsigned size() const
The number of exceptions in the exception specification.
SourceRange InstantiationRange
The source range that covers the construct that cause the instantiation, e.g., the template-id that c...
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.
SmallVector< PragmaAttributeGroup, 2 > PragmaAttributeStack
The template argument was specified in the code or was instantiated with some deduced template argume...
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
CheckTemplateArgumentKind
Specifies the context in which a particular template argument is being checked.
LocalInstantiationScope * Scope
IntToBlockPointer - The assignment converts an int to a block pointer.
Represents a C++ base or member initializer.
ExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc, tok::TokenKind Kind)
ActOnCXXBoolLiteral - Parse {true,false} literals.
const QualType * data() const
The set of exceptions in the exception specification.
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.
Holds information about the various types of exception specification.
OpenMPDefaultClauseKind
OpenMP attributes for 'default' clause.
ArrayRef< TemplateArgument > template_arguments() const
Deduction failed; that's all we know.
static NameClassification Unknown()
bool isUnevaluated() const
ObjCInterfaceDecl * NSArrayDecl
The declaration of the Objective-C NSArray class.
~ArgumentPackSubstitutionIndexRAII()
FPContractStateRAII(Sema &S)
SmallVector< BlockDecl *, 8 > ExprCleanupObjects
ExprCleanupObjects - This is the stack of objects requiring cleanup that are created by the current f...
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
static SourceRange getPrintable(SourceLocation L)
Represents a base class of a C++ class.
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...
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...
A push'd group of PragmaAttributeEntries.
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.
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 an attribute introduced 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