37#include "llvm/ADT/ArrayRef.h"
38#include "llvm/ADT/PointerIntPair.h"
39#include "llvm/ADT/SmallVector.h"
40#include "llvm/ADT/StringRef.h"
41#include "llvm/Support/Casting.h"
42#include "llvm/Support/ErrorHandling.h"
43#include "llvm/Support/MathExtras.h"
44#include "llvm/Support/VersionTuple.h"
45#include "llvm/Support/raw_ostream.h"
59#define DECL(DERIVED, BASE) static int n##DERIVED##s = 0;
60#define ABSTRACT_DECL(DECL)
61#include "clang/AST/DeclNodes.inc"
67#define DECL(DERIVED, BASE) \
68 static_assert(alignof(Decl) >= alignof(DERIVED##Decl), \
69 "Alignment sufficient after objects prepended to " #DERIVED);
70#define ABSTRACT_DECL(DECL)
71#include "clang/AST/DeclNodes.inc"
73void *Decl::operator
new(std::size_t Size,
const ASTContext &Context,
78 "Decl won't be misaligned");
79 void *Start = Context.
Allocate(Size + Extra + 8);
80 void *
Result = (
char*)Start + 8;
82 unsigned *PrefixPtr = (
unsigned *)
Result - 2;
88 PrefixPtr[1] = ID.get();
93void *Decl::operator
new(std::size_t Size,
const ASTContext &Ctx,
95 assert(!
Parent || &
Parent->getParentASTContext() == &Ctx);
99 if (Ctx.getLangOpts().trackLocalOwningModule() || !
Parent) {
103 llvm::offsetToAlignment(
sizeof(
Module *), llvm::Align(
alignof(
Decl)));
104 auto *Buffer =
reinterpret_cast<char *
>(
105 ::operator
new(ExtraAlign +
sizeof(
Module *) + Size + Extra, Ctx));
106 Buffer += ExtraAlign;
108 Parent ? cast<Decl>(
Parent)->getOwningModule() :
nullptr;
109 return new (Buffer)
Module*(ParentModule) + 1;
111 return ::operator
new(Size + Extra, Ctx);
114Module *Decl::getOwningModuleSlow()
const {
125 default: llvm_unreachable(
"Declaration not in DeclNodes.inc!");
126#define DECL(DERIVED, BASE) case DERIVED: return #DERIVED;
127#define ABSTRACT_DECL(DECL)
128#include "clang/AST/DeclNodes.inc"
134 assert(!isa<TagDecl>(
this) || !cast<TagDecl>(
this)->isCompleteDefinition());
139 if (!isa<ParmVarDecl>(
this)) {
148 if (
auto *DD = dyn_cast<DecompositionDecl>(
this)) {
149 for (
auto *Binding : DD->bindings()) {
150 Binding->setInvalidDecl();
157#define DECL(DERIVED, BASE) case Decl::DERIVED: return true;
158#define ABSTRACT_DECL(DECL)
159#include "clang/AST/DeclNodes.inc"
166#define DECL(DERIVED, BASE) case Decl::DERIVED: return #DERIVED;
167#define ABSTRACT_DECL(DECL)
168#include "clang/AST/DeclNodes.inc"
170 llvm_unreachable(
"Declaration context not in DeclNodes.inc!");
173bool Decl::StatisticsEnabled =
false;
175 StatisticsEnabled =
true;
179 llvm::errs() <<
"\n*** Decl Stats:\n";
182#define DECL(DERIVED, BASE) totalDecls += n##DERIVED##s;
183#define ABSTRACT_DECL(DECL)
184#include "clang/AST/DeclNodes.inc"
185 llvm::errs() <<
" " << totalDecls <<
" decls total.\n";
188#define DECL(DERIVED, BASE) \
189 if (n##DERIVED##s > 0) { \
190 totalBytes += (int)(n##DERIVED##s * sizeof(DERIVED##Decl)); \
191 llvm::errs() << " " << n##DERIVED##s << " " #DERIVED " decls, " \
192 << sizeof(DERIVED##Decl) << " each (" \
193 << n##DERIVED##s * sizeof(DERIVED##Decl) \
196#define ABSTRACT_DECL(DECL)
197#include "clang/AST/DeclNodes.inc"
199 llvm::errs() <<
"Total bytes = " << totalBytes <<
"\n";
204#define DECL(DERIVED, BASE) case DERIVED: ++n##DERIVED##s; break;
205#define ABSTRACT_DECL(DECL)
206#include "clang/AST/DeclNodes.inc"
211 if (
const auto *TTP = dyn_cast<TemplateTypeParmDecl>(
this))
212 return TTP->isParameterPack();
213 if (
const auto *NTTP = dyn_cast<NonTypeTemplateParmDecl>(
this))
214 return NTTP->isParameterPack();
215 if (
const auto *TTP = dyn_cast<TemplateTemplateParmDecl>(
this))
216 return TTP->isParameterPack();
221 if (
const auto *Var = dyn_cast<VarDecl>(
this))
222 return Var->isParameterPack();
228 if (
auto *FD = dyn_cast<FunctionDecl>(
this))
230 if (
const auto *FTD = dyn_cast<FunctionTemplateDecl>(
this))
231 return FTD->getTemplatedDecl();
236 return isa<TemplateDecl>(
this);
240 if (
auto *FD = dyn_cast<FunctionDecl>(
this))
241 return FD->getDescribedFunctionTemplate();
242 if (
auto *RD = dyn_cast<CXXRecordDecl>(
this))
243 return RD->getDescribedClassTemplate();
244 if (
auto *VD = dyn_cast<VarDecl>(
this))
245 return VD->getDescribedVarTemplate();
246 if (
auto *AD = dyn_cast<TypeAliasDecl>(
this))
247 return AD->getDescribedAliasTemplate();
254 return TD->getTemplateParameters();
255 if (
auto *CTPSD = dyn_cast<ClassTemplatePartialSpecializationDecl>(
this))
256 return CTPSD->getTemplateParameters();
257 if (
auto *VTPSD = dyn_cast<VarTemplatePartialSpecializationDecl>(
this))
258 return VTPSD->getTemplateParameters();
266 if (
auto *AsDC = dyn_cast<DeclContext>(
this))
267 return AsDC->isDependentContext();
275 if (
auto *DC = dyn_cast<DeclContext>(
this))
276 if (DC->isFileContext())
280 return TPL->getDepth() + 1;
285 auto *RD = dyn_cast<CXXRecordDecl>(
this);
286 if (RD && RD->isDependentLambda())
287 if (
Decl *Context = RD->getLambdaContextDecl())
288 return Context->getTemplateDepth();
292 return cast<Decl>(DC)->getTemplateDepth();
299 if (DC->isFunctionOrMethod())
315 TheLoc.
print(OS, SM);
321 if (
const auto *DN = dyn_cast_or_null<NamedDecl>(TheDecl)) {
323 DN->printQualifiedName(OS);
347 getMultipleDC()->LexicalDC = DC;
361 "hidden declaration has no owning module");
366 if (SemaDC == LexicalDC) {
369 auto *MDC =
new (Ctx) Decl::MultipleDC();
370 MDC->SemanticDC = SemaDC;
371 MDC->LexicalDC = LexicalDC;
383 if (!isa<TagDecl>(LDC))
385 if (
const auto *CRD = dyn_cast<CXXRecordDecl>(LDC))
395 if (
const auto *ND = dyn_cast<NamespaceDecl>(DC))
396 if (ND->isAnonymousNamespace())
409 const auto *DC = dyn_cast<DeclContext>(
this);
410 return DC && DC->isFileContext();
416 bool IgnoreTemplateOrMacroSubstitution) {
423 llvm::APInt Size = CAT->getSize();
424 if (StrictFlexArraysLevel == FAMKind::IncompleteOnly)
431 if (StrictFlexArraysLevel == FAMKind::ZeroOrIncomplete && Size.uge(1))
434 if (StrictFlexArraysLevel == FAMKind::OneZeroOrIncomplete && Size.uge(2))
440 if (
const auto *OID = dyn_cast_if_present<ObjCIvarDecl>(D))
441 return OID->getNextIvar() ==
nullptr;
443 const auto *FD = dyn_cast_if_present<FieldDecl>(D);
450 llvm::APInt Size = CAT->getSize();
451 if (FD->getParent()->isUnion() && (Size.isZero() || Size.isOne()))
457 if (IgnoreTemplateOrMacroSubstitution) {
470 if (
const Expr *SizeExpr =
471 dyn_cast_if_present<IntegerLiteral>(CTL.getSizeExpr());
483 return ++FI == FD->getParent()->field_end();
487 if (
auto *TUD = dyn_cast<TranslationUnitDecl>(
this))
491 assert(DC &&
"This decl is not contained in a translation unit!");
495 assert(DC &&
"This decl is not contained in a translation unit!");
498 return cast<TranslationUnitDecl>(DC);
523 for (; I != E; ++I) {
524 if (!I->isAlignmentErrorDependent())
525 Align = std::max(Align, I->getAlignment(Ctx));
549 if (
C.getASTMutationListener())
550 C.getASTMutationListener()->DeclarationMarkedUsed(
this);
560 for (
const auto *I :
redecls())
569 if (
auto *ID = dyn_cast<ObjCInterfaceDecl>(
this)) {
571 }
else if (
auto *PD = dyn_cast<ObjCProtocolDecl>(
this)) {
573 }
else if (
auto *TD = dyn_cast<TagDecl>(
this)) {
582 return dcd->getAttr<ExternalSourceSymbolAttr>();
589 return hasAttr<AliasAttr>() || hasAttr<IFuncAttr>() ||
590 hasAttr<LoaderUninitializedAttr>();
594 if (
auto *AA = getAttr<AliasAttr>())
596 if (
auto *IFA = getAttr<IFuncAttr>())
598 if (
auto *NZA = getAttr<LoaderUninitializedAttr>())
607 StringRef RealizedPlatform = A->getPlatform()->getName();
609 return RealizedPlatform;
610 size_t suffix = RealizedPlatform.rfind(
"_app_extension");
611 if (suffix != StringRef::npos)
612 return RealizedPlatform.slice(0, suffix);
613 return RealizedPlatform;
626 const AvailabilityAttr *A,
627 std::string *Message,
628 VersionTuple EnclosingVersion) {
629 if (EnclosingVersion.empty())
632 if (EnclosingVersion.empty())
635 StringRef ActualPlatform = A->getPlatform()->getName();
642 StringRef PrettyPlatformName
643 = AvailabilityAttr::getPrettyPlatformName(ActualPlatform);
645 if (PrettyPlatformName.empty())
646 PrettyPlatformName = ActualPlatform;
648 std::string HintMessage;
649 if (!A->getMessage().empty()) {
651 HintMessage += A->getMessage();
655 if (A->getUnavailable()) {
658 llvm::raw_string_ostream Out(*Message);
659 Out <<
"not available on " << PrettyPlatformName
667 if (!A->getIntroduced().empty() &&
668 EnclosingVersion < A->getIntroduced()) {
671 llvm::raw_string_ostream Out(*Message);
672 VersionTuple VTI(A->getIntroduced());
673 Out <<
"introduced in " << PrettyPlatformName <<
' '
674 << VTI << HintMessage;
681 if (!A->getObsoleted().empty() && EnclosingVersion >= A->getObsoleted()) {
684 llvm::raw_string_ostream Out(*Message);
685 VersionTuple VTO(A->getObsoleted());
686 Out <<
"obsoleted in " << PrettyPlatformName <<
' '
687 << VTO << HintMessage;
694 if (!A->getDeprecated().empty() && EnclosingVersion >= A->getDeprecated()) {
697 llvm::raw_string_ostream Out(*Message);
698 VersionTuple VTD(A->getDeprecated());
699 Out <<
"first deprecated in " << PrettyPlatformName <<
' '
700 << VTD << HintMessage;
710 VersionTuple EnclosingVersion,
711 StringRef *RealizedPlatform)
const {
712 if (
auto *FTD = dyn_cast<FunctionTemplateDecl>(
this))
713 return FTD->getTemplatedDecl()->getAvailability(Message, EnclosingVersion,
717 std::string ResultMessage;
719 for (
const auto *A :
attrs()) {
720 if (
const auto *Deprecated = dyn_cast<DeprecatedAttr>(A)) {
725 ResultMessage = std::string(Deprecated->getMessage());
731 if (
const auto *Unavailable = dyn_cast<UnavailableAttr>(A)) {
733 *Message = std::string(Unavailable->getMessage());
737 if (
const auto *Availability = dyn_cast<AvailabilityAttr>(A)) {
739 Message, EnclosingVersion);
742 if (RealizedPlatform)
743 *RealizedPlatform = Availability->getPlatform()->getName();
750 ResultMessage.swap(*Message);
757 Message->swap(ResultMessage);
764 for (
const auto *A :
attrs()) {
765 if (
const auto *Availability = dyn_cast<AvailabilityAttr>(A)) {
768 if (!Availability->getIntroduced().empty())
769 return Availability->getIntroduced();
776 IsDefinition =
false;
779 if (
const auto *Var = dyn_cast<VarDecl>(
this)) {
780 if (Var->isThisDeclarationADefinition()) {
787 if (
const auto *FD = dyn_cast<FunctionDecl>(
this)) {
796 if (isa<ObjCInterfaceDecl>(
this) &&
810 if (isa<WeakImportAttr>(A))
813 if (
const auto *Availability = dyn_cast<AvailabilityAttr>(A)) {
826 case CXXDeductionGuide:
829 case ConstructorUsingShadow:
847 case NonTypeTemplateParm:
854 case ObjCCompatibleAlias:
860 case TemplateTypeParm:
864 case UnresolvedUsingTypename:
870 case UnresolvedUsingValue:
882 case ObjCAtDefsField:
895 case FunctionTemplate:
899 case TemplateTemplateParm:
900 case TypeAliasTemplate:
903 case UnresolvedUsingIfExists:
906 case OMPDeclareReduction:
909 case OMPDeclareMapper:
921 case ObjCPropertyImpl:
923 case PragmaDetectMismatch:
926 case TranslationUnit:
930 case UnnamedGlobalConstant:
931 case TemplateParamObject:
934 case BuiltinTemplate:
935 case ClassTemplateSpecialization:
936 case ClassTemplatePartialSpecialization:
937 case VarTemplateSpecialization:
938 case VarTemplatePartialSpecialization:
939 case ObjCImplementation:
941 case ObjCCategoryImpl:
943 case OMPThreadPrivate:
946 case OMPCapturedExpr:
948 case LifetimeExtendedTemporary:
949 case RequiresExprBody:
950 case ImplicitConceptSpecialization:
955 llvm_unreachable(
"Invalid DeclKind!");
959 assert(!HasAttrs &&
"Decl already contains attrs.");
962 assert(AttrBlank.empty() &&
"HasAttrs was wrong?");
969 if (!HasAttrs)
return;
990 auto I = Attrs.begin(), E = Attrs.end();
991 for (; I != E; ++I) {
992 if (!(*I)->isInherited())
999 assert(HasAttrs &&
"No attrs to get!");
1006#define DECL(NAME, BASE)
1007#define DECL_CONTEXT(NAME) \
1009 return static_cast<NAME##Decl *>(const_cast<DeclContext *>(D));
1010#include "clang/AST/DeclNodes.inc"
1012 llvm_unreachable(
"a decl that inherits DeclContext isn't handled");
1019#define DECL(NAME, BASE)
1020#define DECL_CONTEXT(NAME) \
1022 return static_cast<NAME##Decl *>(const_cast<Decl *>(D));
1023#include "clang/AST/DeclNodes.inc"
1025 llvm_unreachable(
"a decl that inherits DeclContext isn't handled");
1032 if (
const auto *FD = dyn_cast<FunctionDecl>(
this)) {
1035 return Definition->getSourceRange().getEnd();
1040 return Body->getSourceRange().getEnd();
1045bool Decl::AccessDeclContextCheck()
const {
1056 if (isa<TranslationUnitDecl>(
this) || isa<TemplateTypeParmDecl>(
this) ||
1059 isa<StaticAssertDecl>(
this) || isa<BlockDecl>(
this) ||
1062 isa<ParmVarDecl>(
this) ||
1065 isa<CXXRecordDecl>(
this) || isa<LifetimeExtendedTemporaryDecl>(
this))
1069 "Access specifier is AS_none inside a record decl");
1077 while (DC && !isa<ExportDecl>(DC))
1080 return DC && isa<ExportDecl>(DC);
1089 M = M->getTopLevelModule();
1093 if (M->isHeaderLikeModule())
1098 if (M->isGlobalModule())
1101 assert(M->isNamedModule() &&
"New module kind?");
1118 if (isa<BindingDecl>(
this))
1120 else if (
const auto *D = dyn_cast<ValueDecl>(
this))
1122 else if (
const auto *D = dyn_cast<TypedefNameDecl>(
this))
1123 Ty = D->getUnderlyingType();
1139 if (
const auto *D = dyn_cast<ValueDecl>(
this))
1141 else if (
const auto *D = dyn_cast<TypedefNameDecl>(
this))
1142 Ty = D->getUnderlyingType();
1157 if (
getKind(D) == Decl::CXXMethod) {
1158 auto *MD = cast<CXXMethodDecl>(D);
1159 if (MD->getOverloadedOperator() == OO_Call &&
1160 MD->getParent()->isLambda())
1164 if (
auto *FD = dyn_cast<FunctionDecl>(D))
1166 if (
auto *MD = dyn_cast<ObjCMethodDecl>(D))
1168 if (
auto *BD = dyn_cast<BlockDecl>(D))
1170 if (
auto *CD = dyn_cast<CapturedDecl>(D))
1176 return ::getNonClosureContext(
this);
1180 return ::getNonClosureContext(
this);
1191 setNeedToReconcileExternalVisibleStorage(
false);
1192 setHasLazyLocalLexicalLookups(
false);
1193 setHasLazyExternalLexicalLookups(
false);
1200#define DECL(NAME, BASE)
1201#define DECL_CONTEXT(NAME) case Decl::NAME:
1202#include "clang/AST/DeclNodes.inc"
1219 if (isa<FunctionDecl>(
this))
1238 return cast<BlockDecl>(Ctx);
1247 cast<NamespaceDecl>(
this)->isInline();
1254 const auto *ND = cast<NamespaceDecl>(
this);
1255 if (ND->isInline()) {
1256 return ND->getParent()->isStdNamespace();
1263 return II && II->
isStr(
"std");
1270 if (isa<ClassTemplatePartialSpecializationDecl>(
this))
1273 if (
const auto *
Record = dyn_cast<CXXRecordDecl>(
this)) {
1274 if (
Record->getDescribedClassTemplate())
1277 if (
Record->isDependentLambda())
1279 if (
Record->isNeverDependentLambda())
1283 if (
const auto *
Function = dyn_cast<FunctionDecl>(
this)) {
1284 if (
Function->getDescribedFunctionTemplate())
1289 if (cast<Decl>(
this)->getFriendObjectKind())
1302 return !cast<EnumDecl>(
this)->isScoped();
1304 return isa<LinkageSpecDecl, ExportDecl, HLSLBufferDecl>(
this);
1309 while (DC->
getDeclKind() != Decl::TranslationUnit) {
1311 return cast<LinkageSpecDecl>(DC)->getLanguage() == ID;
1323 while (DC->
getDeclKind() != Decl::TranslationUnit) {
1326 return cast<LinkageSpecDecl>(DC);
1341 if (!isa<LinkageSpecDecl>(DC) && !isa<ExportDecl>(DC) &&
1351 assert(DC &&
"All transparent contexts should have a parent!");
1358 case Decl::ExternCContext:
1359 case Decl::LinkageSpec:
1361 case Decl::TopLevelStmt:
1363 case Decl::Captured:
1364 case Decl::OMPDeclareReduction:
1365 case Decl::OMPDeclareMapper:
1366 case Decl::RequiresExprBody:
1370 case Decl::HLSLBuffer:
1379 case Decl::TranslationUnit:
1381 case Decl::Namespace:
1383 return static_cast<NamespaceDecl *
>(
this)->getOriginalNamespace();
1385 case Decl::ObjCMethod:
1388 case Decl::ObjCInterface:
1389 if (
auto *OID = dyn_cast<ObjCInterfaceDecl>(
this))
1390 if (
auto *Def = OID->getDefinition())
1394 case Decl::ObjCProtocol:
1395 if (
auto *OPD = dyn_cast<ObjCProtocolDecl>(
this))
1396 if (
auto *Def = OPD->getDefinition())
1400 case Decl::ObjCCategory:
1403 case Decl::ObjCImplementation:
1404 case Decl::ObjCCategoryImpl:
1411 auto *Tag = cast<TagDecl>(
this);
1416 if (
const auto *TagTy = dyn_cast<TagType>(Tag->getTypeForDecl())) {
1418 TagDecl *PossiblePartialDef = TagTy->getDecl();
1420 return PossiblePartialDef;
1422 assert(isa<InjectedClassNameType>(Tag->getTypeForDecl()));
1430 "Unknown DeclContext kind");
1435template <
typename T>
1437 for (
T *D =
Self->getMostRecentDecl(); D; D = D->getPreviousDecl())
1438 Contexts.push_back(D);
1440 std::reverse(Contexts.begin(), Contexts.end());
1448 if (Kind == Decl::TranslationUnit)
1450 else if (Kind == Decl::Namespace)
1453 Contexts.push_back(
this);
1456std::pair<Decl *, Decl *>
1458 bool FieldsAlreadyLoaded) {
1460 Decl *FirstNewDecl =
nullptr;
1461 Decl *PrevDecl =
nullptr;
1462 for (
auto *D : Decls) {
1463 if (FieldsAlreadyLoaded && isa<FieldDecl>(D))
1474 return std::make_pair(FirstNewDecl, PrevDecl);
1480void DeclContext::reconcileExternalVisibleStorage()
const {
1481 assert(hasNeedToReconcileExternalVisibleStorage() && LookupPtr);
1482 setNeedToReconcileExternalVisibleStorage(
false);
1484 for (
auto &Lookup : *LookupPtr)
1485 Lookup.second.setHasExternalDecls();
1492DeclContext::LoadLexicalDeclsFromExternalStorage()
const {
1509 bool FieldsAlreadyLoaded =
false;
1510 if (
const auto *RD = dyn_cast<RecordDecl>(
this))
1511 FieldsAlreadyLoaded = RD->hasLoadedFieldsFromExternalStorage();
1515 Decl *ExternalFirst, *ExternalLast;
1516 std::tie(ExternalFirst, ExternalLast) =
1530 if (!(Map = DC->LookupPtr))
1531 Map = DC->CreateStoredDeclsMap(Context);
1532 if (DC->hasNeedToReconcileExternalVisibleStorage())
1533 DC->reconcileExternalVisibleStorage();
1535 (*Map)[Name].removeExternalDecls();
1546 if (!(Map = DC->LookupPtr))
1547 Map = DC->CreateStoredDeclsMap(Context);
1548 if (DC->hasNeedToReconcileExternalVisibleStorage())
1549 DC->reconcileExternalVisibleStorage();
1552 List.replaceExternalDecls(Decls);
1553 return List.getLookupResult();
1558 LoadLexicalDeclsFromExternalStorage();
1564 LoadLexicalDeclsFromExternalStorage();
1576 LoadLexicalDeclsFromExternalStorage();
1603 if (isa<ClassTemplateSpecializationDecl>(D))
1605 if (
auto *FD = dyn_cast<FunctionDecl>(D))
1606 if (FD->isFunctionTemplateSpecialization())
1621 "decl being removed from non-lexical context");
1623 "decl is not in decls list");
1633 assert(I &&
"decl not found in linked list");
1634 if (I->NextInContextAndBits.getPointer() == D) {
1646 if (isa<NamedDecl>(D)) {
1647 auto *ND = cast<NamedDecl>(D);
1655 if (!ND->getDeclName())
1662 StoredDeclsMap::iterator Pos = Map->find(ND->getDeclName());
1663 assert(Pos != Map->end() &&
"no lookup entry for decl");
1670 }
while (DC->isTransparentContext() && (DC = DC->getParent()));
1676 "Decl inserted into wrong lexical context");
1678 "Decl already inserted into a DeclContext");
1689 if (
auto *
Record = dyn_cast<CXXRecordDecl>(
this))
1695 if (
auto *Import = dyn_cast<ImportDecl>(D))
1703 if (
auto *ND = dyn_cast<NamedDecl>(D))
1704 ND->getDeclContext()->getPrimaryContext()->
1705 makeDeclVisibleInContextWithFlags(ND,
false,
true);
1711 if (
auto *ND = dyn_cast<NamedDecl>(D))
1712 ND->getDeclContext()->getPrimaryContext()->
1713 makeDeclVisibleInContextWithFlags(ND,
true,
true);
1726 if (!hasLazyLocalLexicalLookups() &&
1727 !hasLazyExternalLexicalLookups())
1733 if (hasLazyExternalLexicalLookups()) {
1734 setHasLazyExternalLexicalLookups(
false);
1735 for (
auto *DC : Contexts) {
1736 if (DC->hasExternalLexicalStorage()) {
1737 bool LoadedDecls = DC->LoadLexicalDeclsFromExternalStorage();
1738 setHasLazyLocalLexicalLookups(
1739 hasLazyLocalLexicalLookups() | LoadedDecls );
1743 if (!hasLazyLocalLexicalLookups())
1747 for (
auto *DC : Contexts)
1751 setHasLazyLocalLexicalLookups(
false);
1769 if (
auto *ND = dyn_cast<NamedDecl>(D))
1771 (!ND->isFromASTFile() ||
1774 makeDeclVisibleInContextImpl(ND,
Internal);
1779 if (
auto *InnerCtx = dyn_cast<DeclContext>(D))
1780 if (InnerCtx->isTransparentContext() || InnerCtx->isInlineNamespace())
1781 buildLookupImpl(InnerCtx,
Internal);
1792 if (PrimaryContext !=
this)
1793 return PrimaryContext->
lookup(Name);
1800 (void)cast<Decl>(
this)->getMostRecentDecl();
1803 assert(Source &&
"external visible storage but no external source?");
1805 if (hasNeedToReconcileExternalVisibleStorage())
1806 reconcileExternalVisibleStorage();
1810 if (hasLazyLocalLexicalLookups() ||
1811 hasLazyExternalLexicalLookups())
1819 std::pair<StoredDeclsMap::iterator, bool> R =
1821 if (!R.second && !R.first->second.hasExternalDecls())
1822 return R.first->second.getLookupResult();
1826 StoredDeclsMap::iterator I = Map->find(Name);
1827 if (I != Map->end())
1828 return I->second.getLookupResult();
1836 if (hasLazyLocalLexicalLookups() ||
1837 hasLazyExternalLexicalLookups())
1843 StoredDeclsMap::iterator I = Map->find(Name);
1844 if (I == Map->end())
1847 return I->second.getLookupResult();
1857 if (PrimaryContext !=
this)
1860 loadLazyLocalLexicalLookups();
1865 StoredDeclsMap::iterator I = Map->find(Name);
1866 return I != Map->end() ? I->second.getLookupResult()
1873void DeclContext::loadLazyLocalLexicalLookups() {
1874 if (hasLazyLocalLexicalLookups()) {
1877 for (
auto *Context : Contexts)
1879 setHasLazyLocalLexicalLookups(
false);
1891 Results.insert(Results.end(), LookupResults.
begin(), LookupResults.
end());
1892 if (!Results.empty())
1898 if (Name && !hasLazyLocalLexicalLookups() &&
1899 !hasLazyExternalLexicalLookups()) {
1901 StoredDeclsMap::iterator Pos = Map->find(Name);
1902 if (Pos != Map->end()) {
1903 Results.insert(Results.end(),
1904 Pos->second.getLookupResult().begin(),
1905 Pos->second.getLookupResult().end());
1916 if (
auto *ND = dyn_cast<NamedDecl>(D))
1917 if (ND->getDeclName() == Name)
1918 Results.push_back(ND);
1930 bool SkipRecords =
getDeclKind() == Decl::Kind::Enum &&
1953 OutermostRD = cast<RecordDecl>(DC);
1968 const auto *NS = dyn_cast<NamespaceDecl>(O);
1969 if (!NS || !NS->isInline())
1982 PrimaryDC->makeDeclVisibleInContextWithFlags(D,
false, PrimaryDC == DeclDC);
1992 ->makeDeclVisibleInContextWithFlags(D,
Internal, Recoverable);
2016 makeDeclVisibleInContextImpl(D,
Internal);
2018 setHasLazyLocalLexicalLookups(
true);
2025 makeDeclVisibleInContextWithFlags(D,
Internal, Recoverable);
2027 auto *DCAsDecl = cast<Decl>(
this);
2029 if (!(isa<TagDecl>(DCAsDecl) && cast<TagDecl>(DCAsDecl)->isBeingDefined()))
2031 L->AddedVisibleDecl(
this, D);
2039 Map = CreateStoredDeclsMap(*
C);
2069 return cast<UsingDirectiveDecl>(*I);
2086 assert(!LookupPtr &&
"context already has a decls map");
2088 "creating decls map on non-primary context");
2096 M->Previous =
C.LastSDM;
2097 C.LastSDM = llvm::PointerIntPair<StoredDeclsMap*,1>(M, Dependent);
2102void ASTContext::ReleaseDeclContextMaps() {
2107 LastSDM.setPointer(
nullptr);
2113 llvm::PointerIntPair<StoredDeclsMap*,1> Next = Map->Previous;
2120 Map = Next.getPointer();
2121 Dependent = Next.getInt();
2128 assert(
Parent->isDependentContext()
2129 &&
"cannot iterate dependent diagnostics of non-dependent context");
2132 Parent->CreateStoredDeclsMap(
C);
2145 DD->NextDiagnostic = Map->FirstDiagnostic;
2146 Map->FirstDiagnostic = DD;
Defines the clang::ASTContext interface.
This file provides some common utility functions for processing Lambda related AST Constructs.
static bool shouldBeHidden(NamedDecl *D)
shouldBeHidden - Determine whether a declaration which was declared within its semantic context shoul...
static bool isLinkageSpecContext(const DeclContext *DC, LinkageSpecLanguageIDs ID)
static Decl::Kind getKind(const Decl *D)
static Decl * getNonClosureContext(T *D)
Starting at a given context (a Decl or DeclContext), look for a code context that is not a closure (a...
static AvailabilityResult CheckAvailability(ASTContext &Context, const AvailabilityAttr *A, std::string *Message, VersionTuple EnclosingVersion)
Determine the availability of the given declaration based on the target platform.
void collectAllContextsImpl(T *Self, SmallVectorImpl< DeclContext * > &Contexts)
static StringRef getRealizedPlatform(const AvailabilityAttr *A, const ASTContext &Context)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
This file defines OpenMP nodes for declarative directives.
Defines the C++ template declaration subclasses.
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
llvm::MachO::Record Record
Defines the clang::Module class, which describes a module in the source code.
Defines types useful for describing an Objective-C runtime.
Implements a partial diagnostic that can be emitted anwyhere in a DiagnosticBuilder stream.
Defines the clang::SourceLocation class and associated facilities.
C Language Family Type Representation.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const ConstantArrayType * getAsConstantArrayType(QualType T) const
ASTMutationListener * getASTMutationListener() const
Retrieve a pointer to the AST mutation listener associated with this AST context, if any.
const IncompleteArrayType * getAsIncompleteArrayType(QualType T) const
const LangOptions & getLangOpts() const
llvm::BumpPtrAllocator & getAllocator() const
void eraseDeclAttrs(const Decl *D)
Erase the attributes corresponding to the given declaration.
void addedLocalImportDecl(ImportDecl *Import)
Notify the AST context that a new import declaration has been parsed or implicitly created within thi...
void * Allocate(size_t Size, unsigned Align=8) const
const TargetInfo & getTargetInfo() const
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any.
Module * getCurrentNamedModule() const
Get module under construction, nullptr if this is not a C++20 module.
AttrVec & getDeclAttrs(const Decl *D)
Retrieve the attributes for the given declaration.
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
Attr - This represents one attribute.
Represents a block literal declaration, which is like an unnamed FunctionDecl.
The results of name lookup within a DeclContext.
decl_iterator - Iterates through the declarations stored within this context.
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext,...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
DeclContext * getParent()
getParent - Returns the containing DeclContext.
udir_range using_directives() const
Returns iterator range [First, Last) of UsingDirectiveDecls stored within this context.
bool Equals(const DeclContext *DC) const
Determine whether this declaration context is equivalent to the declaration context DC.
bool isFileContext() const
void setHasExternalVisibleStorage(bool ES=true) const
State whether this DeclContext has external storage for declarations visible in this context.
void makeDeclVisibleInContext(NamedDecl *D)
Makes a declaration visible within this context.
DeclContextLookupResult lookup_result
static std::pair< Decl *, Decl * > BuildDeclChain(ArrayRef< Decl * > Decls, bool FieldsAlreadyLoaded)
Build up a chain of declarations.
bool isTransparentContext() const
isTransparentContext - Determines whether this context is a "transparent" context,...
Decl * getNonClosureAncestor()
Find the nearest non-closure ancestor of this context, i.e.
ASTContext & getParentASTContext() const
bool isExternCXXContext() const
Determines whether this context or some of its ancestors is a linkage specification context that spec...
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
bool InEnclosingNamespaceSetOf(const DeclContext *NS) const
Test if this context is part of the enclosing namespace set of the context NS, as defined in C++0x [n...
DeclContext * getLexicalParent()
getLexicalParent - Returns the containing lexical DeclContext.
lookup_result lookup(DeclarationName Name) const
lookup - Find the declarations (if any) with the given Name in this context.
bool isLookupContext() const
Test whether the context supports looking up names.
const BlockDecl * getInnermostBlockDecl() const
Return this DeclContext if it is a BlockDecl.
bool hasExternalVisibleStorage() const
Whether this DeclContext has external storage containing additional declarations that are visible in ...
const char * getDeclKindName() const
bool isTranslationUnit() const
void collectAllContexts(SmallVectorImpl< DeclContext * > &Contexts)
Collects all of the declaration contexts that are semantically connected to this declaration context.
DeclContext * getRedeclContext()
getRedeclContext - Retrieve the context in which an entity conflicts with other entities of the same ...
llvm::iterator_range< udir_iterator > udir_range
Decl * FirstDecl
FirstDecl - The first declaration stored within this declaration context.
DeclContext(Decl::Kind K)
void addDeclInternal(Decl *D)
Add the declaration D into this context, but suppress searches for external declarations with the sam...
bool containsDeclAndLoad(Decl *D) const
Checks whether a declaration is in this context.
void removeDecl(Decl *D)
Removes a declaration from this context.
void addDecl(Decl *D)
Add the declaration D into this context.
StoredDeclsMap * buildLookup()
Ensure the lookup structure is fully-built and return it.
bool hasValidDeclKind() const
bool isStdNamespace() const
lookup_result noload_lookup(DeclarationName Name)
Find the declarations with the given name that are visible within this context; don't attempt to retr...
static bool classof(const Decl *D)
bool containsDecl(Decl *D) const
Checks whether a declaration is in this context.
bool hasExternalLexicalStorage() const
Whether this DeclContext has external storage containing additional declarations that are lexically i...
void setUseQualifiedLookup(bool use=true) const
DeclContext * getEnclosingNamespaceContext()
Retrieve the nearest enclosing namespace context.
Decl * LastDecl
LastDecl - The last declaration stored within this declaration context.
decl_range noload_decls() const
noload_decls_begin/end - Iterate over the declarations stored in this context that are currently load...
friend class DependentDiagnostic
For CreateStoredDeclsMap.
DeclContext * getPrimaryContext()
getPrimaryContext - There may be many different declarations of the same entity (including forward de...
RecordDecl * getOuterLexicalRecordContext()
Retrieve the outermost lexically enclosing record context.
bool isInlineNamespace() const
DeclContextBitfields DeclContextBits
bool isFunctionOrMethod() const
void setHasExternalLexicalStorage(bool ES=true) const
State whether this DeclContext has external storage for declarations lexically in this context.
DeclContext * getLookupParent()
Find the parent context of this context that will be used for unqualified name lookup.
bool isExternCContext() const
Determines whether this context or some of its ancestors is a linkage specification context that spec...
const LinkageSpecDecl * getExternCContext() const
Retrieve the nearest enclosing C linkage specification context.
bool Encloses(const DeclContext *DC) const
Determine whether this declaration context encloses the declaration context DC.
void addHiddenDecl(Decl *D)
Add the declaration D to this context without modifying any lookup tables.
void localUncachedLookup(DeclarationName Name, SmallVectorImpl< NamedDecl * > &Results)
A simplistic name lookup mechanism that performs name lookup into this declaration context without co...
Decl::Kind getDeclKind() const
DeclContext * getNonTransparentContext()
decl_iterator decls_begin() const
Decl - This represents one declaration (or definition), e.g.
Decl * getMostRecentDecl()
Retrieve the most recent declaration that declares the same entity as this declaration (which may be ...
const DeclContext * getParentFunctionOrMethod(bool LexicalParent=false) const
If this decl is defined inside a function/method/block it returns the corresponding DeclContext,...
bool isInStdNamespace() const
TemplateDecl * getDescribedTemplate() const
If this is a declaration that describes some template, this method returns that template declaration.
unsigned getOwningModuleID() const
Retrieve the global ID of the module that owns this particular declaration.
bool isTemplateDecl() const
returns true if this declaration is a template
FriendObjectKind getFriendObjectKind() const
Determines whether this declaration is the object of a friend declaration and, if so,...
ASTContext & getASTContext() const LLVM_READONLY
void setAttrs(const AttrVec &Attrs)
bool hasLocalOwningModuleStorage() const
bool isFunctionPointerType() const
ExternalSourceSymbolAttr * getExternalSourceSymbolAttr() const
Looks on this and related declarations for an applicable external source symbol attribute.
bool isWeakImported() const
Determine whether this is a weak-imported symbol.
ModuleOwnershipKind getModuleOwnershipKind() const
Get the kind of module ownership for this declaration.
bool isParameterPack() const
Whether this declaration is a parameter pack.
ASTMutationListener * getASTMutationListener() const
unsigned getMaxAlignment() const
getMaxAlignment - return the maximum alignment specified by attributes on this decl,...
AvailabilityResult getAvailability(std::string *Message=nullptr, VersionTuple EnclosingVersion=VersionTuple(), StringRef *RealizedPlatform=nullptr) const
Determine the availability of the given declaration.
void setInvalidDecl(bool Invalid=true)
setInvalidDecl - Indicates the Decl had a semantic error.
Kind
Lists the kind of concrete classes of Decl.
static unsigned getIdentifierNamespaceForKind(Kind DK)
virtual Stmt * getBody() const
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
void markUsed(ASTContext &C)
Mark the declaration used, in the sense of odr-use.
bool isFileContextDecl() const
static Decl * castFromDeclContext(const DeclContext *)
Decl * getNextDeclInContext()
bool isTemplated() const
Determine whether this declaration is a templated entity (whether it is.
bool isInExportDeclContext() const
Whether this declaration was exported in a lexical context.
SourceLocation getBodyRBrace() const
getBodyRBrace - Gets the right brace of the body, if a body exists.
bool isReferenced() const
Whether any declaration of this entity was referenced.
const FunctionType * getFunctionType(bool BlocksToo=true) const
Looks through the Decl's underlying type to extract a FunctionType when possible.
bool isInAnotherModuleUnit() const
Whether this declaration comes from another module unit.
llvm::PointerIntPair< Decl *, 3, ModuleOwnershipKind > NextInContextAndBits
The next declaration within the same lexical DeclContext.
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
unsigned getTemplateDepth() const
Determine the number of levels of template parameter surrounding this declaration.
bool isFromExplicitGlobalModule() const
Whether this declaration comes from explicit global module.
FunctionDecl * getAsFunction() LLVM_READONLY
Returns the function itself, or the templated function if this is a function template.
bool canBeWeakImported(bool &IsDefinition) const
Determines whether this symbol can be weak-imported, e.g., whether it would be well-formed to add the...
static DeclContext * castToDeclContext(const Decl *)
const TemplateParameterList * getDescribedTemplateParams() const
If this is a declaration that describes some template or partial specialization, this returns the cor...
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
bool isInLocalScopeForInstantiation() const
Determine whether a substitution into this declaration would occur as part of a substitution into a d...
const Attr * getDefiningAttr() const
Return this declaration's defining attribute if it has one.
bool isTemplateParameter() const
isTemplateParameter - Determines whether this declaration is a template parameter.
DeclContext * getNonTransparentDeclContext()
Return the non transparent context.
Decl * getNonClosureContext()
Find the innermost non-closure ancestor of this declaration, walking up through blocks,...
bool isInvalidDecl() const
unsigned getIdentifierNamespace() const
bool hasDefiningAttr() const
Return true if this declaration has an attribute which acts as definition of the entity,...
bool isLocalExternDecl() const
Determine whether this is a block-scope declaration with linkage.
void setAccess(AccessSpecifier AS)
SourceLocation getLocation() const
const char * getDeclKindName() const
@ IDNS_Ordinary
Ordinary names.
@ IDNS_Type
Types, declared with 'struct foo', typedefs, etc.
@ IDNS_OMPReduction
This declaration is an OpenMP user defined reduction construction.
@ IDNS_Label
Labels, declared with 'x:' and referenced with 'goto x'.
@ IDNS_Member
Members, declared with object declarations within tag definitions.
@ IDNS_OMPMapper
This declaration is an OpenMP user defined mapper.
@ IDNS_ObjCProtocol
Objective C @protocol.
@ IDNS_Namespace
Namespaces, declared with 'namespace foo {}'.
@ IDNS_Using
This declaration is a using declaration.
@ IDNS_Tag
Tags, declared with 'struct foo;' and referenced with 'struct foo'.
bool isTemplateParameterPack() const
isTemplateParameter - Determines whether this declaration is a template parameter pack.
void setLocalOwningModule(Module *M)
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
void setIsUsed()
Set whether the declaration is used, in the sense of odr-use.
unsigned Access
Access - Used by C++ decls for the access specifier.
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required.
DeclContext * getDeclContext()
bool isInAnonymousNamespace() const
static void EnableStatistics()
TranslationUnitDecl * getTranslationUnitDecl()
VersionTuple getVersionIntroduced() const
Retrieve the version of the target platform in which this declaration was introduced.
bool hasOwningModule() const
Is this declaration owned by some module?
void updateOutOfDate(IdentifierInfo &II) const
Update a potentially out-of-date declaration.
static bool isFlexibleArrayMemberLike(ASTContext &Context, const Decl *D, QualType Ty, LangOptions::StrictFlexArraysLevelKind StrictFlexArraysLevel, bool IgnoreTemplateOrMacroSubstitution)
Whether it resembles a flexible array member.
void setDeclContext(DeclContext *DC)
setDeclContext - Set both the semantic and lexical DeclContext to DC.
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
void setLexicalDeclContext(DeclContext *DC)
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
@ VisibleWhenImported
This declaration has an owning module, and is visible when that module is imported.
void setModuleOwnershipKind(ModuleOwnershipKind MOK)
Set whether this declaration is hidden from name lookup.
const LangOptions & getLangOpts() const LLVM_READONLY
Helper to get the language options from the ASTContext.
The name of a declaration.
A dependently-generated diagnostic.
static DependentDiagnostic * Create(ASTContext &Context, DeclContext *Parent, AccessNonce _, SourceLocation Loc, bool IsMemberAccess, AccessSpecifier AS, NamedDecl *TargetDecl, CXXRecordDecl *NamingClass, QualType BaseObjectType, const PartialDiagnostic &PDiag)
This represents one expression.
SourceLocation getExprLoc() const LLVM_READONLY
getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...
RAII class for safely pairing a StartedDeserializing call with FinishedDeserializing.
Abstract interface for external sources of AST nodes.
static DeclContextLookupResult SetExternalVisibleDeclsForName(const DeclContext *DC, DeclarationName Name, ArrayRef< NamedDecl * > Decls)
static DeclContextLookupResult SetNoExternalVisibleDeclsForName(const DeclContext *DC, DeclarationName Name)
virtual Module * getModule(unsigned ID)
Retrieve the module that corresponds to the given module ID.
virtual bool FindExternalVisibleDeclsByName(const DeclContext *DC, DeclarationName Name)
Find all declarations with the given name in the given context, and add them to the context by callin...
virtual void updateOutOfDateIdentifier(const IdentifierInfo &II)
Update an out-of-date identifier.
virtual void FindExternalLexicalDecls(const DeclContext *DC, llvm::function_ref< bool(Decl::Kind)> IsKindWeWant, SmallVectorImpl< Decl * > &Result)
Finds all declarations lexically contained within the given DeclContext, after applying an optional f...
Represents a member of a struct/union/class.
Represents a function declaration or definition.
FunctionType - C99 6.7.5.3 - Function Declarators.
One of these records is kept for each identifier that is lexed.
bool isStr(const char(&Str)[StrLen]) const
Return true if this is the identifier for the specified string.
StrictFlexArraysLevelKind
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
bool trackLocalOwningModule() const
Do we need to track the owning module for a local declaration?
Represents a linkage specification.
Describes a module or submodule.
bool isExplicitGlobalModule() const
This represents a decl that may have a name.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Represent a C++ namespace.
The basic abstraction for the target Objective-C runtime.
bool hasWeakClassImport() const
Does this runtime support weakly importing classes?
PointerType - C99 6.7.5.1 - Pointer Declarators.
void print(raw_ostream &OS) const override
A (possibly-)qualified type.
QualType getCanonicalType() const
Represents a struct/union/class.
Base for LValueReferenceType and RValueReferenceType.
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
void print(raw_ostream &OS, const SourceManager &SM) const
Stmt - This represents one statement.
An array of decls optimized for the common case of only containing one entry.
void setHasExternalDecls()
void addOrReplaceDecl(NamedDecl *D)
If this is a redeclaration of an existing decl, replace the old one with D.
void prependDeclNoReplace(NamedDecl *D)
Add a declaration to the list without checking if it replaces anything.
static void DestroyAll(StoredDeclsMap *Map, bool Dependent)
Represents the declaration of a struct/union/class/enum.
bool isBeingDefined() const
Return true if this decl is currently being defined.
TagDecl * getDefinition() const
Returns the TagDecl that actually defines this struct/union/class/enum.
StringRef getPlatformName() const
Retrieve the name of the platform as it is used in the availability attribute.
VersionTuple getPlatformMinVersion() const
Retrieve the minimum desired version of the platform, to which the program should be compiled.
The base class of all kinds of template declarations (e.g., class, function, etc.).
Stores a list of template parameters for a TemplateDecl and its derived classes.
The top declaration context.
ASTContext & getASTContext() const
Base wrapper for a particular "section" of type source info.
T getAs() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
T getAsAdjusted() const
Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...
A container of type source information.
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
bool isBlockPointerType() const
bool isFunctionReferenceType() const
bool isFunctionPointerType() const
const T * castAs() const
Member-template castAs<specific type>.
const T * getAs() const
Member-template getAs<specific type>'.
Base class for declarations which introduce a typedef-name.
TypeSourceInfo * getTypeSourceInfo() const
Wrapper for source info for typedefs.
Represents C++ using-directive.
specific_attr_iterator - Iterates over a subrange of an AttrVec, only providing attributes that are o...
Defines the clang::TargetInfo interface.
const internal::VariadicAllOfMatcher< Attr > attr
Matches attributes.
The JSON file list parser is used to communicate input to InstallAPI.
@ Self
'self' clause, allowed on Compute and Combined Constructs, plus 'update'.
SmallVector< Attr *, 4 > AttrVec
AttrVec - A vector of Attr, which is how they are stored on the AST.
LinkageSpecLanguageIDs
Represents the language in a linkage specification.
@ Internal
Internal linkage, which indicates that the entity can be referred to from within the translation unit...
bool isLambdaCallOperator(const CXXMethodDecl *MD)
@ Result
The result type of a method or function.
AvailabilityResult
Captures the result of checking the availability of a declaration.
const FunctionProtoType * T
@ Enum
The "enum" keyword introduces the elaborated-type-specifier.
UsingDirectiveDecl * operator*() const