16 #ifndef LLVM_CLANG_AST_DECLCXX_H 17 #define LLVM_CLANG_AST_DECLCXX_H 39 #include "llvm/ADT/ArrayRef.h" 40 #include "llvm/ADT/DenseMap.h" 41 #include "llvm/ADT/PointerIntPair.h" 42 #include "llvm/ADT/PointerUnion.h" 43 #include "llvm/ADT/STLExtras.h" 44 #include "llvm/ADT/iterator_range.h" 45 #include "llvm/Support/Casting.h" 46 #include "llvm/Support/Compiler.h" 47 #include "llvm/Support/PointerLikeTypeTraits.h" 48 #include "llvm/Support/TrailingObjects.h" 57 class ClassTemplateDecl;
58 class ConstructorUsingShadowDecl;
61 class CXXConstructorDecl;
62 class CXXDestructorDecl;
63 class CXXFinalOverriderMap;
64 class CXXIndirectPrimaryBaseSet;
66 class DiagnosticBuilder;
68 class FunctionTemplateDecl;
70 class MemberSpecializationInfo;
72 class TemplateParameterList;
110 return ::clang::AnyFunctionDecl::getFromNamedDecl(
111 static_cast< ::clang::NamedDecl*>(P));
114 enum { NumLowBitsAvailable = 2 };
143 virtual void anchor();
202 unsigned Virtual : 1;
208 unsigned BaseOfClass : 1;
218 unsigned InheritConstructors : 1;
230 : Range(R), EllipsisLoc(EllipsisLoc), Virtual(V), BaseOfClass(BC),
231 Access(A), InheritConstructors(
false), BaseTypeInfo(TInfo) {}
258 InheritConstructors = Inherit;
313 enum SpecialMemberFlags {
314 SMF_DefaultConstructor = 0x1,
315 SMF_CopyConstructor = 0x2,
316 SMF_MoveConstructor = 0x4,
317 SMF_CopyAssignment = 0x8,
318 SMF_MoveAssignment = 0x10,
319 SMF_Destructor = 0x20,
323 struct DefinitionData {
325 unsigned UserDeclaredConstructor : 1;
328 unsigned UserDeclaredSpecialMembers : 6;
331 unsigned Aggregate : 1;
334 unsigned PlainOldData : 1;
344 unsigned Polymorphic : 1;
348 unsigned Abstract : 1;
364 unsigned IsStandardLayout : 1;
370 unsigned HasNoNonEmptyBases : 1;
373 unsigned HasPrivateFields : 1;
376 unsigned HasProtectedFields : 1;
379 unsigned HasPublicFields : 1;
382 unsigned HasMutableFields : 1;
386 unsigned HasVariantMembers : 1;
389 unsigned HasOnlyCMembers : 1;
393 unsigned HasInClassInitializer : 1;
400 unsigned HasUninitializedReferenceMember : 1;
404 unsigned HasUninitializedFields : 1;
408 unsigned HasInheritedConstructor : 1;
412 unsigned HasInheritedAssignment : 1;
417 unsigned NeedOverloadResolutionForCopyConstructor : 1;
418 unsigned NeedOverloadResolutionForMoveConstructor : 1;
419 unsigned NeedOverloadResolutionForMoveAssignment : 1;
420 unsigned NeedOverloadResolutionForDestructor : 1;
426 unsigned DefaultedCopyConstructorIsDeleted : 1;
427 unsigned DefaultedMoveConstructorIsDeleted : 1;
428 unsigned DefaultedMoveAssignmentIsDeleted : 1;
429 unsigned DefaultedDestructorIsDeleted : 1;
438 unsigned HasTrivialSpecialMembers : 6;
446 unsigned DeclaredNonTrivialSpecialMembers : 6;
449 unsigned HasIrrelevantDestructor : 1;
453 unsigned HasConstexprNonCopyMoveConstructor : 1;
457 unsigned HasDefaultedDefaultConstructor : 1;
463 unsigned CanPassInRegisters : 1;
467 unsigned DefaultedDefaultConstructorIsConstexpr : 1;
473 unsigned HasConstexprDefaultConstructor : 1;
477 unsigned HasNonLiteralTypeFieldsOrBases : 1;
481 unsigned ComputedVisibleConversions : 1;
485 unsigned UserProvidedDefaultConstructor : 1;
489 unsigned DeclaredSpecialMembers : 6;
493 unsigned ImplicitCopyConstructorCanHaveConstParamForVBase : 1;
494 unsigned ImplicitCopyConstructorCanHaveConstParamForNonVBase : 1;
498 unsigned ImplicitCopyAssignmentHasConstParam : 1;
502 unsigned HasDeclaredCopyConstructorWithConstParam : 1;
506 unsigned HasDeclaredCopyAssignmentWithConstParam : 1;
509 unsigned IsLambda : 1;
512 unsigned IsParsingBaseSpecifiers : 1;
514 unsigned HasODRHash : 1;
520 unsigned NumBases = 0;
523 unsigned NumVBases = 0;
560 return Bases.
get(
nullptr);
561 return getBasesSlowCase();
567 return VBases.
get(
nullptr);
568 return getVBasesSlowCase();
572 return llvm::makeArrayRef(getBases(), NumBases);
576 return llvm::makeArrayRef(getVBases(), NumVBases);
584 struct DefinitionData *DefinitionData;
587 struct LambdaDefinitionData :
public DefinitionData {
598 unsigned Dependent : 1;
601 unsigned IsGenericLambda : 1;
604 unsigned CaptureDefault : 2;
607 unsigned NumCaptures : 15;
610 unsigned NumExplicitCaptures : 13;
614 unsigned ManglingNumber = 0;
624 Capture *Captures =
nullptr;
630 bool Dependent,
bool IsGeneric,
632 : DefinitionData(D), Dependent(Dependent), IsGenericLambda(IsGeneric),
633 CaptureDefault(CaptureDefault), NumCaptures(0), NumExplicitCaptures(0),
640 PlainOldData =
false;
644 struct DefinitionData *dataPtr()
const {
647 return DefinitionData;
650 struct DefinitionData &data()
const {
651 auto *DD = dataPtr();
652 assert(DD &&
"queried property of class with no definition");
656 struct LambdaDefinitionData &getLambdaData()
const {
659 auto *DD = DefinitionData;
660 assert(DD && DD->IsLambda &&
"queried lambda property of non-lambda class");
661 return static_cast<LambdaDefinitionData&
>(*DD);
673 llvm::PointerUnion<ClassTemplateDecl *, MemberSpecializationInfo *>
674 TemplateOrInstantiation;
685 void addedMember(
Decl *D);
687 void markedVirtualFunctionPure();
714 return cast_or_null<CXXRecordDecl>(
715 static_cast<RecordDecl *
>(
this)->getPreviousDecl());
723 return cast<CXXRecordDecl>(
724 static_cast<RecordDecl *
>(
this)->getMostRecentDecl());
728 return const_cast<CXXRecordDecl*
>(
this)->getMostRecentDecl();
734 auto *DD = DefinitionData ? DefinitionData : dataPtr();
735 return DD ? DD->Definition :
nullptr;
744 bool DelayTypeCreation =
false);
747 bool DependentLambda,
bool IsGeneric,
752 return data().Polymorphic || data().NumVBases != 0;
758 return data().IsParsingBaseSpecifiers;
761 unsigned getODRHash()
const;
771 llvm::iterator_range<base_class_const_iterator>;
784 return bases_begin() + data().NumBases;
801 return vbases_begin() + data().NumVBases;
806 bool hasAnyDependentBases()
const;
813 llvm::iterator_range<specific_decl_iterator<CXXMethodDecl>>;
833 llvm::iterator_range<specific_decl_iterator<CXXConstructorDecl>>;
857 return data().FirstFriend.isValid();
863 assert((!needsOverloadResolutionForCopyConstructor() ||
864 (data().DeclaredSpecialMembers & SMF_CopyConstructor)) &&
865 "this property has not yet been computed by Sema");
866 return data().DefaultedCopyConstructorIsDeleted;
872 assert((!needsOverloadResolutionForMoveConstructor() ||
873 (data().DeclaredSpecialMembers & SMF_MoveConstructor)) &&
874 "this property has not yet been computed by Sema");
875 return data().DefaultedMoveConstructorIsDeleted;
880 assert((!needsOverloadResolutionForDestructor() ||
881 (data().DeclaredSpecialMembers & SMF_Destructor)) &&
882 "this property has not yet been computed by Sema");
883 return data().DefaultedDestructorIsDeleted;
889 return !hasUserDeclaredCopyConstructor() &&
890 !data().DefaultedCopyConstructorIsDeleted;
896 return !hasUserDeclaredMoveConstructor() && hasMoveConstructor() &&
897 !data().DefaultedMoveConstructorIsDeleted;
903 return !hasUserDeclaredMoveAssignment() && hasMoveAssignment() &&
904 !data().DefaultedMoveAssignmentIsDeleted;
910 return !hasUserDeclaredDestructor() &&
911 !data().DefaultedDestructorIsDeleted;
916 return (data().DeclaredSpecialMembers & SMF_DefaultConstructor) ||
917 needsImplicitDefaultConstructor();
925 return !data().UserDeclaredConstructor &&
926 !(data().DeclaredSpecialMembers & SMF_DefaultConstructor) &&
937 return data().UserDeclaredConstructor;
943 return data().UserProvidedDefaultConstructor;
950 return data().UserDeclaredSpecialMembers & SMF_CopyConstructor;
956 return !(data().DeclaredSpecialMembers & SMF_CopyConstructor);
968 if (data().UserDeclaredSpecialMembers &
969 (SMF_MoveConstructor | SMF_MoveAssignment))
971 return data().NeedOverloadResolutionForCopyConstructor;
977 return data().ImplicitCopyConstructorCanHaveConstParamForNonVBase &&
979 data().ImplicitCopyConstructorCanHaveConstParamForVBase);
985 return data().HasDeclaredCopyConstructorWithConstParam ||
986 (needsImplicitCopyConstructor() &&
987 implicitCopyConstructorHasConstParam());
996 return data().UserDeclaredSpecialMembers &
997 (SMF_MoveConstructor | SMF_MoveAssignment);
1003 return data().UserDeclaredSpecialMembers & SMF_MoveConstructor;
1008 return (data().DeclaredSpecialMembers & SMF_MoveConstructor) ||
1009 needsImplicitMoveConstructor();
1015 assert((data().DefaultedCopyConstructorIsDeleted ||
1016 needsOverloadResolutionForCopyConstructor()) &&
1017 "Copy constructor should not be deleted");
1018 data().DefaultedCopyConstructorIsDeleted =
true;
1024 assert((data().DefaultedMoveConstructorIsDeleted ||
1025 needsOverloadResolutionForMoveConstructor()) &&
1026 "move constructor should not be deleted");
1027 data().DefaultedMoveConstructorIsDeleted =
true;
1033 assert((data().DefaultedDestructorIsDeleted ||
1034 needsOverloadResolutionForDestructor()) &&
1035 "destructor should not be deleted");
1036 data().DefaultedDestructorIsDeleted =
true;
1042 return !(data().DeclaredSpecialMembers & SMF_MoveConstructor) &&
1043 !hasUserDeclaredCopyConstructor() &&
1044 !hasUserDeclaredCopyAssignment() &&
1045 !hasUserDeclaredMoveAssignment() &&
1046 !hasUserDeclaredDestructor();
1052 return data().NeedOverloadResolutionForMoveConstructor;
1060 return data().UserDeclaredSpecialMembers & SMF_CopyAssignment;
1066 return !(data().DeclaredSpecialMembers & SMF_CopyAssignment);
1072 return data().HasMutableFields;
1078 return data().ImplicitCopyAssignmentHasConstParam;
1085 return data().HasDeclaredCopyAssignmentWithConstParam ||
1086 (needsImplicitCopyAssignment() &&
1087 implicitCopyAssignmentHasConstParam());
1093 return data().UserDeclaredSpecialMembers & SMF_MoveAssignment;
1098 return (data().DeclaredSpecialMembers & SMF_MoveAssignment) ||
1099 needsImplicitMoveAssignment();
1105 assert((data().DefaultedMoveAssignmentIsDeleted ||
1106 needsOverloadResolutionForMoveAssignment()) &&
1107 "move assignment should not be deleted");
1108 data().DefaultedMoveAssignmentIsDeleted =
true;
1115 return !(data().DeclaredSpecialMembers & SMF_MoveAssignment) &&
1116 !hasUserDeclaredCopyConstructor() &&
1117 !hasUserDeclaredCopyAssignment() &&
1118 !hasUserDeclaredMoveConstructor() &&
1119 !hasUserDeclaredDestructor() &&
1129 return data().NeedOverloadResolutionForMoveAssignment;
1136 return data().UserDeclaredSpecialMembers & SMF_Destructor;
1142 return !(data().DeclaredSpecialMembers & SMF_Destructor);
1148 return data().NeedOverloadResolutionForDestructor;
1154 auto *DD = DefinitionData;
1155 return DD && DD->IsLambda;
1161 bool isGenericLambda()
const;
1194 void getCaptureFields(llvm::DenseMap<const VarDecl *, FieldDecl *> &Captures,
1205 return isLambda() ? getLambdaData().Captures :
nullptr;
1209 return isLambda() ? captures_begin() + getLambdaData().NumCaptures
1216 return data().Conversions.get(getASTContext()).begin();
1220 return data().Conversions.get(getASTContext()).end();
1226 void removeConversion(
const NamedDecl *Old);
1230 llvm::iterator_range<conversion_iterator> getVisibleConversionFunctions();
1252 return !isUnion() && !hasUserDeclaredConstructor() &&
1253 data().HasUninitializedReferenceMember;
1264 bool isPOD()
const {
return data().PlainOldData; }
1268 bool isCLike()
const;
1284 return D.HasPublicFields || D.HasProtectedFields || D.HasPrivateFields;
1312 return hasDefaultConstructor() &&
1313 (data().HasTrivialSpecialMembers & SMF_DefaultConstructor);
1319 return (data().DeclaredNonTrivialSpecialMembers & SMF_DefaultConstructor) ||
1320 (needsImplicitDefaultConstructor() &&
1321 !(data().HasTrivialSpecialMembers & SMF_DefaultConstructor));
1327 return data().HasConstexprNonCopyMoveConstructor ||
1328 (needsImplicitDefaultConstructor() &&
1329 defaultedDefaultConstructorIsConstexpr());
1335 return data().DefaultedDefaultConstructorIsConstexpr &&
1336 (!isUnion() || hasInClassInitializer() || !hasVariantMembers());
1341 return data().HasConstexprDefaultConstructor ||
1342 (needsImplicitDefaultConstructor() &&
1343 defaultedDefaultConstructorIsConstexpr());
1349 return data().HasTrivialSpecialMembers & SMF_CopyConstructor;
1355 return data().DeclaredNonTrivialSpecialMembers & SMF_CopyConstructor ||
1356 !hasTrivialCopyConstructor();
1362 return hasMoveConstructor() &&
1363 (data().HasTrivialSpecialMembers & SMF_MoveConstructor);
1369 return (data().DeclaredNonTrivialSpecialMembers & SMF_MoveConstructor) ||
1370 (needsImplicitMoveConstructor() &&
1371 !(data().HasTrivialSpecialMembers & SMF_MoveConstructor));
1377 return data().HasTrivialSpecialMembers & SMF_CopyAssignment;
1383 return data().DeclaredNonTrivialSpecialMembers & SMF_CopyAssignment ||
1384 !hasTrivialCopyAssignment();
1390 return hasMoveAssignment() &&
1391 (data().HasTrivialSpecialMembers & SMF_MoveAssignment);
1397 return (data().DeclaredNonTrivialSpecialMembers & SMF_MoveAssignment) ||
1398 (needsImplicitMoveAssignment() &&
1399 !(data().HasTrivialSpecialMembers & SMF_MoveAssignment));
1405 return data().HasTrivialSpecialMembers & SMF_Destructor;
1411 return !(data().HasTrivialSpecialMembers & SMF_Destructor);
1417 return !data().HasUninitializedFields ||
1418 !(data().HasDefaultedDefaultConstructor ||
1419 needsImplicitDefaultConstructor());
1428 return data().HasIrrelevantDestructor;
1434 return data().CanPassInRegisters;
1440 data().CanPassInRegisters = CanPass;
1446 return data().HasNonLiteralTypeFieldsOrBases;
1452 return data().HasInheritedConstructor;
1458 return data().HasInheritedAssignment;
1463 bool isTriviallyCopyable()
const;
1471 return isTriviallyCopyable() && hasTrivialDefaultConstructor();
1492 return hasTrivialDestructor() &&
1493 (!isLambda() || getASTContext().getLangOpts().CPlusPlus17) &&
1494 !hasNonLiteralTypeFieldsOrBases() &&
1495 (isAggregate() || isLambda() ||
1496 hasConstexprNonCopyMoveConstructor() ||
1497 hasTrivialDefaultConstructor());
1556 const CXXRecordDecl *getTemplateInstantiationPattern()
const;
1560 ->getTemplateInstantiationPattern());
1568 bool isAnyDestructorNoReturn()
const;
1573 if (
const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(getDeclContext()))
1586 bool isCurrentInstantiation(
const DeclContext *CurContext)
const;
1631 bool isVirtuallyDerivedFrom(
const CXXRecordDecl *Base)
const;
1643 llvm::function_ref<bool(const CXXRecordDecl *BaseDefinition)>;
1659 bool AllowShortCircuit =
true)
const;
1697 bool LookupInDependent =
false)
const;
1778 std::vector<const NamedDecl *>
1780 llvm::function_ref<
bool(
const NamedDecl *ND)> Filter);
1785 void viewInheritance(
ASTContext& Context)
const;
1791 assert(DeclAccess !=
AS_none);
1793 return (PathAccess > DeclAccess ? PathAccess : DeclAccess);
1801 void completeDefinition()
override;
1819 bool mayBeAbstract()
const;
1828 assert(isLambda() &&
"Not a lambda closure type!");
1829 return getLambdaData().ManglingNumber;
1841 Decl *getLambdaContextDecl()
const;
1846 getLambdaData().ManglingNumber = ManglingNumber;
1847 getLambdaData().ContextDecl = ContextDecl;
1851 MSInheritanceAttr::Spelling getMSInheritanceModel()
const;
1854 MSInheritanceAttr::Spelling calculateInheritanceModel()
const;
1863 return !MSInheritanceAttr::hasOnlyOneField(
false,
1864 getMSInheritanceModel()) ||
1870 MSVtorDispAttr::Mode getMSVtorDispMode()
const;
1884 return isLambda() && getLambdaData().Dependent;
1888 return getLambdaData().MethodTyInfo;
1893 bool isInterfaceLike()
const;
1897 return K >= firstCXXRecord && K <= lastCXXRecord;
1912 void anchor()
override;
1919 :
FunctionDecl(CXXDeductionGuide, C, DC, StartLoc, NameInfo, T, TInfo,
1922 setRangeEnd(EndLocation);
1923 IsExplicitSpecified = IsExplicit;
1946 return getDeclName().getCXXDeductionGuideTemplate();
1950 IsCopyDeductionCandidate =
true;
1965 void anchor()
override;
1973 :
FunctionDecl(DK, C, RD, StartLoc, NameInfo, T, TInfo,
1974 SC, isInline, isConstexpr) {
1976 setRangeEnd(EndLocation);
1991 bool isStatic()
const;
2002 return OOK == OO_New || OOK == OO_Array_New || OOK == OO_Delete ||
2003 OOK == OO_Array_Delete;
2029 bool IsAppleKext)
const {
2030 return const_cast<CXXMethodDecl *
>(
this)->getDevirtualizedMethod(
2037 bool isUsualDeallocationFunction()
const;
2041 bool isCopyAssignmentOperator()
const;
2044 bool isMoveAssignmentOperator()
const;
2054 return cast<CXXMethodDecl>(
2055 static_cast<FunctionDecl *
>(
this)->getMostRecentDecl());
2058 return const_cast<CXXMethodDecl*
>(
this)->getMostRecentDecl();
2064 auto *DeclAsWritten =
this;
2065 if (
auto *Pattern = getTemplateInstantiationPattern())
2066 DeclAsWritten = cast<CXXMethodDecl>(Pattern);
2067 return !(DeclAsWritten->isDeleted() ||
2068 DeclAsWritten->getCanonicalDecl()->isDefaulted());
2077 unsigned size_overridden_methods()
const;
2123 bool hasInlineBody()
const;
2132 bool isLambdaStaticInvoker()
const;
2141 bool MayBeBase =
false);
2145 bool MayBeBase =
false)
const {
2147 ->getCorrespondingMethodInClass(RD, MayBeBase);
2153 return K >= firstCXXMethod && K <= lastCXXMethod;
2176 llvm::PointerUnion3<TypeSourceInfo *, FieldDecl *, IndirectFieldDecl *>
2199 unsigned IsDelegating : 1;
2203 unsigned IsVirtual : 1;
2207 unsigned IsWritten : 1;
2211 unsigned SourceOrder : 13;
2247 return isMemberInitializer() || isIndirectMemberInitializer();
2261 return Init->
getStmtClass() == Stmt::CXXDefaultInitExprClass;
2272 return isBaseInitializer() && MemberOrEllipsisLocation.
isValid();
2277 assert(isPackExpansion() &&
"Initializer is not a pack expansion");
2278 return MemberOrEllipsisLocation;
2284 TypeLoc getBaseClassLoc()
const;
2288 const Type *getBaseClass()
const;
2292 assert(isBaseInitializer() &&
"Must call this on base initializer!");
2306 if (isMemberInitializer())
2312 if (isMemberInitializer())
2314 if (isIndirectMemberInitializer())
2320 if (isIndirectMemberInitializer())
2326 return MemberOrEllipsisLocation;
2342 return IsWritten ?
static_cast<int>(SourceOrder) : -1;
2353 assert(!IsWritten &&
2354 "setSourceOrder() used on implicit initializer");
2355 assert(SourceOrder == 0 &&
2356 "calling twice setSourceOrder() on the same initializer");
2358 "setSourceOrder() used to make an initializer implicit");
2360 SourceOrder =
static_cast<unsigned>(Pos);
2379 : Shadow(Shadow), BaseCtor(BaseCtor) {}
2381 explicit operator bool()
const {
return Shadow; }
2404 unsigned NumCtorInitializers : 31;
2409 unsigned IsInheritingConstructor : 1;
2414 bool isExplicitSpecified,
bool isInline,
2415 bool isImplicitlyDeclared,
bool isConstexpr,
2417 :
CXXMethodDecl(CXXConstructor, C, RD, StartLoc, NameInfo, T, TInfo,
2419 NumCtorInitializers(0), IsInheritingConstructor((
bool)Inherited) {
2420 setImplicit(isImplicitlyDeclared);
2422 *getTrailingObjects<InheritedConstructor>() = Inherited;
2423 IsExplicitSpecified = isExplicitSpecified;
2426 void anchor()
override;
2434 bool InheritsConstructor);
2438 bool isExplicit,
bool isInline,
bool isImplicitlyDeclared,
2458 const auto *ConstThis =
this;
2467 return init_begin() + NumCtorInitializers;
2472 return init_begin() + NumCtorInitializers;
2477 std::reverse_iterator<init_const_iterator>;
2496 return NumCtorInitializers;
2500 NumCtorInitializers = numCtorInitializers;
2504 CtorInitializers = Initializers;
2517 return (getNumCtorInitializers() == 1) &&
2518 init_begin()[0]->isDelegatingInitializer();
2527 bool isDefaultConstructor()
const;
2542 bool isCopyConstructor(
unsigned &TypeQuals)
const;
2548 unsigned TypeQuals = 0;
2549 return isCopyConstructor(TypeQuals);
2557 bool isMoveConstructor(
unsigned &TypeQuals)
const;
2562 unsigned TypeQuals = 0;
2563 return isMoveConstructor(TypeQuals);
2570 bool isCopyOrMoveConstructor(
unsigned &TypeQuals)
const;
2575 return isCopyOrMoveConstructor(Quals);
2581 bool isConvertingConstructor(
bool AllowExplicit)
const;
2586 bool isSpecializationCopyingObject()
const;
2594 return IsInheritingConstructor ? *getTrailingObjects<InheritedConstructor>()
2627 Expr *OperatorDeleteThisArg =
nullptr;
2632 bool isInline,
bool isImplicitlyDeclared)
2633 :
CXXMethodDecl(CXXDestructor, C, RD, StartLoc, NameInfo, T, TInfo,
2636 setImplicit(isImplicitlyDeclared);
2639 void anchor()
override;
2647 bool isImplicitlyDeclared);
2686 bool isExplicitSpecified,
bool isConstexpr,
2688 :
CXXMethodDecl(CXXConversion, C, RD, StartLoc, NameInfo, T, TInfo,
2689 SC_None, isInline, isConstexpr, EndLocation) {
2690 IsExplicitSpecified = isExplicitSpecified;
2693 void anchor()
override;
2703 bool isInline,
bool isExplicit,
2723 bool isLambdaToBlockPointerConversion()
const;
2744 virtual void anchor();
2760 unsigned Language : 3;
2767 unsigned HasBraces : 1;
2778 Language(lang), HasBraces(HasBraces), ExternLoc(ExternLoc),
2797 assert(!RBraceLoc.
isValid() || HasBraces);
2806 HasBraces = RBraceLoc.
isValid();
2811 return getRBraceLoc();
2814 return decls_empty() ? getLocation() : decls_begin()->getLocEnd();
2866 :
NamedDecl(UsingDirective, DC, IdentLoc, getName()), UsingLoc(UsingLoc),
2867 NamespaceLoc(NamespcLoc), QualifierLoc(QualifierLoc),
2868 NominatedNamespace(Nominated), CommonAncestor(CommonAncestor) {}
2878 void anchor()
override;
2898 return NominatedNamespace;
2971 NamespaceLoc(NamespaceLoc), IdentLoc(IdentLoc),
2972 QualifierLoc(QualifierLoc), Namespace(Namespace) {}
2974 void anchor()
override;
2996 using redeclarable_base::redecls_begin;
2997 using redeclarable_base::redecls_end;
2998 using redeclarable_base::redecls;
2999 using redeclarable_base::getPreviousDecl;
3000 using redeclarable_base::getMostRecentDecl;
3003 return getFirstDecl();
3006 return getFirstDecl();
3022 return AD->getNamespace();
3024 return cast<NamespaceDecl>(Namespace);
3076 void anchor()
override;
3081 return getNextRedeclaration();
3085 return getPreviousDecl();
3089 return getMostRecentDecl();
3104 return new (
C, DC)
UsingShadowDecl(UsingShadow, C, DC, Loc, Using, Target);
3112 using redeclarable_base::redecls_begin;
3113 using redeclarable_base::redecls_end;
3114 using redeclarable_base::redecls;
3115 using redeclarable_base::getPreviousDecl;
3116 using redeclarable_base::getMostRecentDecl;
3117 using redeclarable_base::isFirstDecl;
3120 return getFirstDecl();
3123 return getFirstDecl();
3133 assert(ND &&
"Target decl is null!");
3144 return dyn_cast_or_null<UsingShadowDecl>(UsingOrNextShadow);
3149 return K == Decl::UsingShadow || K == Decl::ConstructorUsingShadow;
3178 unsigned IsVirtual : 1;
3182 bool TargetInVirtualBase)
3185 NominatedBaseClassShadowDecl(
3186 dyn_cast<ConstructorUsingShadowDecl>(Target)),
3187 ConstructedBaseClassShadowDecl(NominatedBaseClassShadowDecl),
3188 IsVirtual(TargetInVirtualBase) {
3192 if (NominatedBaseClassShadowDecl &&
3193 NominatedBaseClassShadowDecl->constructsVirtualBase()) {
3194 ConstructedBaseClassShadowDecl =
3195 NominatedBaseClassShadowDecl->ConstructedBaseClassShadowDecl;
3201 :
UsingShadowDecl(ConstructorUsingShadow, C, Empty), IsVirtual(
false) {}
3203 void anchor()
override;
3220 return cast<CXXRecordDecl>(getDeclContext());
3223 return cast<CXXRecordDecl>(getDeclContext());
3231 return NominatedBaseClassShadowDecl;
3237 return ConstructedBaseClassShadowDecl;
3247 return cast<CXXRecordDecl>((ConstructedBaseClassShadowDecl
3248 ? ConstructedBaseClassShadowDecl
3250 ->getDeclContext());
3291 llvm::PointerIntPair<UsingShadowDecl *, 1, bool> FirstUsingShadow;
3297 UsingLocation(UL), QualifierLoc(QualifierLoc),
3298 DNLoc(NameInfo.
getInfo()), FirstUsingShadow(
nullptr, HasTypenameKeyword) {
3301 void anchor()
override;
3366 return x.Current == y.Current;
3369 return x.Current != y.Current;
3398 bool HasTypenameKeyword);
3433 unsigned NumExpansions;
3438 InstantiatedFrom ? InstantiatedFrom->
getLocation()
3440 InstantiatedFrom ? InstantiatedFrom->
getDeclName()
3442 InstantiatedFrom(InstantiatedFrom), NumExpansions(UsingDecls.size()) {
3443 std::uninitialized_copy(UsingDecls.begin(), UsingDecls.end(),
3444 getTrailingObjects<NamedDecl *>());
3447 void anchor()
override;
3462 return llvm::makeArrayRef(getTrailingObjects<NamedDecl *>(), NumExpansions);
3470 unsigned NumExpansions);
3495 public Mergeable<UnresolvedUsingValueDecl> {
3516 UsingLocation(UsingLoc), EllipsisLoc(EllipsisLoc),
3517 QualifierLoc(QualifierLoc), DNLoc(NameInfo.
getInfo()) {}
3519 void anchor()
override;
3563 CreateDeserialized(
ASTContext &C,
unsigned ID);
3569 return getFirstDecl();
3572 return getFirstDecl();
3592 public Mergeable<UnresolvedUsingTypenameDecl> {
3610 :
TypeDecl(UnresolvedUsingTypename, DC, TargetNameLoc, TargetName,
3612 TypenameLocation(TypenameLoc), EllipsisLoc(EllipsisLoc),
3613 QualifierLoc(QualifierLoc) {}
3615 void anchor()
override;
3654 CreateDeserialized(
ASTContext &C,
unsigned ID);
3658 return getFirstDecl();
3661 return getFirstDecl();
3670 llvm::PointerIntPair<Expr *, 1, bool> AssertExprAndFailed;
3677 :
Decl(StaticAssert, DC, StaticAssertLoc),
3678 AssertExprAndFailed(AssertExpr, Failed), Message(Message),
3679 RParenLoc(RParenLoc) {}
3681 virtual void anchor();
3698 bool isFailed()
const {
return AssertExprAndFailed.getInt(); }
3703 return SourceRange(getLocation(), getRParenLoc());
3723 Expr *Binding =
nullptr;
3728 void anchor()
override;
3744 VarDecl *getHoldingVar()
const;
3750 setType(DeclaredType);
3751 this->Binding = Binding;
3770 unsigned NumBindings;
3776 :
VarDecl(Decomposition, C, DC, StartLoc, LSquareLoc,
nullptr, T, TInfo,
3778 NumBindings(Bindings.size()) {
3779 std::uninitialized_copy(Bindings.begin(), Bindings.end(),
3780 getTrailingObjects<BindingDecl *>());
3783 void anchor()
override;
3796 unsigned NumBindings);
3799 return llvm::makeArrayRef(getTrailingObjects<BindingDecl *>(), NumBindings);
3802 void printName(raw_ostream &os)
const override;
3842 GetterId(Getter), SetterId(Setter) {}
3871 #endif // LLVM_CLANG_AST_DECLCXX_H const CXXRecordDecl * getPreviousDecl() const
bool isBaseInitializer() const
Determine whether this initializer is initializing a base class.
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
void setSourceOrder(int Pos)
Set the source order of this initializer.
Defines the clang::ASTContext interface.
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
static const Decl * getCanonicalDecl(const Decl *D)
An instance of this class is created to represent a function declaration or definition.
Expr * getInit() const
Get the initializer.
llvm::iterator_range< redecl_iterator > redecl_range
A (possibly-)qualified type.
unsigned getNumCtorInitializers() const
Determine the number of arguments used to initialize the member or base.
bool hasUninitializedReferenceMember() const
Whether this class or any of its subobjects has any members of reference type which would make value-...
bool isStandardLayout() const
Determine whether this class has standard layout per (C++ [class]p7)
static bool classof(const Decl *D)
const CXXMethodDecl *const * method_iterator
const DeclarationNameLoc & getInfo() const
unsigned getNumBases() const
Retrieves the number of base classes of this class.
SourceLocation getEllipsisLoc() const
Get the location of the ellipsis if this is a pack expansion.
SourceLocation getLParenLoc() const
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
static bool classof(const Decl *D)
Iterates through the using shadow declarations associated with this using declaration.
Stmt - This represents one statement.
static bool classofKind(Kind K)
FunctionType - C99 6.7.5.3 - Function Declarators.
bool isInClassMemberInitializer() const
Determine whether this initializer is an implicit initializer generated for a field with an initializ...
static bool classof(const Decl *D)
unsigned getNumVBases() const
Retrieves the number of virtual base classes of this class.
C Language Family Type Representation.
bool hasNonTrivialCopyConstructor() const
Determine whether this class has a non-trivial copy constructor (C++ [class.copy]p6, C++11 [class.copy]p12)
bool allowConstDefaultInit() const
Determine whether declaring a const variable with this type is ok per core issue 253.
static TemplateSpecializationKind getTemplateSpecializationKind(Decl *D)
Determine what kind of template specialization the given declaration is.
bool hasIrrelevantDestructor() const
Determine whether this class has a destructor which has no semantic effect.
Decl - This represents one declaration (or definition), e.g.
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
void setAccessSpecifierLoc(SourceLocation ASLoc)
Sets the location of the access specifier.
IdentifierInfo * getGetterId() const
LambdaCaptureDefault
The default, if any, capture method for a lambda expression.
bool isVirtual() const
Determines whether the base class is a virtual base class (or not).
bool hasUserDeclaredCopyAssignment() const
Determine whether this class has a user-declared copy assignment operator.
init_const_reverse_iterator init_rend() const
shadow_iterator shadow_end() const
bool isPOD() const
Whether this class is a POD-type (C++ [class]p4)
bool isWritten() const
Determine whether this initializer is explicitly written in the source code.
void setPure(bool P=true)
init_reverse_iterator init_rend()
bool isPackExpansion() const
Determine whether this is a pack expansion.
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
SourceLocation getColonLoc() const
The location of the colon following the access specifier.
The base class of the type hierarchy.
static bool classof(const Decl *D)
Expr * getOperatorDeleteThisArg() const
const CXXMethodDecl * getDevirtualizedMethod(const Expr *Base, bool IsAppleKext) const
void setIsCopyDeductionCandidate()
NamespaceDecl - Represent a C++ namespace.
std::reverse_iterator< init_iterator > init_reverse_iterator
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of the namespace.
const NamedDecl * getNominatedNamespaceAsWritten() const
bool hasTrivialMoveConstructor() const
Determine whether this class has a trivial move constructor (C++11 [class.copy]p12) ...
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
const NestedNameSpecifier * Specifier
A container of type source information.
bool hasConstexprNonCopyMoveConstructor() const
Determine whether this class has at least one constexpr constructor other than the copy or move const...
capture_const_range captures() const
static bool classof(const Decl *D)
base_class_const_iterator vbases_end() const
bool needsImplicitMoveAssignment() const
Determine whether this class should get an implicit move assignment operator or if any existing speci...
QualType getConversionType() const
Returns the type that this conversion function is converting to.
static bool classofKind(Kind K)
bool hasFriends() const
Determines whether this record has any friends.
Describes the capture of a variable or of this, or of a C++1y init-capture.
Represents a path from a specific derived class (which is not represented as part of the path) to a p...
bool hasUserDeclaredMoveOperation() const
Whether this class has a user-declared move constructor or assignment operator.
unsigned getIdentifierNamespace() const
static bool classof(const Decl *D)
Represents a C++ constructor within a class.
bool implicitCopyAssignmentHasConstParam() const
Determine whether an implicit copy assignment operator for this type would have a parameter with a co...
float __ovld __cnfn distance(float p0, float p1)
Returns the distance between p0 and p1.
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class...
bool isPackExpansion() const
Determine whether this initializer is a pack expansion.
SourceLocation getTargetNameLoc() const
Returns the location of the identifier in the named namespace.
friend bool operator!=(shadow_iterator x, shadow_iterator y)
bool isIndirectMemberInitializer() const
const Expr * getAssertExpr() const
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
VarDecl - An instance of this class is created to represent a variable declaration or definition...
static bool classof(const Decl *D)
const T * getAs() const
Member-template getAs<specific type>'.
bool needsImplicitCopyAssignment() const
Determine whether this class needs an implicit copy assignment operator to be lazily declared...
NamedDecl * getUnderlyingDecl()
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl.
bool hasTrivialDefaultConstructor() const
Determine whether this class has a trivial default constructor (C++11 [class.ctor]p5).
Stores a list of template parameters for a TemplateDecl and its derived classes.
bool isMemberInitializer() const
Determine whether this initializer is initializing a non-static data member.
SourceLocation getEllipsisLoc() const
bool hasDefinition() const
UsingShadowDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
static AccessSpecDecl * Create(ASTContext &C, AccessSpecifier AS, DeclContext *DC, SourceLocation ASLoc, SourceLocation ColonLoc)
Represents any kind of function declaration, whether it is a concrete function or a function template...
DeclarationNameInfo getNameInfo() const
bool isExplicitSpecified() const
Whether this function is marked as explicit explicitly.
SourceLocation getRParenLoc() const
reference operator*() const
bool isExplicitSpecified() const
Whether this deduction guide was declared with the 'explicit' specifier.
static bool classof(const Decl *D)
An UnresolvedSet-like class that might not have been loaded from the external AST source yet...
const FunctionDecl * isLocalClass() const
If the class is a local class [class.local], returns the enclosing function declaration.
bool hasNonTrivialDefaultConstructor() const
Determine whether this class has a non-trivial default constructor (C++11 [class.ctor]p5).
Base wrapper for a particular "section" of type source info.
RecordDecl - Represents a struct/union/class.
LanguageIDs getLanguage() const
Return the language specified by this linkage specification.
An iterator over the friend declarations of a class.
bool isEmpty() const
Determine whether this is an empty class in the sense of (C++11 [meta.unary.prop]).
Description of a constructor that was inherited from a base class.
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
Provides common interface for the Decls that can be redeclared.
SourceLocation getLocEnd() const LLVM_READONLY
One of these records is kept for each identifier that is lexed.
CXXRecordDecl * getParent()
Returns the parent of this method declaration, which is the class in which this method is defined...
StringLiteral * getMessage()
static bool classof(const Decl *D)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
CXXRecordDecl * getPreviousDecl()
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.
SourceLocation getColonLoc() const
Returns the location of ':'.
NamespaceDecl * getNamespace()
Retrieve the namespace declaration aliased by this directive.
static bool classofKind(Kind K)
bool defaultedDefaultConstructorIsConstexpr() const
Determine whether a defaulted default constructor for this class would be constexpr.
void setLanguage(LanguageIDs L)
Set the language specified by this linkage specification.
static bool classof(const Decl *D)
SourceLocation getLocStart() const LLVM_READONLY
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
TypeSourceInfo * getTypeSourceInfo() const
Returns the declarator information for a base class or delegating initializer.
llvm::iterator_range< capture_const_iterator > capture_const_range
conversion_iterator conversion_end() const
void startDefinition()
Starts the definition of this tag declaration.
CXXMethodDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
bool isCopyOrMoveConstructor() const
Determine whether this a copy or move constructor.
static bool classofKind(Kind K)
bool hasTrivialMoveAssignment() const
Determine whether this class has a trivial move assignment operator (C++11 [class.copy]p25)
InheritedConstructor getInheritedConstructor() const
Get the constructor that this inheriting constructor is based on.
The iterator over UnresolvedSets.
static NamespaceDecl * getNamespace(const NestedNameSpecifier *X)
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
static bool classof(const Decl *D)
FieldDecl * getAnonField() const
bool hasUserDeclaredDestructor() const
Determine whether this class has a user-declared destructor.
unsigned getTypeQualifiers() const
method_iterator method_begin() const
Method begin iterator.
static bool classofKind(Kind K)
Represents an access specifier followed by colon ':'.
llvm::iterator_range< init_iterator > init_range
TypeSourceInfo * getLambdaTypeInfo() const
NamespaceAliasDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
llvm::iterator_range< friend_iterator > friend_range
void setImplicitCopyConstructorIsDeleted()
Set that we attempted to declare an implicit copy constructor, but overload resolution failed so we d...
static bool classofKind(Kind K)
Represents a C++ using-declaration.
UnresolvedUsingValueDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this declaration.
void setUsingLoc(SourceLocation L)
Set the source location of the 'using' keyword.
ArrayRef< BindingDecl * > bindings() const
bool hasNonLiteralTypeFieldsOrBases() const
Determine whether this class has a non-literal or/ volatile type non-static data member or base class...
RefQualifierKind getRefQualifier() const
Retrieve the ref-qualifier associated with this method.
bool isDelegatingConstructor() const
Determine whether this constructor is a delegating constructor.
CXXMethodDecl(Kind DK, ASTContext &C, CXXRecordDecl *RD, SourceLocation StartLoc, const DeclarationNameInfo &NameInfo, QualType T, TypeSourceInfo *TInfo, StorageClass SC, bool isInline, bool isConstexpr, SourceLocation EndLocation)
bool isBaseVirtual() const
Returns whether the base is virtual or not.
bool hasMoveAssignment() const
Determine whether this class has a move assignment operator.
AccessSpecifier getAccessSpecifier() const
Returns the access specifier for this base specifier.
bool getInheritConstructors() const
Determine whether this base class's constructors get inherited.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
bool needsOverloadResolutionForCopyAssignment() const
Determine whether we need to eagerly declare a defaulted copy assignment operator for this class...
NamedDecl * getNominatedNamespaceAsWritten()
FunctionDecl * isLocalClass()
static bool classof(const Decl *D)
TypeDecl - Represents a declaration of a type.
void setLambdaMangling(unsigned ManglingNumber, Decl *ContextDecl)
Set the mangling number and context declaration for a lambda class.
bool isAccessDeclaration() const
Return true if it is a C++03 access declaration (no 'using').
bool isLambda() const
Determine whether this class describes a lambda function object.
static DeclContext * castToDeclContext(const LinkageSpecDecl *D)
base_class_const_iterator bases_begin() const
CXXRecordDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
llvm::iterator_range< init_const_iterator > init_const_range
CXXConversionDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
bool isAnyMemberInitializer() const
base_class_iterator bases_begin()
SourceLocation getExternLoc() const
SourceLocation getLocEnd() const LLVM_READONLY
void setNumCtorInitializers(unsigned numCtorInitializers)
FieldDecl * getAnyMember() const
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
bool hasTrivialDestructor() const
Determine whether this class has a trivial destructor (C++ [class.dtor]p3)
bool hasSimpleCopyConstructor() const
true if we know for sure that this class has a single, accessible, unambiguous copy constructor that ...
FieldDecl * getMember() const
If this is a member initializer, returns the declaration of the non-static data member being initiali...
Represents a linkage specification.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
shadow_iterator shadow_begin() const
bool hasConstexprDefaultConstructor() const
Determine whether this class has a constexpr default constructor.
bool isAbstract() const
Determine whether this class has a pure virtual function.
A binding in a decomposition declaration.
init_iterator init_begin()
Retrieve an iterator to the first initializer.
llvm::iterator_range< overridden_cxx_method_iterator > overridden_method_range
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
SourceLocation getRParenLoc() const
llvm::iterator_range< specific_decl_iterator< CXXConstructorDecl > > ctor_range
bool hasBraces() const
Determines whether this linkage specification had braces in its syntactic form.
unsigned getLambdaManglingNumber() const
If this is the closure type of a lambda expression, retrieve the number to be used for name mangling ...
bool hasCopyAssignmentWithConstParam() const
Determine whether this class has a copy assignment operator with a parameter type which is a referenc...
CXXConstructorDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
bool hasUserProvidedDefaultConstructor() const
Whether this class has a user-provided default constructor per C++11.
InheritedConstructor(ConstructorUsingShadowDecl *Shadow, CXXConstructorDecl *BaseCtor)
A placeholder type used to construct an empty shell of a decl-derived type that will be filled in lat...
CXXRecordDecl * getMostRecentDecl()
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of the namespace.
A little helper class used to produce diagnostics.
init_const_range inits() const
Represents a prototype with parameter type info, e.g.
bool isDynamicClass() const
CXXDestructorDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
static bool classofKind(Kind K)
SourceLocation getTypenameLoc() const
Returns the source location of the 'typename' keyword.
Represents a ValueDecl that came out of a declarator.
static bool classof(const Decl *D)
bool isDelegatingInitializer() const
Determine whether this initializer is creating a delegating constructor.
init_reverse_iterator init_rbegin()
std::forward_iterator_tag iterator_category
bool isLiteral() const
Determine whether this class is a literal type.
const CXXRecordDecl * getParent() const
Returns the parent of this using shadow declaration, which is the class in which this is declared...
CXXCtorInitializer *const * init_const_iterator
Iterates through the member/base initializer list.
bool hasInheritedConstructor() const
Determine whether this class has a using-declaration that names a user-declared base class constructo...
capture_const_iterator captures_end() const
static bool classof(const Decl *D)
static bool classofKind(Kind K)
const UnresolvedUsingValueDecl * getCanonicalDecl() const
bool hasUserDeclaredCopyConstructor() const
Determine whether this class has a user-declared copy constructor.
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
ValueDecl - Represent the declaration of a variable (in which case it is an lvalue) a function (in wh...
Expr - This represents one expression.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
Defines the clang::LangOptions interface.
const NamespaceDecl * getNominatedNamespace() const
SourceLocation getAliasLoc() const
Returns the location of the alias name, i.e.
ctor_iterator ctor_end() const
const CXXConversionDecl * getCanonicalDecl() const
static bool classofKind(Kind K)
const FunctionProtoType * T
base_class_const_range bases() const
bool defaultedMoveConstructorIsDeleted() const
true if a defaulted move constructor for this class would be deleted.
DeclarationNameInfo getNameInfo() const
CXXRecordDecl * getTemplateInstantiationPattern()
const CXXRecordDecl * getCanonicalDecl() const
Represents a C++ destructor within a class.
init_const_reverse_iterator init_rbegin() const
bool isCopyConstructor() const
Whether this constructor is a copy constructor (C++ [class.copy]p2, which can be used to copy the cla...
const UsingDecl * getCanonicalDecl() const
bool isCopyDeductionCandidate() const
Defines an enumeration for C++ overloaded operators.
void setRBraceLoc(SourceLocation L)
bool hasUserDeclaredMoveAssignment() const
Determine whether this class has had a move assignment declared by the user.
bool isPackExpansion() const
Determine whether this is a pack expansion.
CXXRecordDecl * getDefinition() const
bool isExplicit() const
Whether this deduction guide is explicit.
base_class_iterator vbases_end()
llvm::iterator_range< specific_decl_iterator< CXXMethodDecl > > method_range
static TemplateParameterList * getGenericLambdaTemplateParameterList(LambdaScopeInfo *LSI, Sema &SemaRef)
ConstructorUsingShadowDecl * getNominatedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the direct base class from which this using shadow dec...
bool hasMoveConstructor() const
Determine whether this class has a move constructor.
const CXXConstructorDecl * getCanonicalDecl() const
bool needsImplicitDestructor() const
Determine whether this class needs an implicit destructor to be lazily declared.
Defines the clang::TypeLoc interface and its subclasses.
bool isTrivial() const
Determine whether this class is considered trivial.
init_const_iterator init_end() const
Retrieve an iterator past the last initializer.
CXXRecordDecl * getConstructedBaseClass() const
Get the base class whose constructor or constructor shadow declaration is passed the constructor argu...
bool isPolymorphic() const
Whether this class is polymorphic (C++ [class.virtual]), which means that the class contains or inher...
const CXXMethodDecl * getCanonicalDecl() const
void setInheritConstructors(bool Inherit=true)
Set that this base class's constructors should be inherited.
StorageClass
Storage classes.
const UnresolvedUsingTypenameDecl * getCanonicalDecl() const
bool hasNonTrivialDestructor() const
Determine whether this class has a non-trivial destructor (C++ [class.dtor]p3)
IdentifierInfo * getSetterId() const
void setTypename(bool TN)
Sets whether the using declaration has 'typename'.
DeclContext * getParent()
getParent - Returns the containing DeclContext.
method_iterator method_end() const
Method past-the-end iterator.
SourceLocation getEnd() const
static bool hasDefinition(const ObjCObjectPointerType *ObjPtr)
bool isBaseOfClass() const
Determine whether this base class is a base of a class declared with the 'class' keyword (vs...
bool hasSimpleMoveConstructor() const
true if we know for sure that this class has a single, accessible, unambiguous move constructor that ...
bool hasTrivialCopyConstructor() const
Determine whether this class has a trivial copy constructor (C++ [class.copy]p6, C++11 [class...
Represents a C++ deduction guide declaration.
bool needsImplicitDefaultConstructor() const
Determine if we need to declare a default constructor for this class.
Represents a C++ conversion function within a class.
bool hasNonTrivialMoveAssignment() const
Determine whether this class has a non-trivial move assignment operator (C++11 [class.copy]p25)
bool nullFieldOffsetIsZero() const
In the Microsoft C++ ABI, use zero for the field offset of a null data member pointer if we can guara...
UsingPackDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
llvm::function_ref< bool(const CXXBaseSpecifier *Specifier, CXXBasePath &Path)> BaseMatchesCallback
Function type used by lookupInBases() to determine whether a specific base class subobject matches th...
bool hasNonTrivialMoveConstructor() const
Determine whether this class has a non-trivial move constructor (C++11 [class.copy]p12) ...
CXXMethodDecl * getMostRecentDecl()
const CXXRecordDecl * getMostRecentDecl() const
llvm::iterator_range< shadow_iterator > shadow_range
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
bool hasVariantMembers() const
Determine whether this class has any variant members.
bool isExplicit() const
Whether this function is explicit.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
SourceLocation getUsingLoc() const
Return the location of the using keyword.
unsigned size_overridden_methods() const
SourceLocation getUsingLoc() const
Returns the source location of the 'using' keyword.
const UsingPackDecl * getCanonicalDecl() const
void setColonLoc(SourceLocation CLoc)
Sets the location of the colon.
UnresolvedUsingTypenameDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this declaration.
const NamespaceAliasDecl * getCanonicalDecl() const
NamedDecl * getInstantiatedFromUsingDecl() const
Get the using declaration from which this was instantiated.
shadow_iterator(UsingShadowDecl *C)
bool hasTrivialCopyAssignment() const
Determine whether this class has a trivial copy assignment operator (C++ [class.copy]p11, C++11 [class.copy]p25)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
Encodes a location in the source.
bool isPure() const
Whether this virtual function is pure, i.e.
static bool classofKind(Kind K)
redeclarable_base::redecl_iterator redecl_iterator
const CXXMethodDecl * getCorrespondingMethodInClass(const CXXRecordDecl *RD, bool MayBeBase=false) const
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
A set of all the primary bases for a class.
const StringLiteral * getMessage() const
SourceLocation getNamespaceKeyLocation() const
Returns the location of the namespace keyword.
std::ptrdiff_t difference_type
DeclarationName getName() const
getName - Returns the embedded declaration name.
SourceLocation getUsingLoc() const
Return the source location of the 'using' keyword.
std::reverse_iterator< init_const_iterator > init_const_reverse_iterator
Defines several types used to describe C++ lambda expressions that are shared between the parser and ...
Represents a dependent using declaration which was not marked with typename.
TagDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
init_iterator init_end()
Retrieve an iterator past the last initializer.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
llvm::iterator_range< base_class_iterator > base_class_range
void setCtorInitializers(CXXCtorInitializer **Initializers)
Represents a static or instance method of a struct/union/class.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
static bool classofKind(Kind K)
SourceLocation getIdentLocation() const
Returns the location of this using declaration's identifier.
bool isPackExpansion() const
Determine whether this base specifier is a pack expansion.
void setImplicitMoveConstructorIsDeleted()
Set that we attempted to declare an implicit move constructor, but overload resolution failed so we d...
static bool classofKind(Kind K)
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
llvm::function_ref< bool(const CXXRecordDecl *BaseDefinition)> ForallBasesCallback
Function type used by forallBases() as a callback.
UsingDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this declaration.
bool isExplicitSpecified() const
Whether this function is marked as explicit explicitly.
static bool classof(const Decl *D)
RefQualifierKind
The kind of C++11 ref-qualifier associated with a function type.
static bool classof(const Decl *D)
ConstructorUsingShadowDecl * getConstructedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the base class for which we don't have an explicit ini...
void setIsParsingBaseSpecifiers()
static void * getAsVoidPointer(::clang::AnyFunctionDecl F)
void setImplicitDestructorIsDeleted()
Set that we attempted to declare an implicit destructor, but overload resolution failed so we deleted...
const CXXDestructorDecl * getCanonicalDecl() const
SourceLocation getMemberLocation() const
::clang::AnyFunctionDecl getFromVoidPointer(void *P)
Represents a C++11 static_assert declaration.
SourceLocation getRBraceLoc() const
TypeSourceInfo * getTypeSourceInfo() const
Retrieves the type and source location of the base class.
SourceLocation getAccessSpecifierLoc() const
The location of the access specifier.
bool defaultedCopyConstructorIsDeleted() const
true if a defaulted copy constructor for this class would be deleted.
__PTRDIFF_TYPE__ ptrdiff_t
A signed integer type that is the result of subtracting two pointers.
int getSourceOrder() const
Return the source position of the initializer, counting from 0.
CXXBaseSpecifier(SourceRange R, bool V, bool BC, AccessSpecifier A, TypeSourceInfo *TInfo, SourceLocation EllipsisLoc)
bool hasInClassInitializer() const
Whether this class has any in-class initializers for non-static data members (including those in anon...
Defines various enumerations that describe declaration and type specifiers.
DeclarationNameLoc - Additional source/type location info for a declaration name. ...
CXXConstructorDecl * getConstructor() const
bool hasSimpleDestructor() const
true if we know for sure that this class has an accessible destructor that is not deleted...
TagTypeKind
The kind of a tag type.
static bool isStaticOverloadedOperator(OverloadedOperatorKind OOK)
Returns true if the given operator is implicitly static in a record context.
pointer operator->() const
Dataflow Directional Tag Classes.
bool isExplicit() const
Whether this function is explicit.
NestedNameSpecifier * getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
bool isValid() const
Return true if this is a valid SourceLocation object.
static bool classof(const Decl *D)
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
The base class of all kinds of template declarations (e.g., class, function, etc.).
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
static AnyFunctionDecl getFromNamedDecl(NamedDecl *ND)
SourceLocation getLocStart() const LLVM_READONLY
base_class_const_range vbases() const
Reads an AST files chain containing the contents of a translation unit.
SourceLocation getBaseTypeLoc() const LLVM_READONLY
Get the location at which the base class type was written.
bool isAccessDeclaration() const
Return true if it is a C++03 access declaration (no 'using').
IndirectFieldDecl - An instance of this class is created to represent a field injected from an anonym...
void setUsingLoc(SourceLocation L)
Set the source location of the 'using' keyword.
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name of the namespace, with source-location inf...
DeclContext * getCommonAncestor()
Returns the common ancestor context of this using-directive and its nominated namespace.
llvm::iterator_range< base_class_const_iterator > base_class_const_range
A decomposition declaration.
bool hasUserDeclaredConstructor() const
Determine whether this class has any user-declared constructors.
IdentifierNamespace
IdentifierNamespace - The different namespaces in which declarations may appear.
Represents a dependent using declaration which was marked with typename.
conversion_iterator conversion_begin() const
DeclarationName - The name of a declaration.
StmtClass getStmtClass() const
const CXXRecordDecl * getParent() const
Returns the parent of this method declaration, which is the class in which this method is defined...
NestedNameSpecifierLoc getQualifierLoc() const
Retrieve the nested-name-specifier that qualifies the name, with source-location information.
DeclarationNameInfo getNameInfo() const
unsigned shadow_size() const
Return the number of shadowed declarations associated with this using declaration.
const NamespaceDecl * getNamespace() const
A mapping from each virtual member function to its set of final overriders.
llvm::iterator_range< redecl_iterator > redecl_range
base_class_const_iterator bases_end() const
base_class_iterator vbases_begin()
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
void setExternLoc(SourceLocation L)
bool isUserProvided() const
True if this method is user-declared and was not deleted or defaulted on its first declaration...
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
T * get(ExternalASTSource *Source) const
Retrieve the pointer to the AST node that this lazy pointer.
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext, providing only those that are of type SpecificDecl (or a class derived from it).
bool hasNonTrivialCopyAssignment() const
Determine whether this class has a non-trivial copy assignment operator (C++ [class.copy]p11, C++11 [class.copy]p25)
bool isMoveConstructor() const
Determine whether this constructor is a move constructor (C++11 [class.copy]p3), which can be used to...
const FunctionDecl * getOperatorDelete() const
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class...
static AccessSpecifier MergeAccess(AccessSpecifier PathAccess, AccessSpecifier DeclAccess)
Calculates the access of a decl that is reached along a path.
Provides common interface for the Decls that cannot be redeclared, but can be merged if the same decl...
static bool classofKind(Kind K)
static bool classof(const Decl *D)
const CXXMethodDecl * getMostRecentDecl() const
Represents a C++ base or member initializer.
bool isParsingBaseSpecifiers() const
LanguageIDs
Represents the language in a linkage specification.
bool needsOverloadResolutionForMoveAssignment() const
Determine whether we need to eagerly declare a move assignment operator for this class.
IndirectFieldDecl * getIndirectMember() const
static bool classofKind(Kind K)
base_class_const_iterator vbases_begin() const
static LinkageSpecDecl * castFromDeclContext(const DeclContext *DC)
static UsingShadowDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation Loc, UsingDecl *Using, NamedDecl *Target)
const DeclContext * getCommonAncestor() const
AnyFunctionDecl(FunctionDecl *FD)
Represents a base class of a C++ class.
bool hasTypename() const
Return true if the using declaration has 'typename'.
static bool classofKind(Kind K)
bool needsImplicitCopyConstructor() const
Determine whether this class needs an implicit copy constructor to be lazily declared.
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
bool hasMutableFields() const
Determine whether this class, or any of its class subobjects, contains a mutable field.
shadow_range shadows() const
static bool classofKind(Kind K)
Defines the clang::SourceLocation class and associated facilities.
void setImplicitMoveAssignmentIsDeleted()
Set that we attempted to declare an implicit move assignment operator, but overload resolution failed...
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
Represents a C++ struct/union/class.
void setBinding(QualType DeclaredType, Expr *Binding)
Set the binding for this BindingDecl, along with its declared type (which should be a possibly-cv-qua...
bool hasUserDeclaredMoveConstructor() const
Determine whether this class has had a move constructor declared by the user.
bool hasSimpleMoveAssignment() const
true if we know for sure that this class has a single, accessible, unambiguous move assignment operat...
static bool classof(const Decl *D)
SourceLocation getEllipsisLoc() const
For a pack expansion, determine the location of the ellipsis.
UsingShadowDecl * getNextUsingShadowDecl() const
The next using shadow declaration contained in the shadow decl chain of the using declaration which i...
An object for streaming information to a record.
static bool classofKind(Kind K)
Provides information a specialization of a member of a class template, which may be a member function...
LambdaCaptureDefault getLambdaCaptureDefault() const
bool isDependentLambda() const
Determine whether this lambda expression was known to be dependent at the time it was created...
base_class_iterator bases_end()
friend bool operator==(shadow_iterator x, shadow_iterator y)
shadow_iterator & operator++()
Declaration of a class template.
Writes an AST file containing the contents of a translation unit.
bool hasInheritedAssignment() const
Determine whether this class has a using-declaration that names a base class assignment operator...
bool isOffset() const
Whether this pointer is currently stored as an offset.
StringLiteral - This represents a string literal expression, e.g.
Kind
Lists the kind of concrete classes of Decl.
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
SourceLocation getEllipsisLoc() const
Get the location of the ellipsis if this is a pack expansion.
bool constructsVirtualBase() const
Returns true if the constructed base class is a virtual base class subobject of this declaration's cl...
Expr * getBinding() const
Get the expression to which this declaration is bound.
static bool classof(const Decl *D)
SourceLocation getUsingLoc() const
Returns the source location of the 'using' keyword.
bool implicitCopyConstructorHasConstParam() const
Determine whether an implicit copy constructor for this type would have a parameter with a const-qual...
ASTContext::overridden_method_range overridden_method_range
BasePaths - Represents the set of paths from a derived class to one of its (direct or indirect) bases...
void setCanPassInRegisters(bool CanPass)
Set that we can pass this RecordDecl in registers.
capture_const_iterator captures_begin() const
bool needsImplicitMoveConstructor() const
Determine whether this class should get an implicit move constructor or if any existing special membe...
bool hasDirectFields() const
Determine whether this class has direct non-static data members.
An instance of this class represents the declaration of a property member.
SourceLocation getNamespaceLoc() const
Returns the location of the namespace keyword.
AccessSpecifier getAccessSpecifierAsWritten() const
Retrieves the access specifier as written in the source code (which may mean that no access specifier...
shadow_iterator operator++(int)
NamedDecl * get() const
Retrieve the underlying function or function template.
A trivial tuple used to represent a source range.
static bool classofKind(Kind K)
FunctionDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
static bool classofKind(Kind K)
NamedDecl - This represents a decl with a name.
bool hasCopyConstructorWithConstParam() const
Determine whether this class has a copy constructor with a parameter type which is a reference to a c...
static DeclarationName getUsingDirectiveName()
getUsingDirectiveName - Return name for all using-directives.
redeclarable_base::redecl_iterator redecl_iterator
Represents a C++ namespace alias.
SourceRange getSourceRange() const LLVM_READONLY
Retrieves the source range that contains the entire base specifier.
ArrayRef< NamedDecl * > expansions() const
Get the set of using declarations that this pack expanded into.
Represents C++ using-directive.
bool isAggregate() const
Determine whether this class is an aggregate (C++ [dcl.init.aggr]), which is a class with no user-dec...
SourceLocation getBegin() const
SourceLocation ColonLoc
Location of ':'.
TemplateDecl * getDeducedTemplate() const
Get the template for which this guide performs deduction.
bool hasDefaultConstructor() const
Determine whether this class has any default constructors.
ctor_iterator ctor_begin() const
base_class_range vbases()
Declaration of a template function.
void setTargetDecl(NamedDecl *ND)
Sets the underlying declaration which has been brought into the local scope.
bool canPassInRegisters() const
Determine whether this class has at least one trivial, non-deleted copy or move constructor.
SourceLocation getLocation() const
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
Represents a pack of using declarations that a single using-declarator pack-expanded into...
QualType getType() const
Return the type wrapped by this type source info.
static bool isProvablyNotDerivedFrom(Sema &SemaRef, CXXRecordDecl *Record, const BaseSet &Bases)
Determines if the given class is provably not derived from all of the prospective base classes...
const UsingShadowDecl * getCanonicalDecl() const
ConstructorUsingShadowDecl * getShadowDecl() const
Defines the LambdaCapture class.
NamedDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
CXXRecordDecl * getParent()
static OMPLinearClause * Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, OpenMPLinearClauseKind Modifier, SourceLocation ModifierLoc, SourceLocation ColonLoc, SourceLocation EndLoc, ArrayRef< Expr *> VL, ArrayRef< Expr *> PL, ArrayRef< Expr *> IL, Expr *Step, Expr *CalcStep, Stmt *PreInit, Expr *PostUpdate)
Creates clause with a list of variables VL and a linear step Step.
bool isInheritingConstructor() const
Determine whether this is an implicit constructor synthesized to model a call to a constructor inheri...
method_range methods() const
QualType getType() const
Retrieves the type of the base class.
bool defaultedDestructorIsDeleted() const
true if a defaulted destructor for this class would be deleted.