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/SmallPtrSet.h" 55 #include "llvm/ADT/SmallVector.h" 56 #include "llvm/ADT/TinyPtrVector.h" 64 template <
typename ValueT>
struct DenseMapInfo;
65 template <
typename ValueT,
typename ValueInfoT>
class DenseSet;
67 struct InlineAsmIdentifierInfo;
74 class ASTMutationListener;
84 class CXXBindTemporaryExpr;
86 class CXXConstructorDecl;
87 class CXXConversionDecl;
89 class CXXDestructorDecl;
90 class CXXFieldCollector;
91 class CXXMemberCallExpr;
97 class ClassTemplateDecl;
98 class ClassTemplatePartialSpecializationDecl;
99 class ClassTemplateSpecializationDecl;
100 class VarTemplatePartialSpecializationDecl;
101 class CodeCompleteConsumer;
102 class CodeCompletionAllocator;
103 class CodeCompletionTUInfo;
104 class CodeCompletionResult;
105 class CoroutineBodyStmt;
107 class DeclAccessPair;
110 class DeclaratorDecl;
111 class DeducedTemplateArgument;
112 class DependentDiagnostic;
113 class DesignatedInitExpr;
116 class EnumConstantDecl;
122 class FunctionProtoType;
123 class FunctionTemplateDecl;
124 class ImplicitConversionSequence;
127 class InitializationKind;
128 class InitializationSequence;
129 class InitializedEntity;
130 class IntegerLiteral;
134 class LocalInstantiationScope;
139 class MultiLevelTemplateArgumentList;
141 class ObjCCategoryDecl;
142 class ObjCCategoryImplDecl;
143 class ObjCCompatibleAliasDecl;
144 class ObjCContainerDecl;
146 class ObjCImplementationDecl;
147 class ObjCInterfaceDecl;
149 template <
class T>
class ObjCList;
150 class ObjCMessageExpr;
151 class ObjCMethodDecl;
152 class ObjCPropertyDecl;
153 class ObjCProtocolDecl;
154 class OMPThreadPrivateDecl;
155 class OMPDeclareReductionDecl;
156 class OMPDeclareSimdDecl;
158 struct OverloadCandidate;
159 class OverloadCandidateSet;
164 class PseudoDestructorTypeStorage;
165 class PseudoObjectExpr;
167 class StandardConversionSequence;
171 class TemplateArgument;
172 class TemplateArgumentList;
173 class TemplateArgumentLoc;
175 class TemplateParameterList;
176 class TemplatePartialOrderingContext;
177 class TemplateTemplateParmDecl;
181 class TypedefNameDecl;
183 class TypoCorrectionConsumer;
185 class UnresolvedLookupExpr;
186 class UnresolvedMemberExpr;
187 class UnresolvedSetImpl;
188 class UnresolvedSetIterator;
190 class UsingShadowDecl;
193 class VarTemplateSpecializationDecl;
194 class VisibilityAttr;
195 class VisibleDeclConsumer;
196 class IndirectFieldDecl;
197 struct DeductionFailureInfo;
198 class TemplateSpecCandidateSet;
201 class AccessedEntity;
202 class BlockScopeInfo;
203 class CapturedRegionScopeInfo;
204 class CapturingScopeInfo;
205 class CompoundScopeInfo;
206 class DelayedDiagnostic;
207 class DelayedDiagnosticPool;
208 class FunctionScopeInfo;
209 class LambdaScopeInfo;
210 class PossiblyUnreachableDiag;
211 class SemaPPCallbacks;
212 class TemplateDeductionInfo;
215 namespace threadSafety {
222 typedef std::pair<llvm::PointerUnion<const TemplateTypeParmType*, NamedDecl*>,
240 bool SawTypeNullability =
false;
247 llvm::DenseMap<FileID, FileNullability> Map;
258 if (file ==
Cache.File)
259 return Cache.Nullability;
262 if (!
Cache.File.isInvalid()) {
268 Cache.Nullability = Map[file];
269 return Cache.Nullability;
276 void operator=(
const Sema &) =
delete;
282 bool isMultiplexExternalSource;
284 static bool mightHaveNonExternalLinkage(
const DeclaratorDecl *FD);
291 bool shouldLinkPossiblyHiddenDecl(
const NamedDecl *Old,
299 "should not have found a non-externally-declarable previous decl");
385 PSK_Push_Set = PSK_Push | PSK_Set,
386 PSK_Pop_Set = PSK_Pop | PSK_Set,
389 template<
typename ValueType>
396 Slot(llvm::StringRef StackSlotLabel, ValueType Value,
398 : StackSlotLabel(StackSlotLabel), Value(Value),
399 PragmaLocation(PragmaLocation),
400 PragmaPushLocation(PragmaPushLocation) {}
404 llvm::StringRef StackSlotLabel,
422 assert((Action == PSK_Push || Action == PSK_Pop) &&
423 "Can only push / pop #pragma stack sentinels!");
424 Act(CurrentPragmaLocation, Action, Label, CurrentValue);
429 : DefaultValue(Default), CurrentValue(Default) {}
431 bool hasValue()
const {
return CurrentValue != DefaultValue; }
452 static const unsigned kMac68kAlignmentSentinel = ~0U;
540 &ExternalSemaSource::ReadExtVectorDecls, 2, 2>
584 &ExternalSemaSource::ReadTentativeDefinitions, 2, 2>
591 &ExternalSemaSource::ReadUnusedFileScopedDecls, 2, 2>
599 &ExternalSemaSource::ReadDelegatingConstructors, 2, 2>
623 std::unique_ptr<LateParsedTemplate>>
635 LateTemplateParserCleanupCB *LTPCleanup,
637 LateTemplateParser = LTP;
638 LateTemplateParserCleanup = LTPCleanup;
676 state.SavedPool = CurPool;
685 CurPool = state.SavedPool;
692 state.SavedPool = CurPool;
699 assert(CurPool ==
nullptr);
700 CurPool = state.SavedPool;
709 ProcessingContextState SavedContextState;
714 : S(S), SavedContext(S.CurContext),
716 SavedCXXThisTypeOverride(S.CXXThisTypeOverride)
718 assert(ContextToPush &&
"pushing null context");
725 if (!SavedContext)
return;
729 SavedContext =
nullptr;
742 bool PushedCodeSynthesisContext =
false;
746 : S(S), SavedContext(S, DC) {
749 Sema::ExpressionEvaluationContext::PotentiallyEvaluated);
750 if (
auto *FD = dyn_cast<FunctionDecl>(DC))
751 FD->setWillHaveBody(
true);
753 assert(isa<ObjCMethodDecl>(DC));
757 assert(!PushedCodeSynthesisContext);
760 Ctx.
Kind = Sema::CodeSynthesisContext::DefiningSynthesizedFunction;
765 PushedCodeSynthesisContext =
true;
769 if (PushedCodeSynthesisContext)
771 if (
auto *FD = dyn_cast<FunctionDecl>(S.
CurContext))
772 FD->setWillHaveBody(
false);
791 void LoadExternalWeakUndeclaredIdentifiers();
922 PotentiallyEvaluated,
932 PotentiallyEvaluatedIfUsed
982 unsigned NumCleanupObjects,
984 Decl *ManglingContextDecl,
986 : Context(Context), ParentCleanup(ParentCleanup),
987 IsDecltype(IsDecltype), NumCleanupObjects(NumCleanupObjects),
989 ManglingContextDecl(ManglingContextDecl), MangleNumbering() { }
996 return Context == ExpressionEvaluationContext::Unevaluated ||
997 Context == ExpressionEvaluationContext::UnevaluatedAbstract ||
998 Context == ExpressionEvaluationContext::UnevaluatedList;
1001 return Context == ExpressionEvaluationContext::ConstantEvaluated;
1017 Decl *&ManglingContextDecl);
1034 llvm::PointerIntPair<CXXMethodDecl*, 2> Pair;
1039 : Pair(MD, MD->isDeleted() ? NoMemberOrDeleted : Success) {}
1049 :
public llvm::FastFoldingSetNode,
1053 : FastFoldingSetNode(ID)
1079 typedef llvm::DenseMap<ParmVarDecl *, llvm::TinyPtrVector<ParmVarDecl *>>
1102 bool isExternalWithNoLinkageType(
ValueDecl *VD);
1105 void getUndefinedButUsed(
1110 const llvm::MapVector<FieldDecl *, DeleteLocs> &
1111 getMismatchingDeleteExpressions()
const;
1139 typedef llvm::PointerIntPair<CXXRecordDecl *, 3, CXXSpecialMember>
1158 void updateOutOfDateSelector(
Selector Sel);
1161 bool isSelfExpr(
Expr *RExpr);
1167 void EmitCurrentDiagnostic(
unsigned DiagID);
1181 void addImplicitTypedef(StringRef Name,
QualType T);
1210 void addExternalSource(ExternalSemaSource *E);
1212 void PrintStats()
const;
1241 if (!isActive())
return;
1260 template<
typename T>
1294 void emitAndClearUnusedLocalTypedefWarnings();
1296 void ActOnStartOfTranslationUnit();
1297 void ActOnEndOfTranslationUnit();
1299 void CheckDelegatingCtorCycles();
1303 void PushFunctionScope();
1310 void RecordParsingTemplateParameterDepth(
unsigned Depth);
1317 const Decl *D =
nullptr,
1321 return FunctionScopes.back();
1325 if (FunctionScopes.empty())
1328 for (
int e = FunctionScopes.size()-1; e >= 0; --e) {
1329 if (isa<sema::BlockScopeInfo>(FunctionScopes[e]))
1331 return FunctionScopes[e];
1336 template <
typename ExprT>
1338 if (!isUnevaluatedContext())
1339 getCurFunction()->recordUseOfWeak(E, IsRead);
1342 void PushCompoundScope();
1343 void PopCompoundScope();
1347 bool hasAnyUnrecoverableErrorsInThisFunction()
const;
1357 getCurLambda(
bool IgnoreNonLambdaCapturingScope =
false);
1383 Expr *ArraySize,
unsigned Quals,
1450 void UpdateExceptionSpec(FunctionDecl *FD,
1453 bool CheckDistantExceptionSpec(
QualType T);
1454 bool CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New);
1455 bool CheckEquivalentExceptionSpec(
1458 bool CheckEquivalentExceptionSpec(
1508 std::tuple<
const Ts &...> Args;
1512 llvm::index_sequence<Is...>)
const {
1514 bool Dummy[] = {
false, (DB << getPrintable(std::get<Is>(Args)))...};
1521 assert(DiagID != 0 &&
"no diagnostic for type diagnoser");
1526 emit(DB, llvm::index_sequence_for<Ts...>());
1535 struct ModuleScope {
1537 bool ModuleInterface =
false;
1544 Module *getCurrentModule()
const {
1545 return ModuleScopes.empty() ? nullptr : ModuleScopes.back().Module;
1556 void makeMergedDefinitionVisible(
NamedDecl *ND);
1562 return !D->
isHidden() || isVisibleSlow(D);
1569 return isVisible(D) || hasVisibleDeclarationSlow(D, Modules);
1571 bool hasVisibleDeclarationSlow(
const NamedDecl *D,
1574 bool hasVisibleMergedDefinition(
NamedDecl *Def);
1575 bool hasMergedDefinitionInCurrentModule(
NamedDecl *Def);
1579 bool hasStructuralCompatLayout(
Decl *D,
Decl *Suggested);
1584 bool OnlyNeedComplete =
false);
1587 return hasVisibleDefinition(const_cast<NamedDecl*>(D), &Hidden);
1598 bool hasVisibleExplicitSpecialization(
1603 bool hasVisibleMemberSpecialization(
1609 bool isEquivalentInternalLinkageDeclaration(
const NamedDecl *A,
1611 void diagnoseEquivalentInternalLinkageDeclarations(
1616 return !RequireCompleteTypeImpl(Loc, T,
nullptr);
1623 template <
typename... Ts>
1625 const Ts &...Args) {
1627 return RequireCompleteType(Loc, T, Diagnoser);
1630 void completeExprArrayBound(
Expr *E);
1632 bool RequireCompleteExprType(
Expr *E,
unsigned DiagID);
1634 template <
typename... Ts>
1637 return RequireCompleteExprType(E, Diagnoser);
1644 template <
typename... Ts>
1646 const Ts &...Args) {
1648 return RequireLiteralType(Loc, T, Diagnoser);
1658 bool AsUnevaluated =
true);
1677 DeclGroupPtrTy ConvertDeclToDeclGroup(
Decl *Ptr,
Decl *OwnedType =
nullptr);
1679 void DiagnoseUseOfUnimplementedSelectors();
1685 bool isClassName =
false,
bool HasTrailingDot =
false,
1687 bool IsCtorOrDtorName =
false,
1688 bool WantNontrivialTypeSourceInfo =
false,
1689 bool IsClassTemplateDeductionContext =
true,
1698 bool IsTemplateName =
false);
1706 bool IsTemplateTypeArg);
1751 Result.Template = Name;
1757 Result.Template = Name;
1763 Result.Template = Name;
1770 assert(Kind == NC_Type);
1775 assert(Kind == NC_Expression);
1780 assert(Kind == NC_TypeTemplate || Kind == NC_FunctionTemplate ||
1781 Kind == NC_VarTemplate);
1787 case NC_TypeTemplate:
1789 case NC_FunctionTemplate:
1791 case NC_VarTemplate:
1794 llvm_unreachable(
"unsupported name classification.");
1826 bool IsAddressOfOperand,
1827 std::unique_ptr<CorrectionCandidateCallback> CCC =
nullptr);
1835 TemplateTemplateParam,
1846 if (
auto *DRE = dyn_cast<DeclRefExpr>(E.
get()))
1847 return !DRE->hasExplicitTemplateArgs();
1848 if (
auto *ME = dyn_cast<MemberExpr>(E.
get()))
1849 return !ME->hasExplicitTemplateArgs();
1868 diagnoseIgnoredQualifiers(
unsigned DiagID,
unsigned Quals,
1876 static bool adjustContextForLocalExternDecl(
DeclContext *&DC);
1877 void DiagnoseFunctionSpecifiers(
const DeclSpec &DS);
1878 NamedDecl *getShadowedDeclaration(
const TypedefNameDecl *D,
1883 void CheckShadow(
Scope *S, VarDecl *D);
1894 llvm::DenseMap<const NamedDecl *, const NamedDecl *> ShadowingDecls;
1898 void handleTagNumbering(
const TagDecl *Tag,
Scope *TagScope);
1899 void setTagNameForLinkagePurposes(
TagDecl *TagFromDeclSpec,
1900 TypedefNameDecl *NewTD);
1901 void CheckTypedefForVariablyModifiedType(
Scope *S, TypedefNameDecl *D);
1917 bool CheckVariableDeclaration(VarDecl *NewVD,
LookupResult &Previous);
1918 void CheckVariableDeclarationType(VarDecl *NewVD);
1919 bool DeduceVariableDeclarationType(VarDecl *VDecl,
bool DirectInit,
1921 void CheckCompleteVariableDeclaration(VarDecl *VD);
1923 void MaybeSuggestAddingStaticToDecl(
const FunctionDecl *D);
1932 bool CheckConstexprFunctionDecl(
const FunctionDecl *FD);
1933 bool CheckConstexprFunctionBody(
const FunctionDecl *FD,
Stmt *Body);
1941 bool CheckFunctionDeclaration(
Scope *S,
1943 bool IsMemberSpecialization);
1944 bool shouldLinkDependentDeclWithPrevious(
Decl *D,
Decl *OldDecl);
1945 void CheckMain(FunctionDecl *FD,
const DeclSpec &D);
1946 void CheckMSVCRTEntryPoint(FunctionDecl *FD);
1955 void ActOnParamDefaultArgument(
Decl *param,
1958 void ActOnParamUnparsedDefaultArgument(
Decl *param,
1965 void AddInitializerToDecl(
Decl *dcl,
Expr *init,
bool DirectInit);
1966 void ActOnUninitializedDecl(
Decl *dcl);
1967 void ActOnInitializerError(
Decl *Dcl);
1970 void ActOnCXXForRangeDecl(
Decl *D);
1977 void FinalizeDeclaration(
Decl *D);
1978 DeclGroupPtrTy FinalizeDeclaratorGroup(
Scope *S,
const DeclSpec &DS,
1984 void ActOnDocumentableDecl(
Decl *D);
1989 void CheckForFunctionRedefinition(
1990 FunctionDecl *FD,
const FunctionDecl *EffectiveDefinition =
nullptr,
1997 void ActOnStartOfObjCMethodDef(
Scope *S,
Decl *D);
1999 return D && isa<ObjCMethodDecl>(D);
2010 bool canDelayFunctionBody(
const Declarator &D);
2019 bool canSkipFunctionBody(
Decl *D);
2023 Decl *ActOnFinishFunctionBody(Decl *Decl,
Stmt *Body,
bool IsInstantiation);
2024 Decl *ActOnSkippedFunctionBody(Decl *Decl);
2025 void ActOnFinishInlineFunctionDef(FunctionDecl *D);
2029 void ActOnFinishDelayedAttribute(Scope *S, Decl *D,
ParsedAttributes &Attrs);
2042 void DiagnoseInvalidJumps(
Stmt *Body);
2043 Decl *ActOnFileScopeAsmDecl(
Expr *
expr,
2048 Decl *ActOnEmptyDeclaration(Scope *S,
2090 void createImplicitModuleImportForErrorRecovery(
SourceLocation Loc,
2099 ExplicitSpecialization,
2100 PartialSpecialization
2113 Decl *ActOnFinishExportDecl(Scope *S, Decl *
ExportDecl,
2129 return getPrintingPolicy(Context, PP);
2138 void ActOnTranslationUnitScope(Scope *S);
2144 bool IsExplicitInstantiation,
2147 Decl *BuildAnonymousStructOrUnion(Scope *S,
DeclSpec &DS,
2152 Decl *BuildMicrosoftCAnonymousStruct(Scope *S,
DeclSpec &DS,
2173 bool isAcceptableTagRedeclaration(
const TagDecl *Previous,
2185 Decl *ActOnTag(Scope *S,
unsigned TagSpec,
TagUseKind TUK,
2191 bool ScopedEnumUsesClassTag,
TypeResult UnderlyingType,
2192 bool IsTypeSpecifier,
bool IsTemplateParamOrArg,
2195 Decl *ActOnTemplatedFriendTag(Scope *S,
SourceLocation FriendLoc,
2230 bool Mutable,
Expr *BitfieldWidth,
2236 bool CheckNontrivialField(
FieldDecl *FD);
2239 bool Diagnose =
false);
2256 void ActOnTagStartDefinition(Scope *S, Decl *
TagDecl);
2261 bool ActOnDuplicateDefinition(
DeclSpec &DS, Decl *Prev,
2267 SkippedDefinitionContext ActOnTagStartSkippedDefinition(Scope *S, Decl *TD);
2269 Decl *ActOnObjCContainerStartDefinition(Decl *IDecl);
2274 void ActOnStartCXXMemberDeclarations(Scope *S, Decl *
TagDecl,
2276 bool IsFinalSpelledSealed,
2281 void ActOnTagFinishDefinition(Scope *S, Decl *
TagDecl,
2284 void ActOnTagFinishSkippedDefinition(SkippedDefinitionContext Context);
2286 void ActOnObjCContainerFinishDefinition();
2292 void ActOnObjCTemporaryExitContainerContext(
DeclContext *DC);
2293 void ActOnObjCReenterContainerContext(
DeclContext *DC);
2297 void ActOnTagDefinitionError(Scope *S, Decl *
TagDecl);
2305 bool CheckEnumRedeclaration(
SourceLocation EnumLoc,
bool IsScoped,
2307 bool EnumUnderlyingIsImplicit,
2315 Decl *ActOnEnumConstant(Scope *S, Decl *
EnumDecl, Decl *LastEnumConstant,
2328 void PopDeclContext();
2332 void EnterDeclaratorContext(Scope *S,
DeclContext *DC);
2333 void ExitDeclaratorContext(Scope *S);
2336 void ActOnReenterFunctionContext(Scope* S, Decl* D);
2337 void ActOnExitFunctionContext();
2344 FunctionDecl *getCurFunctionDecl();
2354 NamedDecl *getCurFunctionOrMethodDecl();
2357 void PushOnScopeChains(
NamedDecl *D, Scope *S,
bool AddToContext =
true);
2375 bool AllowInlineNamespace =
false);
2379 static Scope *getScopeForDeclContext(Scope *S,
DeclContext *DC);
2384 bool isIncompatibleTypedef(
TypeDecl *Old, TypedefNameDecl *New);
2413 unsigned AttrSpellingListIndex);
2414 TypeVisibilityAttr *mergeTypeVisibilityAttr(Decl *D,
SourceRange Range,
2415 TypeVisibilityAttr::VisibilityType Vis,
2416 unsigned AttrSpellingListIndex);
2418 VisibilityAttr::VisibilityType Vis,
2419 unsigned AttrSpellingListIndex);
2420 UuidAttr *mergeUuidAttr(Decl *D,
SourceRange Range,
2421 unsigned AttrSpellingListIndex, StringRef Uuid);
2422 DLLImportAttr *mergeDLLImportAttr(Decl *D,
SourceRange Range,
2423 unsigned AttrSpellingListIndex);
2424 DLLExportAttr *mergeDLLExportAttr(Decl *D,
SourceRange Range,
2425 unsigned AttrSpellingListIndex);
2427 mergeMSInheritanceAttr(Decl *D,
SourceRange Range,
bool BestCase,
2428 unsigned AttrSpellingListIndex,
2429 MSInheritanceAttr::Spelling SemanticSpelling);
2430 FormatAttr *mergeFormatAttr(Decl *D,
SourceRange Range,
2432 int FirstArg,
unsigned AttrSpellingListIndex);
2433 SectionAttr *mergeSectionAttr(Decl *D,
SourceRange Range, StringRef Name,
2434 unsigned AttrSpellingListIndex);
2435 AlwaysInlineAttr *mergeAlwaysInlineAttr(Decl *D,
SourceRange Range,
2437 unsigned AttrSpellingListIndex);
2438 MinSizeAttr *mergeMinSizeAttr(Decl *D,
SourceRange Range,
2439 unsigned AttrSpellingListIndex);
2440 OptimizeNoneAttr *mergeOptimizeNoneAttr(Decl *D,
SourceRange Range,
2441 unsigned AttrSpellingListIndex);
2442 InternalLinkageAttr *mergeInternalLinkageAttr(Decl *D,
SourceRange Range,
2444 unsigned AttrSpellingListIndex);
2446 unsigned AttrSpellingListIndex);
2448 void mergeDeclAttributes(
NamedDecl *New, Decl *Old,
2450 void MergeTypedefNameDecl(Scope *S, TypedefNameDecl *New,
2452 bool MergeFunctionDecl(FunctionDecl *New,
NamedDecl *&Old, Scope *S,
2453 bool MergeTypeWithOld);
2454 bool MergeCompatibleFunctionDecls(FunctionDecl *New, FunctionDecl *Old,
2455 Scope *S,
bool MergeTypeWithOld);
2457 void MergeVarDecl(VarDecl *New,
LookupResult &Previous);
2458 void MergeVarDeclTypes(VarDecl *New, VarDecl *Old,
bool MergeTypeWithOld);
2459 void MergeVarDeclExceptionSpecs(VarDecl *New, VarDecl *Old);
2460 bool checkVarDeclRedefinition(VarDecl *OldDefn, VarDecl *NewDefn);
2462 bool MergeCXXFunctionDecl(FunctionDecl *New, FunctionDecl *Old, Scope *S);
2474 AA_Passing_CFAudited
2495 bool IsForUsingDecl);
2496 bool IsOverload(FunctionDecl *New, FunctionDecl *Old,
bool IsForUsingDecl,
2497 bool ConsiderCudaAttrs =
true);
2504 bool isFunctionConsideredUnavailable(FunctionDecl *FD);
2508 bool SuppressUserConversions,
2510 bool InOverloadResolution,
2512 bool AllowObjCWritebackConversion);
2518 bool InOverloadResolution,
2519 QualType& ConvertedType,
bool &IncompatibleObjC);
2521 QualType& ConvertedType,
bool &IncompatibleObjC);
2528 unsigned *ArgPos =
nullptr);
2534 bool CheckPointerConversion(
Expr *From,
QualType ToType,
2536 CXXCastPath& BasePath,
2537 bool IgnoreBaseAccess,
2538 bool Diagnose =
true);
2540 bool InOverloadResolution,
2542 bool CheckMemberPointerConversion(
Expr *From,
QualType ToType,
2544 CXXCastPath &BasePath,
2545 bool IgnoreBaseAccess);
2547 bool CStyle,
bool &ObjCLifetimeConversion);
2550 bool DiagnoseMultipleUserDefinedConversion(
Expr *From,
QualType ToType);
2554 const VarDecl *NRVOCandidate,
2557 bool AllowNRVO =
true);
2564 bool TopLevelOfInitList =
false,
2565 bool AllowExplicit =
false);
2595 bool SuppressConversion =
false)
2596 : Suppress(Suppress), SuppressConversion(SuppressConversion) {}
2638 bool AllowScopedEnumerations;
2642 bool Suppress,
bool SuppressConversion)
2644 AllowScopedEnumerations(AllowScopedEnumerations) {}
2651 return diagnoseNotInt(S, Loc, T);
2661 ExprResult PerformContextualImplicitConversion(
2695 void AddOverloadCandidate(FunctionDecl *Function,
2699 bool SuppressUserConversions =
false,
2700 bool PartialOverloading =
false,
2701 bool AllowExplicit =
false,
2702 ConversionSequenceList EarlyConversions = None);
2707 bool SuppressUserConversions =
false,
2708 bool PartialOverloading =
false,
2709 bool FirstArgumentIsBase =
false);
2715 bool SuppressUserConversion =
false);
2722 bool SuppressUserConversions =
false,
2723 bool PartialOverloading =
false,
2724 ConversionSequenceList EarlyConversions = None);
2733 bool SuppressUserConversions =
false,
2734 bool PartialOverloading =
false);
2740 bool SuppressUserConversions =
false,
2741 bool PartialOverloading =
false);
2746 ConversionSequenceList &Conversions,
2747 bool SuppressUserConversions,
2751 ObjectClassification = {});
2757 bool AllowObjCConversionOnExplicit,
2758 bool AllowResultConversion =
true);
2764 bool AllowObjCConversionOnExplicit,
2765 bool AllowResultConversion =
true);
2778 bool IsAssignmentOperator =
false,
2779 unsigned NumContextualBoolArguments = 0);
2788 bool PartialOverloading =
false);
2791 void NoteOverloadCandidate(
NamedDecl *Found, FunctionDecl *Fn,
2793 bool TakingAddress =
false);
2798 bool TakingAddress =
false);
2803 bool MissingImplicitThis =
false);
2810 std::pair<Expr *, std::string>
2811 findFailedBooleanCondition(
Expr *Cond,
bool AllowTopLevelCond);
2820 bool diagnoseArgDependentDiagnoseIfAttrs(
const FunctionDecl *Function,
2821 const Expr *ThisArg,
2832 bool diagnoseArgIndependentDiagnoseIfAttrs(
const NamedDecl *ND,
2840 bool Complain =
false,
2852 ResolveAddressOfOverloadedFunction(
Expr *AddressOfExpr,
2856 bool *pHadMultipleCandidates =
nullptr);
2859 resolveAddressOfOnlyViableOverloadCandidate(
Expr *E,
2862 bool resolveAndFixAddressOfOnlyViableOverloadCandidate(
2863 ExprResult &SrcExpr,
bool DoFunctionPointerConversion =
false);
2866 ResolveSingleFunctionTemplateSpecialization(
OverloadExpr *ovl,
2867 bool Complain =
false,
2870 bool ResolveAndFixSingleFunctionTemplateSpecialization(
2872 bool DoFunctionPointerConverion =
false,
2873 bool Complain =
false,
2876 unsigned DiagIDForComplaining = 0);
2879 Expr *FixOverloadedFunctionReference(
Expr *E,
2889 bool PartialOverloading =
false);
2896 FRS_DiagnosticIssued
2912 bool AllowTypoCorrection=
true,
2913 bool CalleesAddressIsTaken=
false);
2923 Expr *input,
bool RequiresADL =
true);
2929 bool RequiresADL =
true);
2936 BuildCallToMemberFunction(Scope *S,
Expr *MemExpr,
2947 bool *NoArrowOperatorFound =
nullptr);
2957 bool CheckParameterNames);
2958 void CheckCXXDefaultArguments(FunctionDecl *FD);
2959 void CheckExtraCXXDefaultArguments(
Declarator &D);
2960 Scope *getNonFieldDeclScope(Scope *S);
2994 LookupOrdinaryName = 0,
3042 NotForRedeclaration = 0,
3049 ForExternalRedeclaration
3057 if (cast<Decl>(CurContext)
3058 ->getOwningModuleForLinkage(
true))
3059 return ForVisibleRedeclaration;
3060 return ForExternalRedeclaration;
3094 typedef std::function<ExprResult(Sema &, TypoExpr *, TypoCorrection)>
3100 struct TypoExprState {
3101 std::unique_ptr<TypoCorrectionConsumer> Consumer;
3102 TypoDiagnosticGenerator DiagHandler;
3105 TypoExprState(TypoExprState &&other) noexcept;
3106 TypoExprState &operator=(TypoExprState &&other) noexcept;
3110 llvm::MapVector<TypoExpr *, TypoExprState> DelayedTypos;
3113 TypoExpr *createDelayedTypo(std::unique_ptr<TypoCorrectionConsumer> TCC,
3114 TypoDiagnosticGenerator TDG,
3121 llvm::MapVector<NamespaceDecl*, bool> KnownNamespaces;
3125 bool LoadedExternalKnownNamespaces;
3130 std::unique_ptr<TypoCorrectionConsumer>
3134 std::unique_ptr<CorrectionCandidateCallback> CCC,
3137 bool ErrorRecovery);
3140 const TypoExprState &getTypoExprState(
TypoExpr *TE)
const;
3143 void clearDelayedTypo(
TypoExpr *TE);
3154 = NotForRedeclaration);
3156 bool AllowBuiltinCreation =
false);
3158 bool InUnqualifiedLookup =
false);
3162 bool AllowBuiltinCreation =
false,
3163 bool EnteringContext =
false);
3166 = NotForRedeclaration);
3177 CXXConstructorDecl *LookupDefaultConstructor(
CXXRecordDecl *Class);
3178 CXXConstructorDecl *LookupCopyingConstructor(
CXXRecordDecl *Class,
3181 bool RValueThis,
unsigned ThisQuals);
3182 CXXConstructorDecl *LookupMovingConstructor(
CXXRecordDecl *Class,
3185 bool RValueThis,
unsigned ThisQuals);
3193 bool AllowStringTemplate,
3194 bool DiagnoseMissing);
3195 bool isKnownName(StringRef name);
3202 bool IncludeGlobalScope =
true);
3205 bool IncludeGlobalScope =
true,
3206 bool IncludeDependentBases =
false);
3216 std::unique_ptr<CorrectionCandidateCallback> CCC,
3219 bool EnteringContext =
false,
3221 bool RecordFailure =
true);
3226 std::unique_ptr<CorrectionCandidateCallback> CCC,
3227 TypoDiagnosticGenerator TDG,
3230 bool EnteringContext =
false,
3248 CorrectDelayedTyposInExpr(
Expr *E, VarDecl *InitDecl =
nullptr,
3255 return CorrectDelayedTyposInExpr(E,
nullptr, Filter);
3262 return ER.
isInvalid() ? ER : CorrectDelayedTyposInExpr(ER.
get(), Filter);
3268 return CorrectDelayedTyposInExpr(ER,
nullptr, Filter);
3273 bool ErrorRecovery =
true);
3278 bool ErrorRecovery =
true);
3280 void MarkTypoCorrectedFunctionDefinition(
const NamedDecl *F);
3282 void FindAssociatedClassesAndNamespaces(
SourceLocation InstantiationLoc,
3284 AssociatedNamespaceSet &AssociatedNamespaces,
3285 AssociatedClassSet &AssociatedClasses);
3288 bool ConsiderLinkage,
bool AllowInlineNamespace);
3299 Scope *S,
bool ForRedeclaration,
3303 void AddKnownFunctionAttributes(FunctionDecl *FD);
3307 void ProcessPragmaWeak(Scope *S, Decl *D);
3309 void ProcessDeclAttributes(Scope *S, Decl *D,
const Declarator &PD);
3311 void ProcessDeclAttributeDelayed(Decl *D,
const AttributeList *AttrList);
3312 void ProcessDeclAttributeList(Scope *S, Decl *D,
const AttributeList *AL,
3313 bool IncludeCXX11Attributes =
true);
3323 bool isValidPointerAttrType(
QualType T,
bool RefOkay =
false);
3325 bool CheckRegparmAttr(
const AttributeList &attr,
unsigned &value);
3327 const FunctionDecl *FD =
nullptr);
3331 unsigned ArgNum, StringRef &Str,
3335 bool checkMSInheritanceAttrOnDefinition(
3337 MSInheritanceAttr::Spelling SemanticSpelling);
3339 void CheckAlignasUnderalignment(Decl *D);
3344 void adjustMemberFunctionCC(
QualType &T,
bool IsStatic,
bool IsCtorOrDtor,
3350 bool hasExplicitCallingConv(
QualType &T);
3377 bool isContextSensitive,
3378 bool allowArrayTypes);
3386 bool IsProtocolMethodDecl);
3390 bool IsProtocolMethodDecl);
3396 bool IsProtocolMethodDecl);
3408 void ImplMethodsVsClassMethods(Scope *S,
ObjCImplDecl* IMPDecl,
3410 bool IncompleteImpl =
false);
3414 void DiagnoseUnimplementedProperties(Scope *S,
ObjCImplDecl* IMPDecl,
3416 bool SynthesizeProperties);
3419 void diagnoseNullResettableSynthesizedSetters(
const ObjCImplDecl *impDecl);
3423 void DefaultSynthesizeProperties(Scope *S,
ObjCImplDecl *IMPDecl,
3426 void DefaultSynthesizeProperties(Scope *S, Decl *D,
SourceLocation AtEnd);
3436 void DiagnoseUnusedBackingIvarInAccessor(Scope *S,
3455 const bool isReadWrite,
3456 unsigned &Attributes,
3457 const unsigned AttributesAsWritten,
3473 const bool isReadWrite,
3474 const unsigned Attributes,
3475 const unsigned AttributesAsWritten,
3484 void AtomicPropertySetterGetterRules(
ObjCImplDecl* IMPDecl,
3489 void DiagnoseMissingDesignatedInitOverrides(
3508 void MatchAllMethodDeclarations(
const SelectorSet &InsMap,
3509 const SelectorSet &ClsMap,
3510 SelectorSet &InsMapSeen,
3511 SelectorSet &ClsMapSeen,
3514 bool &IncompleteImpl,
3515 bool ImmediateClass,
3516 bool WarnCategoryMethodImpl=
false);
3529 void AddMethodToGlobalPool(
ObjCMethodDecl *Method,
bool impl,
bool instance);
3534 bool receiverIdOrClass,
3544 CollectMultipleMethodsInGlobalPool(
Selector Sel,
3546 bool InstanceFirst,
bool CheckTheOther,
3557 bool receiverIdOrClass);
3569 bool RecordFailure =
true) {
3571 TypoCorrectionFailures[Typo].insert(TypoLoc);
3581 AddMethodToGlobalPool(Method, impl,
true);
3586 AddMethodToGlobalPool(Method, impl,
false);
3591 void AddAnyMethodToGlobalPool(Decl *D);
3596 bool receiverIdOrClass=
false) {
3597 return LookupMethodInGlobalPool(Sel, R, receiverIdOrClass,
3604 bool receiverIdOrClass=
false) {
3605 return LookupMethodInGlobalPool(Sel, R, receiverIdOrClass,
3652 return FullExprArg(ActOnFinishFullExpr(Arg, CC).
get());
3665 bool HasLeadingEmptyMacro =
false);
3667 void ActOnStartOfCompoundStmt();
3668 void ActOnFinishOfCompoundStmt();
3680 S.ActOnFinishOfCompoundStmt();
3699 StmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
3702 void ActOnForEachDeclStmt(DeclGroupPtrTy Decl);
3707 void ActOnCaseStmtBody(Stmt *
CaseStmt, Stmt *SubStmt);
3711 Stmt *SubStmt, Scope *CurScope);
3732 Stmt *Switch, Stmt *Body);
3749 Stmt *First,
Expr *collection,
3751 StmtResult FinishObjCForCollectionStmt(Stmt *ForCollection, Stmt *Body);
3773 Stmt *RangeDecl, Stmt *
Begin, Stmt *
End,
3778 StmtResult FinishCXXForRangeStmt(Stmt *ForRange, Stmt *Body);
3789 void ActOnCapturedRegionStart(
SourceLocation Loc, Scope *CurScope,
3792 void ActOnCapturedRegionStart(
SourceLocation Loc, Scope *CurScope,
3796 void ActOnCapturedRegionError();
3799 unsigned NumParams);
3800 VarDecl *getCopyElisionCandidate(
QualType ReturnType,
Expr *E,
3801 bool AllowParamOrMoveConstructible);
3802 bool isCopyElisionCandidate(
QualType ReturnType,
const VarDecl *VD,
3803 bool AllowParamOrMoveConstructible);
3811 bool IsVolatile,
unsigned NumOutputs,
3817 void FillInlineAsmIdentifierInfo(
Expr *Res,
3818 llvm::InlineAsmIdentifierInfo &Info);
3822 bool IsUnevaluatedContext);
3823 bool LookupInlineAsmField(StringRef
Base, StringRef Member,
3825 ExprResult LookupInlineAsmVarDeclField(
Expr *RefExpr, StringRef Member,
3829 StringRef AsmString,
3830 unsigned NumOutputs,
unsigned NumInputs,
3835 LabelDecl *GetOrCreateMSAsmLabel(StringRef ExternalLabelName,
3842 bool Invalid =
false);
3844 Decl *ActOnObjCExceptionDecl(Scope *S,
Declarator &D);
3847 Decl *Parm, Stmt *Body);
3865 VarDecl *BuildExceptionDeclaration(Scope *S,
TypeSourceInfo *TInfo,
3870 Decl *ActOnExceptionDeclarator(Scope *S,
Declarator &D);
3873 Decl *ExDecl, Stmt *HandlerBlock);
3883 void ActOnStartSEHFinallyBlock();
3884 void ActOnAbortSEHFinallyBlock();
3888 void DiagnoseReturnInConstructorExceptionHandler(
CXXTryStmt *TryBlock);
3890 bool ShouldWarnIfUnusedFileScopedDecl(
const DeclaratorDecl *D)
const;
3894 void MarkUnusedFileScopedDecl(
const DeclaratorDecl *D);
3898 void DiagnoseUnusedExprResult(
const Stmt *S);
3899 void DiagnoseUnusedNestedTypedefs(
const RecordDecl *D);
3900 void DiagnoseUnusedDecl(
const NamedDecl *ND);
3914 void DiagnoseEmptyLoopBody(
const Stmt *S,
3915 const Stmt *PossibleBody);
3918 void DiagnoseSelfMove(
const Expr *LHSExpr,
const Expr *RHSExpr,
3923 void diagnoseNullableToNonnullConversion(
QualType DstType,
QualType SrcType,
3932 void PopParsingDeclaration(ParsingDeclState
state, Decl *
decl);
3946 bool ObjCPropertyAccess,
3947 bool AvoidPartialAvailabilityChecks =
false);
3950 UnavailableAttr::ImplicitReason reason);
3953 void DiagnoseUnguardedAvailabilityViolations(Decl *FD);
3958 bool CanUseDecl(
NamedDecl *D,
bool TreatUnavailableAsInvalid);
3961 bool ObjCPropertyAccess =
false,
3962 bool AvoidPartialAvailabilityChecks =
false);
3963 void NoteDeletedFunction(FunctionDecl *FD);
3964 void NoteDeletedInheritingConstructor(CXXConstructorDecl *CD);
3965 std::string getDeletedOrUnavailableSuffix(
const FunctionDecl *FD);
3973 Decl *LambdaContextDecl =
nullptr,
3974 bool IsDecltype =
false);
3978 bool IsDecltype =
false);
3979 void PopExpressionEvaluationContext();
3981 void DiscardCleanupsInEvaluationContext();
4000 void MarkAnyDeclReferenced(
SourceLocation Loc, Decl *D,
bool MightBeOdrUse);
4001 void MarkFunctionReferenced(
SourceLocation Loc, FunctionDecl *Func,
4002 bool MightBeOdrUse =
true);
4007 void UpdateMarkingForLValueToRValue(
Expr *E);
4008 void CleanupVarDeclMarking();
4051 const unsigned *
const FunctionScopeIndexToStopAt);
4069 void MarkDeclarationsReferencedInExpr(
Expr *E,
4070 bool SkipLocalVariables =
false);
4076 bool ForceComplain =
false,
4077 bool (*IsPlausibleResult)(
QualType) =
nullptr);
4080 bool tryExprAsCall(
Expr &E,
QualType &ZeroArgCallReturnTy,
4090 bool DiagRuntimeBehavior(
SourceLocation Loc,
const Stmt *Statement,
4098 UnqualifiedId &Id,
bool HasTrailingLParen,
bool IsAddressOfOperand,
4099 std::unique_ptr<CorrectionCandidateCallback> CCC =
nullptr,
4100 bool IsInlineAsmIdentifier =
false,
Token *KeywordReplacement =
nullptr);
4109 std::unique_ptr<CorrectionCandidateCallback> CCC,
4115 bool AllowBuiltinCreation=
false);
4120 bool isAddressOfOperand,
4134 BuildAnonymousStructUnionMemberReference(
4139 Expr *baseObjectExpr =
nullptr,
4151 bool IsDefiniteInstance,
4153 bool UseArgumentDependentLookup(
const CXXScopeSpec &SS,
4155 bool HasTrailingLParen);
4160 bool IsAddressOfOperand,
const Scope *S,
4171 bool AcceptInvalidDecl =
false);
4176 bool AcceptInvalidDecl =
false);
4193 Scope *UDLScope =
nullptr);
4202 Scope *UDLScope =
nullptr);
4207 Expr *ControllingExpr,
4213 Expr *ControllingExpr,
4236 bool IsType,
void *TyOrEx,
4240 bool CheckVecStepExpr(
Expr *E);
4246 ExprResult ActOnSizeofParameterPackExpr(Scope *S,
4288 bool SuppressQualifierCheck =
false,
4299 bool CheckQualifiedMemberReference(
Expr *BaseExpr,
QualType BaseType,
4319 void ActOnDefaultCtorInitializers(Decl *CDtorDecl);
4321 FunctionDecl *FDecl,
4325 bool ExecConfig =
false);
4328 const Expr *ArgExpr);
4335 Expr *ExecConfig =
nullptr,
4336 bool IsExecConfig =
false);
4341 Expr *Config =
nullptr,
4342 bool IsExecConfig =
false);
4362 ExprResult MaybeConvertParenListExprToParenExpr(Scope *S,
Expr *ME);
4406 void ActOnStartStmtExpr();
4409 void ActOnStmtExprError();
4447 bool CheckCaseExpression(
Expr *E);
4466 CheckMicrosoftIfExistsSymbol(Scope *S,
CXXScopeSpec &SS,
4470 CheckMicrosoftIfExistsSymbol(Scope *S,
SourceLocation KeywordLoc,
4550 bool isInitListConstructor(
const FunctionDecl *Ctor);
4552 Decl *ActOnUsingDirective(Scope *CurScope,
4562 Decl *ActOnNamespaceAliasDef(Scope *CurScope,
4579 bool HasTypenameKeyword,
4591 bool HasTypenameKeyword,
4597 bool IsInstantiation);
4601 bool CheckInheritingConstructorUsingDecl(
UsingDecl *UD);
4606 CXXConstructorDecl *
4607 findInheritingConstructor(
SourceLocation Loc, CXXConstructorDecl *BaseCtor,
4610 Decl *ActOnUsingDeclaration(Scope *CurScope,
4618 Decl *ActOnAliasDeclaration(Scope *CurScope,
4625 Decl *DeclFromDeclSpec);
4635 bool HadMultipleCandidates,
bool IsListInitialization,
4636 bool IsStdInitListInitialization,
4637 bool RequiresZeroInit,
unsigned ConstructKind,
4644 CXXConstructorDecl *Constructor,
bool Elidable,
4646 bool HadMultipleCandidates,
bool IsListInitialization,
4647 bool IsStdInitListInitialization,
4648 bool RequiresZeroInit,
unsigned ConstructKind,
4656 CXXConstructorDecl *Constructor,
bool Elidable,
4658 bool IsListInitialization,
4659 bool IsStdInitListInitialization,
bool RequiresZeroInit,
4667 bool CheckCXXDefaultArgExpr(
SourceLocation CallLoc, FunctionDecl *FD,
4678 void FinalizeVarWithDestructor(VarDecl *VD,
const RecordType *DeclInitType);
4692 llvm::SmallPtrSet<CanQualType, 4> ExceptionsSeen;
4695 void ClearExceptions() {
4696 ExceptionsSeen.clear();
4710 "noexcept(expr) should not be a possible result");
4715 unsigned size()
const {
return Exceptions.size(); }
4724 void CalledExpr(
Expr *E);
4730 ESI.
Type = getExceptionSpecType();
4739 tok::kw_false).
get();
4761 ComputeDefaultedCopyAssignmentExceptionSpec(
CXXMethodDecl *MD);
4771 ComputeDefaultedMoveAssignmentExceptionSpec(
CXXMethodDecl *MD);
4782 CXXConstructorDecl *CD);
4790 void checkExceptionSpecification(
bool IsTopLevel,
4800 bool isLibstdcxxEagerExceptionSpecHack(
const Declarator &D);
4805 void actOnDelayedExceptionSpecification(Decl *Method,
4810 Expr *NoexceptExpr);
4818 bool Diagnose =
false);
4826 CXXConstructorDecl *DeclareImplicitDefaultConstructor(
4831 void DefineImplicitDefaultConstructor(
SourceLocation CurrentLocation,
4832 CXXConstructorDecl *Constructor);
4851 void AdjustDestructorExceptionSpec(
CXXRecordDecl *ClassDecl,
4856 CXXConstructorDecl *Constructor);
4864 CXXConstructorDecl *DeclareImplicitCopyConstructor(
CXXRecordDecl *ClassDecl);
4868 void DefineImplicitCopyConstructor(
SourceLocation CurrentLocation,
4869 CXXConstructorDecl *Constructor);
4878 CXXConstructorDecl *DeclareImplicitMoveConstructor(
CXXRecordDecl *ClassDecl);
4882 void DefineImplicitMoveConstructor(
SourceLocation CurrentLocation,
4883 CXXConstructorDecl *Constructor);
4894 void DefineImplicitCopyAssignment(
SourceLocation CurrentLocation,
4907 void DefineImplicitMoveAssignment(
SourceLocation CurrentLocation,
4912 void ForceDeclarationOfImplicitMembers(
CXXRecordDecl *Class);
4915 void CheckImplicitSpecialMemberDeclaration(Scope *S, FunctionDecl *FD);
4919 bool isImplicitlyDeleted(FunctionDecl *FD);
4925 bool checkThisInStaticMemberFunctionType(
CXXMethodDecl *Method);
4929 bool checkThisInStaticMemberFunctionExceptionSpec(
CXXMethodDecl *Method);
4935 bool checkThisInStaticMemberFunctionAttributes(
CXXMethodDecl *Method);
4942 bool CompleteConstructorCall(CXXConstructorDecl *Constructor,
4946 bool AllowExplicit =
false,
4947 bool IsListInitialization =
false);
4957 bool EnteringContext);
5051 bool Enabled =
true);
5071 bool CheckCXXThisCapture(
SourceLocation Loc,
bool Explicit =
false,
5072 bool BuildAndDiagnose =
true,
5073 const unsigned *
const FunctionScopeIndexToStopAt =
nullptr,
5074 bool ByCopy =
false);
5079 bool isThisOutsideMemberFunctionBody(
QualType BaseType);
5098 bool IsThrownVarInScope);
5136 bool UseGlobal,
QualType AllocType,
bool IsArray,
5138 FunctionDecl *&OperatorNew,
5139 FunctionDecl *&OperatorDelete);
5140 void DeclareGlobalNewDelete();
5146 bool Diagnose =
true);
5147 FunctionDecl *FindUsualDeallocationFunction(
SourceLocation StartLoc,
5148 bool CanProvideSize,
5151 FunctionDecl *FindDeallocationFunctionForDestructor(
SourceLocation StartLoc,
5156 bool UseGlobal,
bool ArrayForm,
5159 bool IsDelete,
bool CallCanBeVirtual,
5160 bool WarnOnNonAbstractTypes,
5202 ExprResult ActOnStartCXXMemberReference(Scope *S,
5207 bool &MayBePseudoDestructor);
5236 Expr *MaybeCreateExprWithCleanups(
Expr *SubExpr);
5237 Stmt *MaybeCreateStmtWithCleanups(Stmt *SubStmt);
5241 CreateMaterializeTemporaryExpr(
QualType T,
Expr *Temporary,
5242 bool BoundToLvalueReference);
5245 return ActOnFinishFullExpr(Expr, Expr ? Expr->
getExprLoc()
5249 bool DiscardedValue =
false,
5250 bool IsConstexpr =
false,
5251 bool IsLambdaInitCaptureInitializer =
false);
5259 bool EnteringContext =
false);
5260 bool isDependentScopeSpecifier(
const CXXScopeSpec &SS);
5286 bool isAcceptableNestedNameSpecifier(
const NamedDecl *SD,
5287 bool *CanCorrect =
nullptr);
5309 : ObjectType(ObjectType), Identifier(II), IdentifierLoc(IdLoc),
5310 CCLoc(ColonColonLoc) {
5315 : ObjectType(
ParsedType::make(ObjectType)), Identifier(II),
5316 IdentifierLoc(IdLoc), CCLoc(ColonColonLoc) {
5320 bool isNonTypeNestedNameSpecifier(Scope *S,
CXXScopeSpec &SS,
5323 bool BuildCXXNestedNameSpecifier(Scope *S,
5325 bool EnteringContext,
5328 bool ErrorRecoveryLookup,
5329 bool *IsCorrectedToColon =
nullptr,
5330 bool OnlyNamespace =
false);
5357 bool ActOnCXXNestedNameSpecifier(Scope *S,
5359 bool EnteringContext,
5361 bool ErrorRecoveryLookup =
false,
5362 bool *IsCorrectedToColon =
nullptr,
5363 bool OnlyNamespace =
false);
5367 bool ActOnCXXNestedNameSpecifierDecltype(
CXXScopeSpec &SS,
5371 bool IsInvalidUnlessNestedName(Scope *S,
CXXScopeSpec &SS,
5373 bool EnteringContext);
5398 bool ActOnCXXNestedNameSpecifier(Scope *S,
5401 TemplateTy TemplateName,
5407 bool EnteringContext);
5417 void *SaveNestedNameSpecifierAnnotation(
CXXScopeSpec &SS);
5429 void RestoreNestedNameSpecifierAnnotation(
void *Annotation,
5433 bool ShouldEnterDeclaratorScope(Scope *S,
const CXXScopeSpec &SS);
5441 bool ActOnCXXEnterDeclaratorScope(Scope *S,
CXXScopeSpec &SS);
5448 void ActOnCXXExitDeclaratorScope(Scope *S,
const CXXScopeSpec &SS);
5455 void ActOnCXXEnterDeclInitializer(Scope *S, Decl *Dcl);
5459 void ActOnCXXExitDeclInitializer(Scope *S, Decl *Dcl);
5464 bool KnownDependent,
5473 bool IsConstexprSpecified);
5481 bool ExplicitParams,
5482 bool ExplicitResultType,
5491 return ParsedType::make(buildLambdaInitCaptureInitialization(
5492 Loc, ByRef, Id, InitKind != LambdaCaptureInitKind::CopyInit, Init));
5496 bool DirectInit, Expr *&Init);
5506 unsigned InitStyle, Expr *Init);
5516 void addLambdaParameters(
CXXMethodDecl *CallOperator, Scope *CurScope);
5532 bool IsInstantiation =
false);
5562 void DefineImplicitLambdaToFunctionPointerConversion(
5572 void DefineImplicitLambdaToBlockPointerConversion(
SourceLocation CurrentLoc,
5614 bool HadMultipleCandidates);
5628 bool WarnMultipleSelectors);
5641 Decl *ActOnStartLinkageSpecification(Scope *S,
5645 Decl *ActOnFinishLinkageSpecification(Scope *S,
5668 void ActOnStartCXXInClassMemberInitializer();
5669 void ActOnFinishCXXInClassMemberInitializer(Decl *VarDecl,
5719 bool SetDelegatingInitializer(CXXConstructorDecl *Constructor,
5722 bool SetCtorInitializers(CXXConstructorDecl *Constructor,
bool AnyErrors,
5737 typedef std::pair<CXXRecordDecl*, SourceLocation>
VTableUse;
5750 void LoadExternalVTableUses();
5755 bool DefinitionRequired =
false);
5772 bool DefineUsedVTables();
5774 void AddImplicitlyDeclaredMembersToClass(
CXXRecordDecl *ClassDecl);
5776 void ActOnMemInitializers(Decl *ConstructorDecl,
5786 void referenceDLLExportedClassMethods();
5788 void propagateDLLAttrToBaseClassTemplate(
5794 void ActOnFinishCXXMemberSpecification(Scope* S,
SourceLocation RLoc,
5799 void ActOnFinishCXXMemberDecls();
5800 void ActOnFinishCXXNonNestedClass(Decl *D);
5802 void ActOnReenterCXXMethodParameter(Scope *S,
ParmVarDecl *Param);
5803 unsigned ActOnReenterTemplateScope(Scope *S, Decl *Template);
5804 void ActOnStartDelayedMemberDeclarations(Scope *S, Decl *Record);
5805 void ActOnStartDelayedCXXMethodDeclaration(Scope *S, Decl *Method);
5806 void ActOnDelayedCXXMethodParameter(Scope *S, Decl *Param);
5807 void ActOnFinishDelayedMemberDeclarations(Scope *S, Decl *Record);
5808 void ActOnFinishDelayedCXXMethodDeclaration(Scope *S, Decl *Method);
5809 void ActOnFinishDelayedMemberInitializers(Decl *Record);
5810 void MarkAsLateParsedTemplate(FunctionDecl *FD, Decl *FnD,
5812 void UnmarkAsLateParsedTemplate(FunctionDecl *FD);
5813 bool IsInsideALocalClassWithinATemplateFunction();
5815 Decl *ActOnStaticAssertDeclaration(
SourceLocation StaticAssertLoc,
5817 Expr *AssertMessageExpr,
5819 Decl *BuildStaticAssertDeclaration(
SourceLocation StaticAssertLoc,
5828 Decl *ActOnFriendTypeDecl(Scope *S,
const DeclSpec &DS,
5835 void CheckConstructor(CXXConstructorDecl *Constructor);
5846 void CheckExplicitlyDefaultedSpecialMember(
CXXMethodDecl *MD);
5847 void CheckExplicitlyDefaultedMemberExceptionSpec(
CXXMethodDecl *MD,
5849 void CheckDelayedMemberExceptionSpecs();
5862 BaseResult ActOnBaseSpecifier(Decl *classdecl,
5872 void ActOnBaseSpecifiers(Decl *ClassDecl,
5884 CXXCastPath *BasePath =
nullptr,
5885 bool IgnoreAccess =
false);
5887 unsigned InaccessibleBaseID,
5888 unsigned AmbigiousBaseConvID,
5891 CXXCastPath *BasePath,
5892 bool IgnoreAccess =
false);
5894 std::string getAmbiguousPathsDisplayString(
CXXBasePaths &Paths);
5896 bool CheckOverridingFunctionAttributes(
const CXXMethodDecl *New,
5901 bool CheckOverridingFunctionReturnType(
const CXXMethodDecl *New,
5906 bool CheckOverridingFunctionExceptionSpec(
const CXXMethodDecl *New,
5912 void CheckOverrideControl(
NamedDecl *D);
5916 void DiagnoseAbsenceOfOverrideControl(
NamedDecl *D);
5921 bool CheckIfOverriddenFunctionIsMarkedFinal(
const CXXMethodDecl *New,
5936 bool SetMemberAccessSpecifier(
NamedDecl *MemberDecl,
5948 bool Diagnose =
true);
5950 CXXConstructorDecl *D,
5953 bool IsCopyBindingRefToTemp =
false);
5955 CXXConstructorDecl *D,
5977 bool ForceCheck =
false,
5978 bool ForceUnprivileged =
false);
5981 bool isSpecialMemberAccessibleForDeletion(
CXXMethodDecl *decl,
5987 void PerformDependentDiagnostics(
const DeclContext *Pattern,
6010 template <
typename... Ts>
6012 const Ts &...Args) {
6014 return RequireNonAbstractType(Loc, T, Diagnoser);
6023 bool CheckOverloadedOperatorDeclaration(FunctionDecl *FnDecl);
6025 bool CheckLiteralOperatorDeclaration(FunctionDecl *FnDecl);
6031 bool AllowFunctionTemplates =
true);
6033 bool AllowFunctionTemplates =
true);
6036 QualType ObjectType,
bool EnteringContext,
6037 bool &MemberOfUnknownSpecialization);
6041 bool hasTemplateKeyword,
6044 bool EnteringContext,
6045 TemplateTy &Template,
6046 bool &MemberOfUnknownSpecialization);
6058 TemplateTy &SuggestedTemplate,
6061 bool DiagnoseUninstantiableTemplate(
SourceLocation PointOfInstantiation,
6063 bool InstantiatedFromMember,
6067 bool Complain =
true);
6069 void DiagnoseTemplateParameterShadow(
SourceLocation Loc, Decl *PrevDecl);
6072 NamedDecl *ActOnTypeParameter(Scope *S,
bool Typename,
6077 unsigned Depth,
unsigned Position,
6090 NamedDecl *ActOnTemplateTemplateParameter(Scope *S,
6102 ActOnTemplateParameterList(
unsigned Depth,
6108 Expr *RequiresClause);
6119 TPC_TypeAliasTemplate
6129 bool IsFriend,
bool &IsMemberSpecialization,
bool &Invalid);
6139 unsigned NumOuterTemplateParamLists,
6150 void NoteAllFoundTemplates(TemplateName Name);
6152 QualType CheckTemplateIdType(TemplateName Template,
6163 bool IsCtorOrDtorName =
false,
6164 bool IsClassName =
false);
6173 TemplateTy TemplateD,
6209 TemplateTy &Template,
bool AllowInjectedClassName =
false);
6212 ActOnClassTemplateSpecialization(Scope *S,
unsigned TagSpec,
TagUseKind TUK,
6222 unsigned NumExplicitArgs,
6224 void CheckTemplatePartialSpecialization(
6226 void CheckTemplatePartialSpecialization(
6229 Decl *ActOnTemplateDeclarator(Scope *S,
6241 bool CheckDependentFunctionTemplateSpecialization(FunctionDecl *FD,
6245 bool CheckFunctionTemplateSpecialization(FunctionDecl *FD,
6252 ActOnExplicitInstantiation(Scope *S,
6258 TemplateTy Template,
6266 ActOnExplicitInstantiation(Scope *S,
6276 DeclResult ActOnExplicitInstantiation(Scope *S,
6282 SubstDefaultTemplateArgumentIfAvailable(
TemplateDecl *Template,
6288 bool &HasDefaultArg);
6303 CTAK_DeducedFromArrayBound
6306 bool CheckTemplateArgument(
NamedDecl *Param,
6311 unsigned ArgumentPackIndex,
6343 bool PartialTemplateArgs,
6345 bool UpdateArgsWithConversions =
true);
6354 QualType InstantiatedParamType, Expr *Arg,
6359 unsigned ArgumentPackIndex);
6400 TPL_TemplateTemplateArgumentMatch
6443 TemplateTy TemplateName,
6459 bool RebuildNestedNameSpecifierInCurrentInstantiation(
CXXScopeSpec &SS);
6461 ExprResult RebuildExprInCurrentInstantiation(Expr *E);
6462 bool RebuildTemplateParamsInCurrentInstantiation(
6480 bool isUnexpandedParameterPackPermitted();
6489 UPPC_Expression = 0,
6582 bool DiagnoseUnexpandedParameterPack(Expr *E,
6592 bool DiagnoseUnexpandedParameterPack(
const CXXScopeSpec &SS,
6615 TemplateName Template,
6766 bool &RetainExpansion,
6794 bool containsUnexpandedParameterPacks(
Declarator &D);
6826 bool AdjustExceptionSpec =
false);
6883 TDK_CUDATargetMismatch
6907 unsigned ArgIdx,
QualType OriginalArgType)
6908 : OriginalParamType(OriginalParamType),
6909 DecomposedParam(DecomposedParam), ArgIdx(ArgIdx),
6910 OriginalArgType(OriginalArgType) {}
6921 unsigned NumExplicitlySpecified, FunctionDecl *&Specialization,
6924 bool PartialOverloading =
false,
6925 llvm::function_ref<
bool()> CheckNonDependent = []{
return false; });
6931 bool PartialOverloading,
6938 FunctionDecl *&Specialization,
6940 bool IsAddressOfFunction =
false);
6951 FunctionDecl *&Specialization,
6953 bool IsAddressOfFunction =
false);
6968 DAR_FailedAlreadyDiagnosed
6977 void DiagnoseAutoDeductionFailure(VarDecl *VDecl, Expr *Init);
6979 bool Diagnose =
true);
6983 void DeclareImplicitDeductionGuides(
TemplateDecl *Template,
6986 QualType DeduceTemplateSpecializationFromInitializer(
6995 TypeLoc getReturnTypeLoc(FunctionDecl *FD)
const;
6997 bool DeduceFunctionTypeFromReturnExpr(FunctionDecl *FD,
7005 unsigned NumCallArguments1,
7006 unsigned NumCallArguments2);
7017 getMoreSpecializedPartialSpecialization(
7032 bool isTemplateTemplateParameterAtLeastAsSpecializedAs(
7038 llvm::SmallBitVector &
Used);
7041 llvm::SmallBitVector &Deduced) {
7042 return MarkDeducedTemplateParameters(Context, FunctionTemplate, Deduced);
7044 static void MarkDeducedTemplateParameters(
ASTContext &Ctx,
7046 llvm::SmallBitVector &Deduced);
7053 getTemplateInstantiationArgs(
NamedDecl *D,
7055 bool RelativeToPrimary =
false,
7056 const FunctionDecl *Pattern =
nullptr);
7141 assert(Kind != DeclaringSpecialMember);
7142 return {TemplateArgs, NumTemplateArgs};
7155 : Kind(TemplateInstantiation), Entity(nullptr), Template(nullptr),
7156 TemplateArgs(nullptr), NumTemplateArgs(0), DeductionInfo(nullptr) {}
7160 bool isInstantiationRecord()
const;
7216 unsigned LastEmittedCodeSynthesisContextDepth = 0;
7232 int OldSubstitutionIndex;
7236 : Self(Self), OldSubstitutionIndex(Self.ArgumentPackSubstitutionIndex) {
7245 friend class ArgumentPackSubstitutionRAII;
7252 typedef llvm::DenseMap<Decl *, SmallVector<PartialDiagnosticAt, 1> >
7372 bool AlreadyInstantiating;
7373 bool CheckInstantiationDepth(
SourceLocation PointOfInstantiation,
7379 Decl *Entity,
NamedDecl *Template =
nullptr,
7390 void popCodeSynthesisContext();
7394 return CodeSynthesisContexts.size() > NonInstantiationEntries;
7398 if (!CodeSynthesisContexts.empty() &&
7399 CodeSynthesisContexts.size() != LastEmittedCodeSynthesisContextDepth) {
7400 PrintInstantiationStack();
7401 LastEmittedCodeSynthesisContextDepth = CodeSynthesisContexts.size();
7403 if (PragmaAttributeCurrentTargetDecl)
7404 PrintPragmaAttributeInstantiationPoint();
7406 void PrintInstantiationStack();
7408 void PrintPragmaAttributeInstantiationPoint();
7423 assert(!ExprEvalContexts.empty() &&
7424 "Must be in an expression evaluation context");
7425 return ExprEvalContexts.back().isUnevaluated();
7433 unsigned PrevSFINAEErrors;
7434 bool PrevInNonInstantiationSFINAEContext;
7435 bool PrevAccessCheckingSFINAE;
7436 bool PrevLastDiagnosticIgnored;
7440 : SemaRef(SemaRef), PrevSFINAEErrors(SemaRef.NumSFINAEErrors),
7441 PrevInNonInstantiationSFINAEContext(
7442 SemaRef.InNonInstantiationSFINAEContext),
7443 PrevAccessCheckingSFINAE(SemaRef.AccessCheckingSFINAE),
7444 PrevLastDiagnosticIgnored(
7445 SemaRef.getDiagnostics().isLastDiagnosticIgnored())
7455 = PrevInNonInstantiationSFINAEContext;
7458 PrevLastDiagnosticIgnored);
7475 bool PrevDisableTypoCorrection;
7478 : SemaRef(SemaRef), Trap(SemaRef,
true),
7479 PrevDisableTypoCorrection(SemaRef.DisableTypoCorrection) {
7527 : S(S), Enabled(Enabled) {
7528 if (!Enabled)
return;
7536 S.DefineUsedVTables();
7537 S.PerformPendingInstantiations();
7542 if (!Enabled)
return;
7545 assert(S.VTableUses.empty() &&
7546 "VTableUses should be empty before it is discarded.");
7547 S.VTableUses.swap(SavedVTableUses);
7550 assert(S.PendingInstantiations.empty() &&
7551 "PendingInstantiations should be empty before it is discarded.");
7552 S.PendingInstantiations.swap(SavedPendingInstantiations);
7558 std::deque<PendingImplicitInstantiation> SavedPendingInstantiations;
7574 SavedPendingLocalImplicitInstantiations.swap(
7578 void perform() { S.PerformPendingInstantiations(
true); }
7581 assert(S.PendingLocalImplicitInstantiations.empty() &&
7582 "there shouldn't be any pending local implicit instantiations");
7583 SavedPendingLocalImplicitInstantiations.swap(
7584 S.PendingLocalImplicitInstantiations);
7589 std::deque<PendingImplicitInstantiation>
7590 SavedPendingLocalImplicitInstantiations;
7596 bool HasInteresting =
false;
7602 assert(Infos.size() <= index);
7603 Infos.resize(index);
7604 Infos.push_back(info);
7606 if (!HasInteresting)
7614 if (!HasInteresting)
return nullptr;
7615 Infos.resize(numParams);
7616 return Infos.data();
7620 void PerformPendingInstantiations(
bool LocalOnly =
false);
7625 bool AllowDeducedTST =
false);
7640 unsigned ThisTypeQuals);
7649 int indexAdjustment,
7651 bool ExpectParameterPack);
7686 bool CXXDirectInit);
7698 bool Complain =
true);
7705 bool InstantiateInClassInitializer(
7716 : TmplAttr(A), Scope(S), NewDecl(D)
7722 const Decl *Pattern, Decl *Inst,
7723 LateInstantiatedAttrVec *LateAttrs =
nullptr,
7728 const Decl *Pattern, Decl *Inst,
7729 LateInstantiatedAttrVec *LateAttrs =
nullptr,
7732 bool usesPartialOrExplicitSpecialization(
7736 InstantiateClassTemplateSpecialization(
SourceLocation PointOfInstantiation,
7739 bool Complain =
true);
7741 void InstantiateClassMembers(
SourceLocation PointOfInstantiation,
7746 void InstantiateClassTemplateSpecializationMembers(
7766 void InstantiateExceptionSpec(
SourceLocation PointOfInstantiation,
7767 FunctionDecl *Function);
7771 void InstantiateFunctionDefinition(
SourceLocation PointOfInstantiation,
7772 FunctionDecl *Function,
7773 bool Recursive =
false,
7774 bool DefinitionRequired =
false,
7775 bool AtEndOfTU =
false);
7782 LateInstantiatedAttrVec *LateAttrs =
nullptr,
7788 BuildVariableInstantiation(VarDecl *NewVar, VarDecl *OldVar,
7790 LateInstantiatedAttrVec *LateAttrs,
7793 bool InstantiatingVarTemplate =
false);
7794 void InstantiateVariableInitializer(
7795 VarDecl *Var, VarDecl *OldVar,
7797 void InstantiateVariableDefinition(
SourceLocation PointOfInstantiation,
7798 VarDecl *Var,
bool Recursive =
false,
7799 bool DefinitionRequired =
false,
7800 bool AtEndOfTU =
false);
7802 void InstantiateMemInitializers(CXXConstructorDecl *New,
7803 const CXXConstructorDecl *Tmpl,
7808 bool FindingInstantiatedContext =
false);
7820 OCK_CategoryImplementation
7838 Decl *ActOnStartClassInterface(Scope *S,
7847 Decl *
const *ProtoRefs,
7848 unsigned NumProtoRefs,
7853 void ActOnSuperClassOfClassInterface(Scope *S,
7868 Decl *ActOnCompatibilityAlias(
7873 bool CheckForwardProtocolDeclarationForCircularDependency(
7878 Decl *ActOnStartProtocolInterface(
7881 Decl *
const *ProtoRefNames,
unsigned NumProtoRefs,
7892 Decl *
const *ProtoRefs,
7893 unsigned NumProtoRefs,
7898 Decl *ActOnStartClassImplementation(
7904 Decl *ActOnStartCategoryImplementation(
SourceLocation AtCatImplLoc,
7910 DeclGroupPtrTy ActOnFinishObjCImplementation(Decl *ObjCImpDecl,
7919 DeclGroupPtrTy ActOnForwardProtocolDeclaration(
SourceLocation AtProtoclLoc,
7923 void FindProtocolDeclaration(
bool WarnOnDeclarations,
bool ForObjCContainer,
7931 bool SelectProtocolFirst =
false);
7936 void actOnObjCTypeArgsOrProtocolQualifiers(
7949 bool warnOnIncompleteProtocols);
7960 TypeResult actOnObjCTypeArgsAndProtocolQualifiers(
7978 bool FailOnError =
false);
7990 bool FailOnError =
false);
7999 void CheckObjCPropertyAttributes(Decl *PropertyPtrTy,
8001 unsigned &Attributes,
8002 bool propertyInPrimaryClass);
8013 bool OverridingProtocolProperty);
8029 Decl *ActOnPropertyImplDecl(Scope *S,
8044 OSMK_NonRetainingInit
8059 Decl *ActOnMethodDeclaration(
8071 bool isVariadic,
bool MethodDefinition);
8080 bool inferObjCARCLifetime(
ValueDecl *decl);
8115 bool HasTrailingDot,
8134 bool isImplicit =
false);
8137 bool isSuperReceiver,
8151 ExprResult BuildInstanceMessage(Expr *Receiver,
8160 bool isImplicit =
false);
8162 ExprResult BuildInstanceMessageImplicit(Expr *Receiver,
8203 TypedefNameDecl *&TDNDecl,
8204 bool CfToNs,
bool Diagnose =
true);
8208 Expr *&SrcExpr,
bool Diagnose =
true);
8210 bool ConversionToObjCStringLiteralCheck(
QualType DstType, Expr *&SrcExpr,
8211 bool Diagnose =
true);
8251 StringRef SlotLabel, Expr *Alignment);
8254 NonDefaultStateAtInclude,
8260 void DiagnoseUnterminatedPragmaPack();
8273 void ActOnPragmaMSPointersToMembers(
8280 MSVtorDispAttr::Mode Value);
8289 bool UnifySection(StringRef SectionName,
8291 DeclaratorDecl *TheDecl);
8292 bool UnifySection(StringRef SectionName,
8299 llvm::StringRef StackSlotLabel,
8301 llvm::StringRef PragmaName);
8315 void ActOnPragmaDetectMismatch(
SourceLocation Loc, StringRef Name,
8319 void ActOnPragmaUnused(
const Token &Identifier,
8358 void AddAlignmentAttributesForRecord(
RecordDecl *RD);
8361 void AddMsStructLayoutForRecord(
RecordDecl *RD);
8364 void FreePackedContext();
8368 void PushNamespaceVisibilityAttr(
const VisibilityAttr *Attr,
8373 void AddPushedVisibilityAttribute(Decl *RD);
8377 void PopPragmaVisibility(
bool IsNamespaceEnd,
SourceLocation EndLoc);
8380 void FreeVisContext();
8385 void AddCFAuditedAttribute(Decl *D);
8397 void AddPragmaAttributes(Scope *S, Decl *D);
8399 void DiagnoseUnterminatedPragmaAttribute();
8407 return OptimizeOffPragmaLocation;
8413 void AddRangeBasedOptnone(FunctionDecl *FD);
8418 void AddOptnoneAttributeIfNoConflicts(FunctionDecl *FD,
SourceLocation Loc);
8421 void AddAlignedAttr(
SourceRange AttrRange, Decl *D, Expr *E,
8422 unsigned SpellingListIndex,
bool IsPackExpansion);
8424 unsigned SpellingListIndex,
bool IsPackExpansion);
8428 void AddAssumeAlignedAttr(
SourceRange AttrRange, Decl *D, Expr *E, Expr *OE,
8429 unsigned SpellingListIndex);
8433 void AddAllocAlignAttr(
SourceRange AttrRange, Decl *D, Expr *ParamExpr,
8434 unsigned SpellingListIndex);
8438 void AddAlignValueAttr(
SourceRange AttrRange, Decl *D, Expr *E,
8439 unsigned SpellingListIndex);
8443 void AddLaunchBoundsAttr(
SourceRange AttrRange, Decl *D, Expr *MaxThreads,
8444 Expr *MinBlocks,
unsigned SpellingListIndex);
8448 unsigned SpellingListIndex,
bool InInstantiation =
false);
8450 void AddParameterABIAttr(
SourceRange AttrRange, Decl *D,
8453 void AddNSConsumedAttr(
SourceRange AttrRange, Decl *D,
8454 unsigned SpellingListIndex,
bool isNSConsumed,
8469 bool IsImplicit =
false);
8474 bool IsImplicit =
false);
8477 void CheckCompletedCoroutineBody(FunctionDecl *FD, Stmt *&Body);
8483 std::string CurrOpenCLExtension;
8485 llvm::DenseMap<const Type*, std::set<std::string>> OpenCLTypeExtMap;
8487 llvm::DenseMap<const Decl*, std::set<std::string>> OpenCLDeclExtMap;
8490 return CurrOpenCLExtension;
8493 CurrOpenCLExtension = Ext;
8499 void setOpenCLExtensionForType(
QualType T, llvm::StringRef Exts);
8505 void setOpenCLExtensionForDecl(Decl *FD, llvm::StringRef Exts);
8510 void setCurrentOpenCLExtensionForType(
QualType T);
8515 void setCurrentOpenCLExtensionForDecl(Decl *FD);
8517 bool isOpenCLDisabledDecl(Decl *FD);
8529 bool checkOpenCLDisabledDecl(
const NamedDecl &D,
const Expr &E);
8535 void *VarDataSharingAttributesStack;
8537 bool IsInOpenMPDeclareTargetContext =
false;
8539 void InitDataSharingAttributesStack();
8540 void DestroyDataSharingAttributesStack();
8543 bool StrictlyPositive =
true);
8545 unsigned getOpenMPNestingLevel()
const;
8548 void adjustOpenMPTargetScopeIndex(
unsigned &FunctionScopesIndex,
8549 unsigned Level)
const;
8552 void pushOpenMPFunctionRegion();
8567 template <
typename T,
typename DiagLocT,
typename DiagInfoT,
typename MapT>
8568 bool checkOpenCLDisabledTypeOrDecl(T D, DiagLocT DiagLoc, DiagInfoT DiagInfo,
8577 bool IsOpenMPCapturedByRef(
ValueDecl *D,
unsigned Level);
8582 VarDecl *IsOpenMPCapturedDecl(
ValueDecl *D);
8589 bool isOpenMPPrivateDecl(
ValueDecl *D,
unsigned Level);
8599 bool isOpenMPTargetCapturedDecl(
ValueDecl *D,
unsigned Level);
8610 void EndOpenMPClause();
8612 void EndOpenMPDSABlock(Stmt *CurDirective);
8618 void ActOnOpenMPLoopInitialization(
SourceLocation ForLoc, Stmt *Init);
8623 ExprResult ActOnOpenMPIdExpression(Scope *CurScope,
8627 DeclGroupPtrTy ActOnOpenMPThreadprivateDirective(
8639 DeclGroupPtrTy ActOnOpenMPDeclareReductionDirectiveStart(
8641 ArrayRef<std::pair<QualType, SourceLocation>> ReductionTypes,
8644 void ActOnOpenMPDeclareReductionCombinerStart(Scope *S, Decl *D);
8646 void ActOnOpenMPDeclareReductionCombinerEnd(Decl *D, Expr *Combiner);
8649 VarDecl *ActOnOpenMPDeclareReductionInitializerStart(Scope *S, Decl *D);
8651 void ActOnOpenMPDeclareReductionInitializerEnd(Decl *D, Expr *Initializer,
8652 VarDecl *OmpPrivParm);
8654 DeclGroupPtrTy ActOnOpenMPDeclareReductionDirectiveEnd(
8655 Scope *S, DeclGroupPtrTy DeclReductions,
bool IsValid);
8660 void ActOnFinishOpenMPDeclareTargetDirective();
8662 void ActOnOpenMPDeclareTargetName(Scope *CurScope,
CXXScopeSpec &ScopeSpec,
8664 OMPDeclareTargetDeclAttr::MapTypeTy MT,
8665 NamedDeclSetType &SameDirectiveDecls);
8667 void checkDeclIsAllowedInOpenMPTarget(Expr *E, Decl *D,
8671 return IsInOpenMPDeclareTargetContext;
8674 bool isInOpenMPTargetExecutionDirective()
const;
8678 return !getLangOpts().OpenMPIsDevice || isInOpenMPDeclareTargetContext() ||
8679 isInOpenMPTargetExecutionDirective();
8709 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8715 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8721 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8751 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8754 StmtResult ActOnOpenMPParallelForSimdDirective(
8757 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8826 StmtResult ActOnOpenMPTargetParallelForDirective(
8829 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8850 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8856 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8862 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8870 StmtResult ActOnOpenMPDistributeParallelForDirective(
8873 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8876 StmtResult ActOnOpenMPDistributeParallelForSimdDirective(
8879 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8882 StmtResult ActOnOpenMPDistributeSimdDirective(
8885 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8888 StmtResult ActOnOpenMPTargetParallelForSimdDirective(
8891 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8897 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8900 StmtResult ActOnOpenMPTeamsDistributeDirective(
8903 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8906 StmtResult ActOnOpenMPTeamsDistributeSimdDirective(
8909 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8912 StmtResult ActOnOpenMPTeamsDistributeParallelForSimdDirective(
8915 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8918 StmtResult ActOnOpenMPTeamsDistributeParallelForDirective(
8921 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8930 StmtResult ActOnOpenMPTargetTeamsDistributeDirective(
8933 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8936 StmtResult ActOnOpenMPTargetTeamsDistributeParallelForDirective(
8939 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8942 StmtResult ActOnOpenMPTargetTeamsDistributeParallelForSimdDirective(
8945 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8948 StmtResult ActOnOpenMPTargetTeamsDistributeSimdDirective(
8951 llvm::DenseMap<ValueDecl *, Expr *> &VarsWithImplicitDSA);
8963 DeclGroupPtrTy ActOnOpenMPDeclareSimdDirective(
8964 DeclGroupPtrTy DG, OMPDeclareSimdDeclAttr::BranchStateTy BS,
8986 OMPClause *ActOnOpenMPNumThreadsClause(Expr *NumThreads,
8991 OMPClause *ActOnOpenMPSafelenClause(Expr *Length,
9000 OMPClause *ActOnOpenMPCollapseClause(Expr *NumForLoops,
9008 Expr *NumForLoops =
nullptr);
9041 OMPClause *ActOnOpenMPSingleExprWithArgClause(
9126 OMPClause *ActOnOpenMPTaskReductionClause(
9133 OMPClause *ActOnOpenMPInReductionClause(
9189 OMPClause *ActOnOpenMPThreadLimitClause(Expr *ThreadLimit,
9198 OMPClause *ActOnOpenMPDistScheduleClause(
9245 const CXXCastPath *BasePath =
nullptr,
9247 = CCK_ImplicitConversion);
9264 ExprResult CallExprUnaryConversions(Expr *E);
9268 ExprResult DefaultFunctionArrayConversion(Expr *E,
bool Diagnose =
true);
9273 ExprResult DefaultFunctionArrayLvalueConversion(Expr *E,
9274 bool Diagnose =
true);
9285 ExprResult DefaultArgumentPromotion(Expr *E);
9290 ExprResult TemporaryMaterializationConversion(Expr *E);
9298 VariadicDoesNotApply
9323 bool hasCStrMethod(
const Expr *E);
9327 bool GatherArgumentsForCall(
SourceLocation CallLoc, FunctionDecl *FDecl,
9332 bool AllowExplicit =
false,
9333 bool IsListInitialization =
false);
9338 FunctionDecl *FDecl);
9346 bool IsCompAssign =
false);
9427 bool *Complained =
nullptr);
9432 bool IsValueInFlagEnum(
const EnumDecl *ED,
const llvm::APInt &Val,
9433 bool AllowMask)
const;
9453 bool ConvertRHS =
true);
9471 bool DiagnoseCFAudited =
false,
bool ConvertRHS =
true);
9478 bool IsStringLiteralToNonConstPointerConversion(Expr *From,
QualType ToType);
9480 bool CheckExceptionSpecCompatibility(Expr *From,
QualType ToType);
9484 bool AllowExplicit =
false);
9493 = CCK_ImplicitConversion);
9507 QualType CheckPointerToMemberOperands(
9510 QualType CheckMultiplyDivideOperands(
9515 bool IsCompAssign =
false);
9544 Expr *LHS, Expr *RHS);
9551 QualType CXXCheckConditionalOperands(
9555 bool ConvertArgs =
true);
9558 bool ConvertArgs =
true) {
9559 Expr *E1Tmp = E1.
get(), *E2Tmp = E2.
get();
9561 FindCompositePointerType(Loc, E1Tmp, E2Tmp, ConvertArgs);
9570 bool DiagnoseConditionalForNull(Expr *LHSExpr, Expr *RHSExpr,
9573 void DiagnoseAlwaysNonNullPointer(Expr *E,
9580 bool AllowBothBool,
bool AllowBoolConversion);
9591 bool CheckForConstantInitializer(Expr *e,
QualType t);
9601 Ref_Incompatible = 0,
9612 bool &DerivedToBase,
9613 bool &ObjCConversion,
9614 bool &ObjCLifetimeConversion);
9627 Expr *result,
QualType ¶mType);
9660 bool Diagnose =
true,
9661 bool DiagnoseCFAudited =
false,
9665 Expr *stripARCUnbridgedCast(Expr *e);
9666 void diagnoseARCUnbridgedCast(Expr *e);
9668 bool CheckObjCARCUnavailableWeakConversion(
QualType castType,
9674 void checkRetainCycles(Expr *receiver, Expr *argument);
9675 void checkRetainCycles(VarDecl *Var, Expr *Init);
9683 void checkUnsafeExprAssigns(
SourceLocation Loc, Expr *LHS, Expr *RHS);
9689 bool CheckMessageArgumentTypes(
QualType ReceiverType,
9693 bool isSuperMessage,
9703 bool isClassMessage,
bool isSuperMessage);
9707 void EmitRelatedResultTypeNote(
const Expr *E);
9712 void EmitRelatedResultTypeNoteForReturn(
QualType destType);
9724 : ConditionVar(ConditionVar), Condition(Condition), Invalid(
false),
9725 HasKnownValue(IsConstexpr && Condition.get() &&
9726 !Condition.get()->isValueDependent()),
9727 KnownValue(HasKnownValue &&
9728 !!Condition.get()->EvaluateKnownConstInt(S.Context)) {}
9730 : ConditionVar(nullptr), Condition(nullptr), Invalid(Invalid),
9736 std::pair<VarDecl *, Expr *>
get()
const {
9737 return std::make_pair(cast_or_null<VarDecl>(ConditionVar),
9763 ExprResult CheckConditionVariable(VarDecl *ConditionVar,
9777 bool IsConstexpr =
false);
9781 void DiagnoseAssignmentAsCondition(Expr *E);
9785 void DiagnoseEqualityWithExtraParens(
ParenExpr *ParenE);
9788 ExprResult CheckCXXBooleanCondition(Expr *CondExpr,
bool IsConstexpr =
false);
9793 void ConvertIntegerToTypeWarnOnOverflow(llvm::APSInt &OldVal,
9794 unsigned NewWidth,
bool NewSign,
9800 bool CheckObjCDeclScope(Decl *D);
9818 ExprResult VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result,
9820 bool AllowFold =
true);
9821 ExprResult VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result,
9823 bool AllowFold =
true);
9824 ExprResult VerifyIntegerConstantExpression(Expr *E,
9825 llvm::APSInt *Result =
nullptr);
9833 Expr *BitWidth,
bool *ZeroWidth =
nullptr);
9836 unsigned ForceCUDAHostDeviceDepth = 0;
9842 void PushForceCUDAHostDevice();
9847 bool PopForceCUDAHostDevice();
9852 llvm::DenseMap<CanonicalDeclPtr<FunctionDecl>,
9853 std::vector<PartialDiagnosticAt>>
9884 llvm::DenseMap< CanonicalDeclPtr<FunctionDecl>,
9885 llvm::MapVector<CanonicalDeclPtr<FunctionDecl>,
9921 FunctionDecl *Fn,
Sema &S);
9934 operator bool()
const {
return ImmediateDiag.hasValue(); }
9936 template <
typename T>
9939 if (Diag.ImmediateDiag.hasValue())
9940 *Diag.ImmediateDiag << Value;
9941 else if (Diag.PartialDiag.hasValue())
9942 *Diag.PartialDiag << Value;
9997 bool IgnoreImplicitHDAttr =
false);
10002 return IdentifyCUDATarget(dyn_cast<FunctionDecl>(CurContext));
10026 const FunctionDecl *Callee);
10034 const FunctionDecl *Callee) {
10035 return IdentifyCUDAPreference(Caller, Callee) != CFP_Never;
10040 void maybeAddCUDAHostDeviceAttrs(FunctionDecl *FD,
10071 void EraseUnwantedCUDAMatches(
10072 const FunctionDecl *Caller,
10073 SmallVectorImpl<std::pair<DeclAccessPair, FunctionDecl *>> &Matches);
10086 bool inferCUDATargetForImplicitSpecialMember(
CXXRecordDecl *ClassDecl,
10094 bool isEmptyCudaConstructor(
SourceLocation Loc, CXXConstructorDecl *CD);
10099 void checkCUDATargetOverload(FunctionDecl *NewFD,
10149 PCC_LocalDeclarationSpecifiers
10152 void CodeCompleteModuleImport(
SourceLocation ImportLoc, ModuleIdPath Path);
10153 void CodeCompleteOrdinaryName(Scope *S,
10155 void CodeCompleteDeclSpec(Scope *S,
DeclSpec &DS,
10156 bool AllowNonIdentifiers,
10157 bool AllowNestedNameSpecifiers);
10160 void CodeCompleteExpression(Scope *S,
10162 void CodeCompleteMemberReferenceExpr(Scope *S, Expr *Base,
10164 bool IsBaseExprStatement);
10165 void CodeCompletePostfixExpression(Scope *S,
ExprResult LHS);
10166 void CodeCompleteTag(Scope *S,
unsigned TagSpec);
10167 void CodeCompleteTypeQualifiers(
DeclSpec &DS);
10170 void CodeCompleteBracketDeclarator(Scope *S);
10171 void CodeCompleteCase(Scope *S);
10175 void CodeCompleteInitializer(Scope *S, Decl *D);
10176 void CodeCompleteReturn(Scope *S);
10177 void CodeCompleteAfterIf(Scope *S);
10178 void CodeCompleteAssignmentRHS(Scope *S, Expr *LHS);
10180 void CodeCompleteQualifiedId(Scope *S,
CXXScopeSpec &SS,
10181 bool EnteringContext);
10182 void CodeCompleteUsing(Scope *S);
10183 void CodeCompleteUsingDirective(Scope *S);
10184 void CodeCompleteNamespaceDecl(Scope *S);
10185 void CodeCompleteNamespaceAliasDecl(Scope *S);
10186 void CodeCompleteOperatorName(Scope *S);
10187 void CodeCompleteConstructorInitializer(
10192 bool AfterAmpersand);
10194 void CodeCompleteObjCAtDirective(Scope *S);
10195 void CodeCompleteObjCAtVisibility(Scope *S);
10196 void CodeCompleteObjCAtStatement(Scope *S);
10197 void CodeCompleteObjCAtExpression(Scope *S);
10198 void CodeCompleteObjCPropertyFlags(Scope *S,
ObjCDeclSpec &ODS);
10199 void CodeCompleteObjCPropertyGetter(Scope *S);
10200 void CodeCompleteObjCPropertySetter(Scope *S);
10201 void CodeCompleteObjCPassingType(Scope *S,
ObjCDeclSpec &DS,
10203 void CodeCompleteObjCMessageReceiver(Scope *S);
10204 void CodeCompleteObjCSuperMessage(Scope *S,
SourceLocation SuperLoc,
10206 bool AtArgumentExpression);
10207 void CodeCompleteObjCClassMessage(Scope *S, ParsedType Receiver,
10209 bool AtArgumentExpression,
10210 bool IsSuper =
false);
10211 void CodeCompleteObjCInstanceMessage(Scope *S, Expr *Receiver,
10213 bool AtArgumentExpression,
10215 void CodeCompleteObjCForCollection(Scope *S,
10216 DeclGroupPtrTy IterationVar);
10217 void CodeCompleteObjCSelector(Scope *S,
10219 void CodeCompleteObjCProtocolReferences(
10221 void CodeCompleteObjCProtocolDecl(Scope *S);
10222 void CodeCompleteObjCInterfaceDecl(Scope *S);
10223 void CodeCompleteObjCSuperclass(Scope *S,
10226 void CodeCompleteObjCImplementationDecl(Scope *S);
10227 void CodeCompleteObjCInterfaceCategory(Scope *S,
10230 void CodeCompleteObjCImplementationCategory(Scope *S,
10233 void CodeCompleteObjCPropertyDefinition(Scope *S);
10234 void CodeCompleteObjCPropertySynthesizeIvar(Scope *S,
10236 void CodeCompleteObjCMethodDecl(Scope *S,
Optional<bool> IsInstanceMethod,
10237 ParsedType ReturnType);
10238 void CodeCompleteObjCMethodDeclSelector(Scope *S,
10239 bool IsInstanceMethod,
10240 bool AtParameterName,
10241 ParsedType ReturnType,
10243 void CodeCompleteObjCClassPropertyRefExpr(Scope *S,
IdentifierInfo &ClassName,
10245 bool IsBaseExprStatement);
10246 void CodeCompletePreprocessorDirective(
bool InConditional);
10247 void CodeCompleteInPreprocessorConditionalExclusion(Scope *S);
10248 void CodeCompletePreprocessorMacroName(
bool IsDefinition);
10249 void CodeCompletePreprocessorExpression();
10250 void CodeCompletePreprocessorMacroArgument(Scope *S,
10253 unsigned Argument);
10254 void CodeCompleteNaturalLanguage();
10255 void CodeCompleteAvailabilityPlatformName();
10266 unsigned ByteNo)
const;
10269 void CheckArrayAccess(
const Expr *BaseExpr,
const Expr *IndexExpr,
10271 bool AllowOnePastEnd=
true,
bool IndexNegated=
false);
10272 void CheckArrayAccess(
const Expr *E);
10275 struct FormatStringInfo {
10276 unsigned FormatIdx;
10277 unsigned FirstDataArg;
10281 static bool getFormatStringInfo(
const FormatAttr *Format,
bool IsCXXMember,
10282 FormatStringInfo *FSI);
10283 bool CheckFunctionCall(FunctionDecl *FDecl,
CallExpr *TheCall,
10290 void CheckConstructorCall(FunctionDecl *FDecl,
10300 bool CheckObjCString(Expr *Arg);
10301 ExprResult CheckOSLogFormatStringArg(Expr *Arg);
10303 ExprResult CheckBuiltinFunctionCall(FunctionDecl *FDecl,
10304 unsigned BuiltinID,
CallExpr *TheCall);
10306 bool CheckARMBuiltinExclusiveCall(
unsigned BuiltinID,
CallExpr *TheCall,
10307 unsigned MaxWidth);
10308 bool CheckNeonBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10309 bool CheckARMBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10311 bool CheckAArch64BuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10312 bool CheckMipsBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10313 bool CheckSystemZBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10314 bool CheckX86BuiltinRoundingOrSAE(
unsigned BuiltinID,
CallExpr *TheCall);
10315 bool CheckX86BuiltinGatherScatterScale(
unsigned BuiltinID,
CallExpr *TheCall);
10316 bool CheckX86BuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10317 bool CheckPPCBuiltinFunctionCall(
unsigned BuiltinID,
CallExpr *TheCall);
10319 bool SemaBuiltinVAStart(
unsigned BuiltinID,
CallExpr *TheCall);
10320 bool SemaBuiltinVAStartARMMicrosoft(
CallExpr *Call);
10321 bool SemaBuiltinUnorderedCompare(
CallExpr *TheCall);
10322 bool SemaBuiltinFPClassification(
CallExpr *TheCall,
unsigned NumArgs);
10323 bool SemaBuiltinVSX(
CallExpr *TheCall);
10324 bool SemaBuiltinOSLogFormat(
CallExpr *TheCall);
10334 bool SemaBuiltinPrefetch(
CallExpr *TheCall);
10335 bool SemaBuiltinAllocaWithAlign(
CallExpr *TheCall);
10336 bool SemaBuiltinAssume(
CallExpr *TheCall);
10337 bool SemaBuiltinAssumeAligned(
CallExpr *TheCall);
10338 bool SemaBuiltinLongjmp(
CallExpr *TheCall);
10339 bool SemaBuiltinSetjmp(
CallExpr *TheCall);
10344 bool SemaBuiltinConstantArg(
CallExpr *TheCall,
int ArgNum,
10345 llvm::APSInt &Result);
10346 bool SemaBuiltinConstantArgRange(
CallExpr *TheCall,
int ArgNum,
10347 int Low,
int High);
10348 bool SemaBuiltinConstantArgMultiple(
CallExpr *TheCall,
int ArgNum,
10349 unsigned Multiple);
10350 bool SemaBuiltinARMSpecialReg(
unsigned BuiltinID,
CallExpr *TheCall,
10351 int ArgNum,
unsigned ExpectedFieldNum,
10370 static bool GetFormatNSStringIdx(
const FormatAttr *Format,
unsigned &Idx);
10373 bool CheckFormatArguments(
const FormatAttr *Format,
10378 llvm::SmallBitVector &CheckedVarArgs);
10380 bool HasVAListArg,
unsigned format_idx,
10384 llvm::SmallBitVector &CheckedVarArgs);
10386 void CheckAbsoluteValueFunction(
const CallExpr *Call,
10387 const FunctionDecl *FDecl);
10389 void CheckMaxUnsignedZero(
const CallExpr *Call,
const FunctionDecl *FDecl);
10391 void CheckMemaccessArguments(
const CallExpr *Call,
10395 void CheckStrlcpycatArguments(
const CallExpr *Call,
10398 void CheckStrncatArguments(
const CallExpr *Call,
10401 void CheckReturnValExpr(Expr *RetValExp,
QualType lhsType,
10403 bool isObjCMethod =
false,
10404 const AttrVec *Attrs =
nullptr,
10405 const FunctionDecl *FD =
nullptr);
10407 void CheckFloatComparison(
SourceLocation Loc, Expr* LHS, Expr* RHS);
10410 void CheckForIntOverflow(Expr *E);
10411 void CheckUnsequencedOperations(Expr *E);
10416 bool IsConstexpr =
false);
10428 void CheckBreakContinueBinding(Expr *E);
10436 bool DeleteWasArrayForm);
10439 void RegisterTypeTagForDatatype(
const IdentifierInfo *ArgumentKind,
10440 uint64_t MagicValue,
QualType Type,
10441 bool LayoutCompatible,
bool MustBeNull);
10447 Type(Type), LayoutCompatible(LayoutCompatible),
10448 MustBeNull(MustBeNull)
10465 std::unique_ptr<llvm::DenseMap<TypeTagMagicValue, TypeTagData>>
10466 TypeTagForDatatypeMagicValues;
10470 void CheckArgumentWithTypeTag(
const ArgumentWithTypeTagAttr *Attr,
10476 void CheckAddressOfPackedMember(Expr *rhs);
10533 Decl *getObjCDeclContext()
const;
10536 return OriginalLexicalContext ? OriginalLexicalContext : CurContext;
10543 DC = CatD->getClassInterface();
10550 bool PartialOverloading =
false) {
10552 if (NumArgs > 0 && PartialOverloading)
10553 return NumArgs + 1 > NumParams;
10554 return NumArgs > NumParams;
10562 class SavePendingParsedClassStateRAII {
10564 SavePendingParsedClassStateRAII(
Sema &S) : S(S) { swapSavedState(); }
10566 ~SavePendingParsedClassStateRAII() {
10568 "there shouldn't be any pending delayed exception spec checks");
10570 "there shouldn't be any pending delayed defaulted member " 10571 "exception specs");
10573 "there shouldn't be any pending delayed DLL export classes");
10579 decltype(DelayedExceptionSpecChecks) SavedExceptionSpecChecks;
10580 decltype(DelayedDefaultedMemberExceptionSpecs)
10581 SavedDefaultedMemberExceptionSpecs;
10582 decltype(DelayedDllExportClasses) SavedDllExportClasses;
10584 void swapSavedState() {
10586 SavedDefaultedMemberExceptionSpecs.swap(
10594 struct MisalignedMember {
10600 MisalignedMember() : E(), RD(), MD(), Alignment() {}
10603 : E(E), RD(RD), MD(MD), Alignment(Alignment) {}
10604 explicit MisalignedMember(Expr *E)
10605 : MisalignedMember(E,
nullptr,
nullptr,
CharUnits()) {}
10607 bool operator==(
const MisalignedMember &m) {
return this->E == m.E; }
10621 void DiagnoseMisalignedMembers();
10628 void DiscardMisalignedMemberAddress(
const Type *T, Expr *E);
10633 void RefersToMemberWithReducedAlignment(
10642 bool Entered =
true;
10648 Decl *LambdaContextDecl =
nullptr,
10649 bool IsDecltype =
false,
10650 bool ShouldEnter =
true)
10651 : Actions(Actions), Entered(ShouldEnter) {
10659 bool IsDecltype =
false)
10660 : Actions(Actions) {
10662 Sema::ReuseLambdaContextDecl,
10668 bool ShouldEnter =
true)
10669 : Actions(Actions), Entered(
false) {
10677 Sema::ExpressionEvaluationContext::UnevaluatedList,
nullptr,
false);
10724 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...
An instance of this class is created to represent 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.
AttributeList * ArgAttrs
ArgAttrs - Attribute list for this argument.
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).
if(T->getSizeExpr()) TRY_TO(TraverseStmt(T -> getSizeExpr()))
unsigned getRawEncoding() const
When a SourceLocation itself cannot be used, this returns an (opaque) 32-bit integer encoding for it...
llvm::DenseMap< CanonicalDeclPtr< FunctionDecl >, llvm::MapVector< CanonicalDeclPtr< FunctionDecl >, SourceLocation > > CUDACallGraph
A partial call graph maintained during CUDA compilation to support deferred diagnostics.
EnterExpressionEvaluationContext(Sema &Actions, Sema::ExpressionEvaluationContext NewContext, Decl *LambdaContextDecl=nullptr, bool IsDecltype=false, bool ShouldEnter=true)
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
Represents a version number in the form major[.minor[.subminor[.build]]].
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.
LateParsedTemplateMapT LateParsedTemplateMap
SmallVector< PackIncludeState, 8 > PackIncludeStack
A stack-allocated class that identifies which local variable declaration instantiations are present i...
llvm::MutableArrayRef< ImplicitConversionSequence > ConversionSequenceList
A list of implicit conversion sequences for the arguments of an OverloadCandidate.
static bool getPrintable(bool B)
bool operator==(CanQual< T > x, CanQual< U > y)
Code completion occurs within a class, struct, or union.
__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.
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.
EnumConstantDecl - 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...
TypedefDecl - Represents the declaration of a typedef-name via the 'typedef' type specifier...
ActionResult< Expr * > ExprResult
llvm::StringRef StackSlotLabel
SmallVector< Scope *, 2 > CurrentSEHFinally
Stack of active SEH __finally scopes. Can be empty.
void setCurrentOpenCLExtension(llvm::StringRef Ext)
Defines the clang::Module class, which describes a module in the source code.
OriginalCallArg(QualType OriginalParamType, bool DecomposedParam, unsigned ArgIdx, QualType OriginalArgType)
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID)
Emit a diagnostic.
Decl - This represents one declaration (or definition), e.g.
Captures information about "declaration specifiers" specific to Objective-C.
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
std::deque< PendingImplicitInstantiation > PendingInstantiations
The queue of implicit template instantiations that are required but have not yet been performed...
AssignConvertType
AssignConvertType - All of the 'assignment' semantic checks return this enum to indicate whether the ...
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Defines the C++ template declaration subclasses.
Scope * TUScope
Translation Unit Scope - useful to Objective-C actions that need to lookup file scope declarations in...
Represents a C++11 auto or C++14 decltype(auto) type.
DeclContext * OriginalLexicalContext
Generally null except when we temporarily switch decl contexts, like in.
friend const CUDADiagBuilder & operator<<(const CUDADiagBuilder &Diag, const T &Value)
ParenExpr - This represents a parethesized expression, e.g.
SmallVector< CodeSynthesisContext, 16 > CodeSynthesisContexts
List of active code synthesis contexts.
SmallVector< Module *, 16 > CodeSynthesisContextLookupModules
Extra modules inspected when performing a lookup during a template instantiation. ...
The base class of the type hierarchy.
std::deque< PendingImplicitInstantiation > PendingLocalImplicitInstantiations
The queue of implicit template instantiations that are required and must be performed within the curr...
void AddFactoryMethodToGlobalPool(ObjCMethodDecl *Method, bool impl=false)
AddFactoryMethodToGlobalPool - Same as above, but for factory methods.
llvm::MapVector< const FunctionDecl *, std::unique_ptr< LateParsedTemplate > > LateParsedTemplateMapT
~SynthesizedFunctionScope()
MissingImportKind
Kinds of missing import.
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
Declaration of a variable template.
TemplateParamListContext
The context in which we are checking a template parameter list.
NamespaceDecl - 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)
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.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
IfExistsResult
Describes the result of an "if-exists" condition check.
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.
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.
TypeSpecifierType
Specifies the kind of type.
Represents a variable template specialization, which refers to a variable template with a given set o...
ObjCMethodDecl - Represents an instance or class method declaration.
SmallVector< CXXRecordDecl *, 4 > DelayedDllExportClasses
void diagnose(Sema &S, SourceLocation Loc, QualType T) override
RAII object used to temporarily allow the C++ 'this' expression to be used, with the given qualifiers...
llvm::MapVector< NamedDecl *, SourceLocation > UndefinedButUsed
UndefinedInternals - all the used, undefined objects which require a definition in this translation u...
The lookup found a single 'cooked' literal operator, which expects a normal literal to be built and p...
PragmaClangSection PragmaClangBSSSection
BoundTypeDiagnoser(unsigned DiagID, const Ts &...Args)
Stores a list of template parameters for a TemplateDecl and its derived classes.
Describes how types, statements, expressions, and declarations should be printed. ...
A context in which code is being synthesized (where a source location alone is not sufficient to iden...
Code completion occurs within an Objective-C implementation or category implementation.
ObjCMethodDecl * ValueWithBytesObjCTypeMethod
The declaration of the valueWithBytes:objCType: method.
llvm::MapVector< Selector, SourceLocation > ReferencedSelectors
Method selectors used in a @selector expression.
bool IsDecltype
Whether we are in a decltype expression.
NestedNameSpecInfo(IdentifierInfo *II, SourceLocation IdLoc, SourceLocation ColonColonLoc, QualType ObjectType)
static NameClassification NestedNameSpecifier()
SourceLocation PragmaLocation
Look up an ordinary name that is going to be redeclared as a name with linkage.
FunctionProtoType::ExceptionSpecInfo getExceptionSpec() const
Overwrite an EPI's exception specification with this computed exception specification.
ParmVarDecl - Represents a parameter to a function.
OpenCLOptions & getOpenCLOptions()
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.
RecordDecl - 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...
OpaquePtr< QualType > ParsedType
An opaque type for threading parsed type information through the parser.
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.
ExpressionEvaluationContextRecord(ExpressionEvaluationContext Context, unsigned NumCleanupObjects, CleanupInfo ParentCleanup, Decl *ManglingContextDecl, bool IsDecltype)
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.
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
AttributeList * Attribute
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.
static void checkUnusedDeclAttributes(Sema &S, const AttributeList *A)
checkUnusedDeclAttributes - Check a list of attributes to see if it contains any decl attributes that...
Code completion occurs following one or more template headers within a class.
This is not an overload because the signature exactly matches an existing declaration.
Interesting information about a specific parameter that can't simply be reflected in parameter's type...
The iterator over UnresolvedSets.
Token - This structure provides full information about a lexed token.
bool isVisible(const Module *M) const
Determine whether a module is visible.
CompatiblePointerDiscardsQualifiers - The assignment discards c/v/r qualifiers, which we accept as an...
ParsingDeclState PushParsingDeclaration(sema::DelayedDiagnosticPool &pool)
The fixed underlying type of an enumeration.
bool isExternallyDeclarable() const
Determine whether this declaration can be redeclared in a different translation unit.
Represents a C++ member access expression for which lookup produced a set of overloaded functions...
TemplateName getTemplateName() const
LazyVector< VarDecl *, ExternalSemaSource, &ExternalSemaSource::ReadTentativeDefinitions, 2, 2 > TentativeDefinitionsType
Defines some OpenMP-specific enums and functions.
Represents an access specifier followed by colon ':'.
The type of a non-type template parameter.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Diagnostic builder for CUDA errors which may or may not be deferred.
ArrayRef< std::pair< IdentifierInfo *, SourceLocation > > ModuleIdPath
A sequence of identifier/location pairs used to describe a particular module or submodule, e.g., std.vector.
i32 captured_struct **param SharedsTy A type which contains references the shared variables *param Shareds Context with the list of shared variables from the p *TaskFunction *param Data Additional data for task generation like final * state
void PopExpressionEvaluationContext()
OverloadKind
C++ Overloading.
Code completion occurs where only a type is permitted.
Describes a module or submodule.
llvm::BumpPtrAllocator BumpAlloc
ObjCMethodDecl * LookupFactoryMethodInGlobalPool(Selector Sel, SourceRange R, bool receiverIdOrClass=false)
LookupFactoryMethodInGlobalPool - Returns the method and warns if there are multiple signatures...
This little struct is used to capture information about structure field declarators, which is basically just a bitfield size.
SpecialMemberOverloadResult - The overloading result for a special member function.
bool AccessCheckingSFINAE
When true, access checking violations are treated as SFINAE failures rather than hard errors...
An r-value expression (a pr-value in the C++11 taxonomy) produces a temporary value.
The type of an exception.
Code completion occurs at top-level or namespace context.
A pair of a canonical FunctionDecl and a SourceLocation.
We are instantiating the exception specification for a function template which was deferred until it ...
bool isModuleVisible(const Module *M)
SemaDiagnosticBuilder(DiagnosticBuilder &DB, Sema &SemaRef, unsigned DiagID)
OpenMPDistScheduleClauseKind
OpenMP attributes for 'dist_schedule' clause.
An allocator used specifically for the purpose of code completion.
unsigned TyposCorrected
The number of typos corrected by CorrectTypo.
Represents a C++ using-declaration.
Code completion occurs within the body of a function on a recovery path, where we do not have a speci...
llvm::SmallVector< QualType, 4 > CurrentParameterCopyTypes
Stack of types that correspond to the parameter entities that are currently being copy-initialized...
Represents a C++ unqualified-id that has been parsed.
bool isCompleteType(SourceLocation Loc, QualType T)
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".
TypeDecl - 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.
llvm::SmallSetVector< const NamedDecl *, 16 > NamedDeclSetType
Look up the name of an OpenMP user-defined reduction operation.
Template argument deduction exceeded the maximum template instantiation depth (which has already been...
void MarkDeducedTemplateParameters(const FunctionTemplateDecl *FunctionTemplate, llvm::SmallBitVector &Deduced)
CheckedConversionKind
The kind of conversion being performed.
EnterExpressionEvaluationContext(Sema &Actions, InitListTag, bool ShouldEnter=true)
std::pair< StringRef, QualType > CapturedParamNameType
std::function< ExprResult(Sema &, TypoExpr *, TypoCorrection)> TypoRecoveryCallback
virtual ~VerifyICEDiagnoser()
LazyDeclPtr StdBadAlloc
The C++ "std::bad_alloc" class, which is defined by the C++ standard library.
llvm::DenseMap< CanonicalDeclPtr< FunctionDecl >, std::vector< PartialDiagnosticAt > > CUDADeferredDiags
Diagnostics that are emitted only if we discover that the given function must be codegen'ed.
Scope - A scope is a transient data structure that is used while parsing the program.
The type of a data member.
NonTagKind
Common ways to introduce type names without a tag for use in diagnostics.
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
void popUndelayed(DelayedDiagnosticsState state)
Undo a previous pushUndelayed().
Represents a C++ nested-name-specifier or a global scope specifier.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Represents an Objective-C protocol declaration.
llvm::DenseMap< Decl *, SmallVector< PartialDiagnosticAt, 1 > > SuppressedDiagnosticsMap
For each declaration that involved template argument deduction, the set of diagnostics that were supp...
ArrayTypeTrait
Names for the array type traits.
const internal::VariadicDynCastAllOfMatcher< Stmt, CastExpr > castExpr
Matches any cast nodes of Clang's AST.
static bool checkAddressOfFunctionIsAvailable(Sema &S, const FunctionDecl *FD, bool Complain, bool InOverloadResolution, SourceLocation Loc)
Returns true if we can take the address of the function.
void incrementMSManglingNumber()
ObjCInterfaceDecl * NSNumberDecl
The declaration of the Objective-C NSNumber class.
const LangOptions & getLangOpts() const
QualType OriginalParamType
sema::AnalysisBasedWarnings AnalysisWarnings
Worker object for performing CFG-based warnings.
SmallVector< BoundNodes, 1 > match(MatcherT Matcher, const NodeT &Node, ASTContext &Context)
Returns the results of matching Matcher on Node.
This 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...
FullExprArg(Sema &actions)
ObjCMethodDecl * StringWithUTF8StringMethod
The declaration of the stringWithUTF8String: method.
const LangOptions & LangOpts
static NameClassification TypeTemplate(TemplateName Name)
RAII object used to change the argument pack substitution index within a Sema object.
uint8_t PointerKind
Which kind of pointer declarator we saw.
Contains information about the compound statement currently being parsed.
TemplateNameKindForDiagnostics
Describes the detailed kind of a template name. Used in diagnostics.
ParsingClassState PushParsingClass()
unsigned NumCleanupObjects
The number of active cleanup objects when we entered this expression evaluation context.
llvm::SmallVector< DeleteExprLoc, 4 > DeleteLocs
A helper class for building up ExtParameterInfos.
void AddInstanceMethodToGlobalPool(ObjCMethodDecl *Method, bool impl=false)
AddInstanceMethodToGlobalPool - All instance methods in a translation unit are added to a global pool...
TypeTrait
Names for traits that operate specifically on types.
We are matching the template parameter lists of two template template parameters as part of matching ...
DiagnosticsEngine & getDiagnostics() const
RAII class used to determine whether SFINAE has trapped any errors that occur during template argumen...
Defines the clang::TemplateNameKind enum.
ArgumentPackSubstitutionIndexRAII(Sema &Self, int NewSubstitutionIndex)
CXXSpecialMember
Kinds of C++ special members.
static Sema::TemplateDeductionResult DeduceTemplateArguments(Sema &S, TemplateParameterList *TemplateParams, const TemplateArgument &Param, TemplateArgument Arg, TemplateDeductionInfo &Info, SmallVectorImpl< DeducedTemplateArgument > &Deduced)
llvm::Optional< bool > getKnownValue() const
We are substituting explicit template arguments provided for a function template. ...
IdentifierInfo * IdentInfo
Sema - This implements semantic analysis and AST building for C.
Merge availability attributes for an implementation of a protocol requirement.
A little helper class used to produce diagnostics.
Represents a prototype with parameter type info, e.g.
SmallVector< CallExpr *, 8 > DelayedDecltypeCalls
If we are processing a decltype type, a set of call expressions for which we have deferred checking t...
TentativeDefinitionsType TentativeDefinitions
All the tentative definitions encountered in the TU.
ResultTypeCompatibilityKind
Describes the compatibility of a result type with its method.
llvm::DenseMap< Selector, GlobalMethods > GlobalMethodPool
static bool isEqual(const FunctionDeclAndLoc &LHS, const FunctionDeclAndLoc &RHS)
Retains information about a captured region.
llvm::SmallPtrSet< Selector, 8 > SelectorSet
A RAII object to enter scope of a compound statement.
Represents a ValueDecl that came out of a declarator.
CastKind
CastKind - The kind of operation required for a conversion.
The return type of classify().
Template argument deduction did not deduce a value for every template parameter.
static FunctionDeclAndLoc getTombstoneKey()
FunctionVoidPointer - The assignment is between a function pointer and void*, which the standard does...
llvm::FoldingSet< SpecialMemberOverloadResultEntry > SpecialMemberCache
A cache of special member function overload resolution results for C++ records.
ArraySizeModifier
Capture whether this is a normal array (e.g.
const Decl * PragmaAttributeCurrentTargetDecl
The declaration that is currently receiving an attribute from the #pragma attribute stack...
TemplateParameterListEqualKind
Enumeration describing how template parameter lists are compared for equality.
DelayedDiagnosticsState ParsingDeclState
We are instantiating a template declaration.
Captures information about a #pragma weak directive.
std::function< void(const TypoCorrection &)> TypoDiagnosticGenerator
SmallVector< PragmaAttributeEntry, 2 > PragmaAttributeStack
Scope * getCurScope() const
Retrieve the parser's current scope.
llvm::PointerIntPair< CXXRecordDecl *, 3, CXXSpecialMember > SpecialMemberDecl
SourceLocation IdentifierLoc
The location of the identifier.
Allows QualTypes to be sorted and hence used in maps and sets.
NameClassification(ParsedType Type)
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...
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
Defines the clang::LangOptions interface.
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...
const FunctionProtoType * T
Declaration of a template type parameter.
The message is an instance message.
CompoundScopeRAII(Sema &S)
This file defines the classes used to store parsed information about declaration-specifiers and decla...
bool isInvalid() const
Determines whether we have exceeded the maximum recursive template instantiations.
We are substituting template argument determined as part of template argument deduction for either a ...
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
BlockExpr - Adaptor class for mixing a BlockDecl with expressions.
Represents a C++ destructor within a class.
LazyDeclPtr StdNamespace
The C++ "std" namespace, where the standard library resides.
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
SpecialMemberOverloadResult()
Code completion occurs within an Objective-C interface, protocol, or category.
bool InNonInstantiationSFINAEContext
Whether we are in a SFINAE context that is not associated with template instantiation.
IncompatibleVectors - The assignment is between two vector types that have the same size...
llvm::MapVector< IdentifierInfo *, WeakInfo > WeakUndeclaredIdentifiers
WeakUndeclaredIdentifiers - Identifiers contained in #pragma weak before declared.
OpenMPClauseKind
OpenMP clauses.
QualType FindCompositePointerType(SourceLocation Loc, ExprResult &E1, ExprResult &E2, bool ConvertArgs=true)
void PopFunctionScopeInfo(const sema::AnalysisBasedWarnings::Policy *WP=nullptr, const Decl *D=nullptr, const BlockExpr *blkExpr=nullptr)
PragmaStack< StringLiteral * > BSSSegStack
Initial building of a for-range statement.
When performing template argument deduction for a function template, there were too few call argument...
IdentifierResolver - Keeps track of shadowed decls on enclosing scopes.
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
CXXTryStmt - A C++ try block, including all handlers.
IncompatiblePointerDiscardsQualifiers - The assignment discards qualifiers that we don't permit to be...
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
Ref_Related - The two types are reference-related, which means that their unqualified forms (T1 and T...
Represents a C++ template name within the type system.
QualType NSNumberPointer
Pointer to NSNumber type (NSNumber *).
ReferenceCompareResult
ReferenceCompareResult - Expresses the result of comparing two types (cv1 T1 and cv2 T2) to determine...
Defines the clang::TypeLoc interface and its subclasses.
bool isVisible(const NamedDecl *D)
Determine whether a declaration is visible to name lookup.
Code completion occurs within a statement, which may also be an expression or a declaration.
std::unique_ptr< MangleNumberingContext > MangleNumbering
The context information used to mangle lambda expressions and block literals within this context...
TemplateNameKind
Specifies the kind of template name that an identifier refers to.
SmallVector< LateInstantiatedAttribute, 16 > LateInstantiatedAttrVec
SmallVector< VTableUse, 16 > VTableUses
The list of vtables that are required but have not yet been materialized.
An RAII helper that pops function a function scope on exit.
StorageClass
Storage classes.
CleanupInfo ParentCleanup
Whether the enclosing context needed a cleanup.
static bool TooManyArguments(size_t NumParams, size_t NumArgs, bool PartialOverloading=false)
To be used for checking whether the arguments being passed to function exceeds the number of paramete...
SmallVector< sema::FunctionScopeInfo *, 4 > FunctionScopes
Stack containing information about each of the nested function, block, and method scopes that are cur...
InClassInitStyle
In-class initialization styles for non-static data members.
NameClassification(ExprResult Expr)
An expression that sends a message to the given Objective-C object or class.
A mapping from file IDs to a record of whether we've seen nullability information in that file...
Data structure that captures multiple levels of template argument lists for use in template instantia...
Preprocessor & getPreprocessor() const
IdentifierInfo * Identifier
The identifier preceding the '::'.
bool RequireCompleteType(SourceLocation Loc, QualType T, unsigned DiagID, const Ts &...Args)
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
ObjCMethodDecl * ArrayWithObjectsMethod
The declaration of the arrayWithObjects:count: method.
const FunctionProtoType::ExtParameterInfo * getPointerOrNull(unsigned numParams)
Return a pointer (suitable for setting in an ExtProtoInfo) to the ExtParameterInfo array we've built ...
void addContextNote(SourceLocation UseLoc)
SmallVector< attr::SubjectMatchRule, 4 > MatchRules
After substituting deduced template arguments, a dependent parameter type did not match the correspon...
Represents a C++ conversion function within a class.
Code completion occurs within the list of instance variables in an Objective-C interface, protocol, category, or implementation.
OpenMPProcBindClauseKind
OpenMP attributes for 'proc_bind' clause.
ObjCTypeParamVariance
Describes the variance of a given generic parameter.
bool isTemplateInstantiation(TemplateSpecializationKind Kind)
Determine whether this template specialization kind refers to an instantiation of an entity (as oppos...
PragmaClangSectionKind
pragma clang section kind
ObjCKeywordKind
Provides a namespace for Objective-C keywords which start with an '@'.
CallingConv
CallingConv - Specifies the calling convention that a function uses.
SourceLocation PointerLoc
The first pointer declarator (of any pointer kind) in the file that does not have a corresponding nul...
unsigned NumSFINAEErrors
The number of SFINAE diagnostics that have been trapped.
This is a legitimate overload: the existing declarations are functions or function templates with dif...
ExprResult ActOnFinishFullExpr(Expr *Expr)
llvm::DenseMap< CanonicalDeclPtr< FunctionDecl >, FunctionDeclAndLoc > CUDAKnownEmittedFns
An inverse call graph, mapping known-emitted functions to one of their known-emitted callers (plus th...
An abstract interface that should be implemented by external AST sources that also provide informatio...
~LocalEagerInstantiationScope()
ExprResult CorrectDelayedTyposInExpr(ExprResult ER, llvm::function_ref< ExprResult(Expr *)> Filter)
CanonicalDeclPtr< FunctionDecl > FD
static StringRef getPrintable(StringRef S)
DelegatingCtorDeclsType DelegatingCtorDecls
All the delegating constructors seen so far in the file, used for cycle detection at the end of the T...
std::pair< const IdentifierInfo *, uint64_t > TypeTagMagicValue
A pair of ArgumentKind identifier and magic value.
LazyVector< TypedefNameDecl *, ExternalSemaSource, &ExternalSemaSource::ReadExtVectorDecls, 2, 2 > ExtVectorDeclsType
bool hasVisibleDefinition(const NamedDecl *D)
void ActOnStartOfCompoundStmt()
StringLiteral * CurInitSeg
Last section used with #pragma init_seg.
CanThrowResult
Possible results from evaluation of a noexcept expression.
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...
EnterExpressionEvaluationContext(Sema &Actions, Sema::ExpressionEvaluationContext NewContext, Sema::ReuseLambdaContextDecl_t, bool IsDecltype=false)
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.
DeduceAutoResult
Result type of DeduceAutoType.
Encodes a location in the source.
llvm::SmallPtrSet< Expr *, 2 > MaybeODRUseExprs
Store a list of either DeclRefExprs or MemberExprs that contain a reference to a variable (constant) ...
OpenMPDependClauseKind
OpenMP attributes for 'depend' clause.
Defines enumerations for expression traits intrinsics.
SourceLocation CurrentPragmaLocation
llvm::SmallPtrSet< Expr *, 2 > SavedMaybeODRUseExprs
static unsigned getHashValue(const FunctionDeclAndLoc &FDL)
static const char * getPrintable(const char *S)
sema::TemplateDeductionInfo * DeductionInfo
The template deduction info object associated with the substitution or checking of explicit or deduce...
static SourceRange getPrintable(const Expr *E)
Template argument deduction failed due to inconsistent cv-qualifiers on a template parameter type tha...
TagDecl - Represents the declaration of a struct/union/class/enum.
OpenMPDirectiveKind
OpenMP directives.
LabelDecl - 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.
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>::".
TemplateNameKind getTemplateNameKind() const
llvm::SmallPtrSet< const CXXRecordDecl *, 8 > RecordDeclSetTy
static T * mergeVisibilityAttr(Sema &S, Decl *D, SourceRange range, typename T::VisibilityType value, unsigned attrSpellingListIndex)
SFINAETrap(Sema &SemaRef, bool AccessCheckingSFINAE=false)
We are checking the validity of a default template argument that has been used when naming a template...
The declaration was invalid; do nothing.
static DeclarationName getPrintable(DeclarationName N)
ObjCCategoryDecl - Represents a category declaration.
This is a basic class for representing single OpenMP clause.
The message is sent to 'super'.
static bool hasVisibleDefaultArgument(Sema &S, const ParmDecl *D, llvm::SmallVectorImpl< Module *> *Modules)
bool CollectStats
Flag indicating whether or not to collect detailed statistics.
static void CheckBoolLikeConversion(Sema &S, Expr *E, SourceLocation CC)
CheckBoolLikeConversion - Check conversion of given expression to boolean.
TokenKind
Provides a simple uniform namespace for tokens from all C languages.
SourceLocation PragmaLocation
bool RequireNonAbstractType(SourceLocation Loc, QualType T, unsigned DiagID, const Ts &...Args)
Describes the kind of initialization being performed, along with location information for tokens rela...
PragmaStack< MSVtorDispAttr::Mode > VtorDispStack
Whether to insert vtordisps prior to virtual bases in the Microsoft C++ ABI.
void EmitCurrentDiagnostic(unsigned DiagID)
Cause the active diagnostic on the DiagosticsEngine to be emitted.
SourceLocation OptimizeOffPragmaLocation
This represents the last location of a "#pragma clang optimize off" directive if such a directive has...
Represents a C++11 virt-specifier-seq.
CodeCompleteConsumer * CodeCompleter
Code-completion consumer.
unsigned NumTypos
The number of typos encountered during this expression evaluation context (i.e.
Represents one property declaration in an Objective-C interface.
void SetLateTemplateParser(LateTemplateParserCB *LTP, LateTemplateParserCleanupCB *LTPCleanup, void *P)
OpaquePtr< TemplateName > TemplateTy
llvm::DenseSet< std::pair< Decl *, unsigned > > InstantiatingSpecializations
Specializations whose definitions are currently being instantiated.
llvm::SmallSetVector< CXXRecordDecl *, 16 > AssociatedClassSet
std::unique_ptr< CXXFieldCollector > FieldCollector
FieldCollector - Collects CXXFieldDecls during parsing of C++ classes.
static NameClassification FunctionTemplate(TemplateName Name)
PragmaMSPointersToMembersKind
The name is a dependent name, so the results will differ from one instantiation to the next...
bool IsBuildingRecoveryCallExpr
Flag indicating if Sema is building a recovery call expression.
DeductionFailureInfo MakeDeductionFailureInfo(ASTContext &Context, Sema::TemplateDeductionResult TDK, sema::TemplateDeductionInfo &Info)
Convert from Sema's representation of template deduction information to the form used in overload-can...
OverloadCandidateSet - A set of overload candidates, used in C++ overload resolution (C++ 13...
Constant expression in a noptr-new-declarator.
LocalEagerInstantiationScope(Sema &S)
ParameterABI
Kinds of parameter ABI.
llvm::DenseMap< ParmVarDecl *, llvm::TinyPtrVector< ParmVarDecl * > > UnparsedDefaultArgInstantiationsMap
TentativeAnalysisScope(Sema &SemaRef)
ASTConsumer & getASTConsumer() const
CUDAFunctionTarget CurrentCUDATarget()
Gets the CUDA target for the current context.
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
SynthesizedFunctionScope(Sema &S, DeclContext *DC)
void setLastDiagnosticIgnored(bool Ignored=true)
Pretend that the last diagnostic issued was ignored, so any subsequent notes will be suppressed...
QualType NSValuePointer
Pointer to NSValue type (NSValue *).
Defines various enumerations that describe declaration and type specifiers.
A POD class for pairing a NamedDecl* with an access specifier.
The expression in a static assertion.
Expression in a case label.
A class for storing results from argument-dependent lookup.
OpaquePtr< QualType > TypeTy
static std::enable_if< IsPartialSpecialization< T >::value, Sema::TemplateDeductionResult >::type FinishTemplateArgumentDeduction(Sema &S, T *Partial, bool IsPartialOrdering, const TemplateArgumentList &TemplateArgs, SmallVectorImpl< DeducedTemplateArgument > &Deduced, TemplateDeductionInfo &Info)
Complete template argument deduction for a partial specialization.
Base class for declarations which introduce a typedef-name.
Abstract interface for a consumer of code-completion information.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
Represents a template argument.
ParserCompletionContext
Describes the context in which code completion occurs.
TagTypeKind
The kind of a tag type.
OpenMPScheduleClauseModifier
OpenMP modifiers for 'schedule' clause.
Abstract base class used to perform a contextual implicit conversion from an expression to any type p...
Dataflow Directional Tag Classes.
llvm::DenseMap< IdentifierInfo *, SrcLocSet > IdentifierSourceLocations
LateTemplateParserCleanupCB * LateTemplateParserCleanup
SmallVector< CXXBindTemporaryExpr *, 8 > DelayedDecltypeBinds
If we are processing a decltype type, a set of temporary binding expressions for which we have deferr...
SourceLocation ImplicitMSInheritanceAttrLoc
Source location for newly created implicit MSInheritanceAttrs.
int ArgumentPackSubstitutionIndex
The current index into pack expansion arguments that will be used for substitution of parameter packs...
Don't merge availability attributes at all.
unsigned NumTemplateArgs
The number of template arguments in TemplateArgs.
void recordUseOfEvaluatedWeak(const ExprT *E, bool IsRead=true)
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
const DeclContext * getCurObjCLexicalContext() const
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
static ImplicitConversionSequence TryImplicitConversion(Sema &S, Expr *From, QualType ToType, bool SuppressUserConversions, bool AllowExplicit, bool InOverloadResolution, bool CStyle, bool AllowObjCWritebackConversion, bool AllowObjCConversionOnExplicit)
TryImplicitConversion - Attempt to perform an implicit conversion from the given expression (Expr) to...
The base class of all kinds of template declarations (e.g., class, function, etc.).
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
We are instantiating a default argument for a function.
bool RequireLiteralType(SourceLocation Loc, QualType T, unsigned DiagID, const Ts &...Args)
Reads an AST files chain containing the contents of a translation unit.
IndirectFieldDecl - An instance of this class is created to represent a field injected from an anonym...
bool IsAllowedCUDACall(const FunctionDecl *Caller, const FunctionDecl *Callee)
Determines whether Caller may invoke Callee, based on their CUDA host/device attributes.
static NameClassification VarTemplate(TemplateName Name)
SourceLocation PointerEndLoc
The end location for the first pointer declarator in the file.
LateInstantiatedAttribute(const Attr *A, LocalInstantiationScope *S, Decl *D)
A decomposition declaration.
llvm::SmallSet< SourceLocation, 2 > SrcLocSet
A non-depnedent component of the parameter did not match the corresponding component of the argument...
bool GlobalNewDeleteDeclared
A flag to remember whether the implicit forms of operator new and delete have been declared...
DeclarationName - The name of a declaration.
Represents the declaration of an Objective-C type parameter.
unsigned size() const
The number of exceptions in the exception specification.
SourceRange InstantiationRange
The source range that covers the construct that cause the instantiation, e.g., the template-id that c...
bool shouldDiagnoseTargetSupportFromOpenMP() const
Return true if (un)supported features for the current target should be diagnosed if OpenMP (offloadin...
llvm::SmallPtrSet< SpecialMemberDecl, 4 > SpecialMembersBeingDeclared
The C++ special members which we are currently in the process of declaring.
PragmaClangSection PragmaClangRodataSection
std::pair< CXXRecordDecl *, SourceLocation > VTableUse
The list of classes whose vtables have been used within this translation unit, and the source locatio...
ExpressionEvaluationContext Context
The expression evaluation context.
bool isConstantEvaluated() const
EnumDecl - Represents an enum.
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.
Location wrapper for a TemplateArgument.
The template argument was specified in the code or was instantiated with some deduced template argume...
ArraySubscriptExpr - [C99 6.5.2.1] Array Subscripting.
sema::FunctionScopeInfo * getEnclosingFunction() const
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.
void PushExpressionEvaluationContext(ExpressionEvaluationContext NewContext, Decl *LambdaContextDecl=nullptr, bool IsDecltype=false)
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()
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.
OpenMPDefaultClauseKind
OpenMP attributes for 'default' clause.
ArrayRef< TemplateArgument > template_arguments() const
Deduction failed; that's all we know.
static NameClassification Unknown()
bool isUnevaluated() const
ObjCInterfaceDecl * NSArrayDecl
The declaration of the Objective-C NSArray class.
~ArgumentPackSubstitutionIndexRAII()
FPContractStateRAII(Sema &S)
SmallVector< BlockDecl *, 8 > ExprCleanupObjects
ExprCleanupObjects - This is the stack of objects requiring cleanup that are created by the current f...
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat]...
static void LookupVisibleDecls(DeclContext *Ctx, LookupResult &Result, bool QualifiedNameLookup, bool InBaseClass, VisibleDeclConsumer &Consumer, VisibleDeclsRecord &Visited, bool IncludeDependentBases=false)
static SourceRange getPrintable(SourceLocation L)
Represents a base class of a C++ class.
bool SavedInNonInstantiationSFINAEContext
Was the enclosing context a non-instantiation SFINAE context?
PragmaStack< StringLiteral * > ConstSegStack
bool mightBeIntendedToBeTemplateName(ExprResult E)
Determine whether it's plausible that E was intended to be a template-name.
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 EST_ComputedNoexcept.
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)
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...
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 ...
NamedDecl - This represents a decl with a name.
QualType NSStringPointer
Pointer to NSString type (NSString *).
FullExprArg MakeFullDiscardedValueExpr(Expr *Arg)
Represents C++ using-directive.
SmallVector< std::pair< const CXXMethodDecl *, const CXXMethodDecl * >, 2 > DelayedExceptionSpecChecks
All the overriding functions seen during a class definition that had their exception spec checks dela...
The template argument was deduced via template argument deduction.
SourceLocation CurrentPragmaLocation
Look up of an operator name (e.g., operator+) for use with operator overloading.
Describes an entity that is being initialized.
static QualType getPrintable(QualType T)
The type of an arbitrary declaration.
ParsedAttributes - A collection of parsed attributes.
SourceLocation ColonLoc
Location of ':'.
SmallVector< Slot, 2 > Stack
brief A function argument from which we performed template argument
This represents '#pragma omp threadprivate ...' directive.
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
The explicitly-specified template arguments were not valid template arguments for the given template...
The lookup resulted in an error.
SmallVector< std::pair< CXXMethodDecl *, const FunctionProtoType * >, 2 > DelayedDefaultedMemberExceptionSpecs
All the members seen during a class definition which were both explicitly defaulted and had explicitl...
This class handles loading and caching of source files into memory.
IncompatibleNestedPointerQualifiers - The assignment is between two nested pointer types...
The symbol does not exist.
Declaration of a template function.
llvm::DenseMap< const EnumDecl *, llvm::APInt > FlagBitsCache
A cache of the flags available in enumerations with the flag_bits attribute.
Code completion occurs in a parenthesized expression, which might also be a type cast.
void PushFunctionScope()
Enter a new function scope.
NullPointerConstantKind
Enumeration used to describe the kind of Null pointer constant returned from isNullPointerConstant()...
NamedDeclSetType UnusedPrivateFields
Set containing all declared private fields that are not used.
Attr - This represents one attribute.
This represents the stack of attributes that were pushed by #pragma clang attribute.
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
ParsedType actOnLambdaInitCaptureInitialization(SourceLocation Loc, bool ByRef, IdentifierInfo *Id, LambdaCaptureInitKind InitKind, Expr *&Init)
Perform initialization analysis of the init-capture and perform any implicit conversions such as an l...
ObjCMethodDecl * DictionaryWithObjectsMethod
The declaration of the dictionaryWithObjects:forKeys:count: method.
Helper class that creates diagnostics with optional template instantiation stacks.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
AttributeList - Represents a syntactic attribute.
~TentativeAnalysisScope()
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