27#include "llvm/ADT/STLExtras.h"
76 if (CandDecl->isInvalidDecl())
84 ThisTy, Classification,
101 CtorInfo.ConstructorTmpl, CtorInfo.FoundDecl,
nullptr,
119 bool AllowUserDefined) {
127 return Decl && (AllowUserDefined || !
Decl->isUserProvided()) &&
143 return Decl && (AllowUserDefined || !
Decl->isUserProvided()) &&
184 const auto *BaseDecl = B.getType()->getAsCXXRecordDecl();
189 if (B.isVirtual() || (!BaseDecl->isDependentType() &&
196 if (Field->getType()->isDependentType())
198 if (Field->getType()->isReferenceType())
219 const auto *BaseDecl = B.getType()->getAsCXXRecordDecl();
223 if (!BaseDecl->isDependentType() &&
229 if (Field->getType()->isDependentType())
250 auto HasSuitableSMP = [&] {
257 auto IsUnion = [&, Is = std::optional<bool>{}]()
mutable {
281 if (D->
hasAttr<TriviallyRelocatableAttr>())
301 if (D->
hasAttr<ReplaceableAttr>())
302 return HasSuitableSMP();
306 return HasSuitableSMP();
316 if (std::optional<ASTContext::CXXRecordDeclRelocationInfo> Info =
318 return Info->IsRelocatable;
337 if (
Context.containsNonRelocatablePointerAuth(
Type))
350 if (std::optional<ASTContext::CXXRecordDeclRelocationInfo> Info =
352 return Info->IsReplaceable;
360 if (
Type.isConstQualified() ||
Type.isVolatileQualified())
373 return ::IsCXXReplaceableType(*
this, RD);
383 if (!
T->getType()->isVariableArrayType())
386 S.
Diag(
T->getTypeLoc().getBeginLoc(), diag::err_vla_unsupported)
397 if (!
T->getType()->isAtomicType())
400 S.
Diag(
T->getTypeLoc().getBeginLoc(), diag::err_atomic_unsupported)
425 llvm_unreachable(
"not a UTT");
427 case UTT_IsCompleteType:
436 case UTT_IsFloatingPoint:
438 case UTT_IsBoundedArray:
440 case UTT_IsLvalueReference:
441 case UTT_IsRvalueReference:
442 case UTT_IsMemberFunctionPointer:
443 case UTT_IsMemberObjectPointer:
445 case UTT_IsScopedEnum:
449 case UTT_IsReference:
450 case UTT_IsArithmetic:
451 case UTT_IsFundamental:
455 case UTT_IsMemberPointer:
456 case UTT_IsTypedResourceElementCompatible:
467 case UTT_IsUnboundedArray:
471 case UTT_IsInterfaceClass:
475 case UTT_StructuredBindingSize:
481 case UTT_IsPolymorphic:
486 Loc, ArgTy, diag::err_incomplete_type_used_in_type_trait_expr);
495 Loc, ArgTy, diag::err_incomplete_type_used_in_type_trait_expr);
499 case UTT_IsAggregate:
500 case UTT_IsImplicitLifetime:
505 Loc, ArgTy, diag::err_incomplete_type_used_in_type_trait_expr);
509 case UTT_HasUniqueObjectRepresentations:
514 Loc, ArgTy, diag::err_incomplete_type_used_in_type_trait_expr);
519 case UTT_IsTriviallyCopyable:
520 case UTT_IsStandardLayout:
523 case UTT_IsBitwiseCloneable:
526 case UTT_IsTriviallyRelocatable:
527 case UTT_IsTriviallyEqualityComparable:
528 case UTT_IsCppTriviallyRelocatable:
529 case UTT_IsReplaceable:
530 case UTT_CanPassInRegs:
534 case UTT_HasNothrowAssign:
535 case UTT_HasNothrowMoveAssign:
536 case UTT_HasNothrowConstructor:
537 case UTT_HasNothrowCopy:
538 case UTT_HasTrivialAssign:
539 case UTT_HasTrivialMoveAssign:
540 case UTT_HasTrivialDefaultConstructor:
541 case UTT_HasTrivialMoveConstructor:
542 case UTT_HasTrivialCopy:
543 case UTT_HasTrivialDestructor:
544 case UTT_HasVirtualDestructor:
549 case UTT_IsDestructible:
550 case UTT_IsNothrowDestructible:
551 case UTT_IsTriviallyDestructible:
552 case UTT_IsIntangibleType:
557 Loc, ArgTy, diag::err_incomplete_type_used_in_type_trait_expr);
566 if ((RD->*HasTrivial)() && !(RD->*HasNonTrivial)())
572 if (
Self.LookupQualifiedName(Res, RD)) {
573 bool FoundOperator =
false;
581 if ((Operator->*IsDesiredOp)()) {
582 FoundOperator =
true;
584 CPT =
Self.ResolveExceptionSpec(KeyLoc, CPT);
589 return FoundOperator;
599 if (
Decl->isLambda())
600 return Decl->isCapturelessLambda();
616 Functions, &Operand, &Operand);
620 const auto *
CallExpr = dyn_cast<CXXOperatorCallExpr>(Result.get());
624 auto ParamT = Callee->getParamDecl(0)->getType();
625 if (!Callee->isDefaulted())
627 if (!ParamT->isReferenceType() && !
Decl->isTriviallyCopyable())
633 return llvm::all_of(
Decl->bases(),
635 if (const auto *RD = BS.getType()->getAsCXXRecordDecl())
636 return HasNonDeletedDefaultedEqualityComparison(
641 auto Type = FD->getType();
642 if (Type->isArrayType())
643 Type = Type->getBaseElementTypeUnsafe()
644 ->getCanonicalTypeUnqualified();
646 if (Type->isReferenceType() || Type->isEnumeralType())
648 if (const auto *RD = Type->getAsCXXRecordDecl())
649 return HasNonDeletedDefaultedEqualityComparison(S, RD, KeyLoc);
667 CanonicalType,
false);
694 switch (
T.isNonTrivialToPrimitiveDestructiveMove()) {
696 return !
T.isDestructedType();
708 assert(!
T->isDependentType() &&
"Cannot evaluate traits of dependent type");
713 llvm_unreachable(
"not a UTT");
717 return T->isVoidType();
719 return T->isIntegralType(
C);
720 case UTT_IsFloatingPoint:
721 return T->isFloatingType();
725 if (
const auto *CAT =
C.getAsConstantArrayType(
T))
726 return CAT->getSize() != 0;
727 return T->isArrayType();
728 case UTT_IsBoundedArray:
733 if (
const auto *CAT =
C.getAsConstantArrayType(
T))
734 return CAT->getSize() != 0;
735 return T->isArrayType() && !
T->isIncompleteArrayType();
736 case UTT_IsUnboundedArray:
739 return T->isIncompleteArrayType();
741 return T->isAnyPointerType();
742 case UTT_IsLvalueReference:
743 return T->isLValueReferenceType();
744 case UTT_IsRvalueReference:
745 return T->isRValueReferenceType();
746 case UTT_IsMemberFunctionPointer:
747 return T->isMemberFunctionPointerType();
748 case UTT_IsMemberObjectPointer:
749 return T->isMemberDataPointerType();
751 return T->isEnumeralType();
752 case UTT_IsScopedEnum:
753 return T->isScopedEnumeralType();
755 return T->isUnionType();
757 return T->isClassType() ||
T->isStructureType() ||
T->isInterfaceType();
759 return T->isFunctionType();
763 case UTT_IsReference:
764 return T->isReferenceType();
765 case UTT_IsArithmetic:
766 return T->isArithmeticType() && !
T->isEnumeralType();
767 case UTT_IsFundamental:
768 return T->isFundamentalType();
770 return T->isObjectType();
776 if (
T->isObjCLifetimeType()) {
777 switch (
T.getObjCLifetime()) {
789 return T->isScalarType();
791 return T->isCompoundType();
792 case UTT_IsMemberPointer:
793 return T->isMemberPointerType();
798 return T.isConstQualified();
800 return T.isVolatileQualified();
802 return T.isTrivialType(
C);
803 case UTT_IsTriviallyCopyable:
804 return T.isTriviallyCopyableType(
C);
805 case UTT_IsStandardLayout:
806 return T->isStandardLayoutType();
808 return T.isPODType(
C);
810 return T->isLiteralType(
C);
815 case UTT_IsPolymorphic:
823 case UTT_IsAggregate:
827 return T->isAggregateType() ||
T->isVectorType() ||
T->isExtVectorType() ||
828 T->isAnyComplexType();
832 case UTT_IsInterfaceClass:
837 return RD->
hasAttr<FinalAttr>();
842 return T->isFloatingType() ||
843 (
T->isSignedIntegerType() && !
T->isEnumeralType());
846 return T->isUnsignedIntegerType() && !
T->isEnumeralType();
864 case UTT_HasTrivialDefaultConstructor:
875 case UTT_HasTrivialMoveConstructor:
885 case UTT_HasTrivialCopy:
891 if (
T.isPODType(
C) ||
T->isReferenceType())
897 case UTT_HasTrivialMoveAssign:
907 case UTT_HasTrivialAssign:
920 if (
T.isConstQualified())
928 case UTT_IsDestructible:
929 case UTT_IsTriviallyDestructible:
930 case UTT_IsNothrowDestructible:
933 if (
T->isReferenceType())
937 if (
T->isObjCLifetimeType() &&
944 if (
T->isIncompleteType() ||
T->isFunctionType())
949 if (UTT == UTT_IsTriviallyDestructible &&
T.isDestructedType())
956 if (
auto *RD =
C.getBaseElementType(
T)->getAsCXXRecordDecl()) {
967 if (UTT == UTT_IsNothrowDestructible) {
969 CPT =
Self.ResolveExceptionSpec(KeyLoc, CPT);
976 case UTT_HasTrivialDestructor:
983 if (
T.isPODType(
C) ||
T->isReferenceType())
987 if (
T->isObjCLifetimeType() &&
995 case UTT_HasNothrowAssign:
1003 if (
C.getBaseElementType(
T).isConstQualified())
1005 if (
T->isReferenceType())
1007 if (
T.isPODType(
C) ||
T->isObjCLifetimeType())
1010 if (
auto *RD =
T->getAsCXXRecordDecl())
1016 case UTT_HasNothrowMoveAssign:
1023 if (
auto *RD =
C.getBaseElementType(
T)->getAsCXXRecordDecl())
1029 case UTT_HasNothrowCopy:
1035 if (
T.isPODType(
C) ||
T->isReferenceType() ||
T->isObjCLifetimeType())
1042 bool FoundConstructor =
false;
1044 for (
const auto *ND :
Self.LookupConstructors(RD)) {
1055 FoundConstructor =
true;
1057 CPT =
Self.ResolveExceptionSpec(KeyLoc, CPT);
1067 return FoundConstructor;
1070 case UTT_HasNothrowConstructor:
1076 if (
T.isPODType(
C) ||
T->isObjCLifetimeType())
1078 if (
CXXRecordDecl *RD =
C.getBaseElementType(
T)->getAsCXXRecordDecl()) {
1083 bool FoundConstructor =
false;
1084 for (
const auto *ND :
Self.LookupConstructors(RD)) {
1093 FoundConstructor =
true;
1095 CPT =
Self.ResolveExceptionSpec(KeyLoc, CPT);
1104 return FoundConstructor;
1107 case UTT_HasVirtualDestructor:
1119 case UTT_IsCompleteType:
1123 return !
T->isIncompleteType();
1124 case UTT_HasUniqueObjectRepresentations:
1125 return C.hasUniqueObjectRepresentations(
T);
1126 case UTT_IsTriviallyRelocatable:
1128 case UTT_IsBitwiseCloneable:
1129 return T.isBitwiseCloneableType(
C);
1130 case UTT_IsCppTriviallyRelocatable:
1131 return Self.IsCXXTriviallyRelocatableType(
T);
1132 case UTT_IsReplaceable:
1133 return Self.IsCXXReplaceableType(
T);
1134 case UTT_CanPassInRegs:
1135 if (
CXXRecordDecl *RD =
T->getAsCXXRecordDecl(); RD && !
T.hasQualifiers())
1137 Self.Diag(KeyLoc, diag::err_builtin_pass_in_regs_non_class) <<
T;
1139 case UTT_IsTriviallyEqualityComparable:
1141 case UTT_IsImplicitLifetime: {
1143 tok::kw___builtin_is_implicit_lifetime);
1145 tok::kw___builtin_is_implicit_lifetime);
1151 QualType UnqualT =
T->getCanonicalTypeUnqualified();
1170 if (Ctr->isIneligibleOrNotSelected() || Ctr->isDeleted())
1172 if (Ctr->isTrivial())
1178 case UTT_IsIntangibleType:
1179 assert(
Self.getLangOpts().HLSL &&
"intangible types are HLSL-only feature");
1180 if (!
T->isVoidType() && !
T->isIncompleteArrayType())
1182 diag::err_incomplete_type))
1185 tok::kw___builtin_hlsl_is_intangible))
1187 return T->isHLSLIntangibleType();
1189 case UTT_IsTypedResourceElementCompatible:
1190 assert(
Self.getLangOpts().HLSL &&
1191 "typed resource element compatible types are an HLSL-only feature");
1192 if (
T->isIncompleteType())
1195 return Self.HLSL().IsTypedResourceElementCompatible(
T);
1206 SourceLocation KeyLoc, llvm::BumpPtrAllocator &OpaqueExprAllocator) {
1247 LhsT =
Self.Context.getRValueReferenceType(LhsT);
1283 case TypeTrait::UTT_StructuredBindingSize: {
1285 SourceRange ArgRange = Args[0]->getTypeLoc().getSourceRange();
1289 S.
Diag(KWLoc, diag::err_arg_is_not_destructurable) <<
T << ArgRange;
1297 llvm_unreachable(
"Not a SizeT type trait");
1314 if (Kind <=
BTT_Last && Kind != BTT_ReferenceBindsToTemporary &&
1315 Kind != BTT_ReferenceConstructsFromTemporary &&
1316 Kind != BTT_ReferenceConvertsFromTemporary)
1320 case clang::BTT_ReferenceBindsToTemporary:
1321 case clang::BTT_ReferenceConstructsFromTemporary:
1322 case clang::BTT_ReferenceConvertsFromTemporary:
1323 case clang::TT_IsConstructible:
1324 case clang::TT_IsNothrowConstructible:
1325 case clang::TT_IsTriviallyConstructible: {
1339 assert(!Args.empty());
1344 for (
const auto *TSI : Args) {
1350 KWLoc, ArgTy, diag::err_incomplete_type_used_in_type_trait_expr))
1356 if (
T->isIncompleteType() ||
T->isFunctionType())
1367 bool UseRawObjectType =
1368 Kind == clang::BTT_ReferenceBindsToTemporary ||
1369 Kind == clang::BTT_ReferenceConstructsFromTemporary ||
1370 Kind == clang::BTT_ReferenceConvertsFromTemporary;
1372 llvm::BumpPtrAllocator OpaqueExprAllocator;
1374 ArgExprs.reserve(Args.size() - 1);
1375 for (
unsigned I = 1, N = Args.size(); I != N; ++I) {
1376 QualType ArgTy = Args[I]->getType();
1396 Kind == clang::BTT_ReferenceConvertsFromTemporary
1407 if (Kind == clang::TT_IsConstructible)
1410 if (Kind == clang::BTT_ReferenceBindsToTemporary ||
1411 Kind == clang::BTT_ReferenceConstructsFromTemporary ||
1412 Kind == clang::BTT_ReferenceConvertsFromTemporary) {
1413 if (!
T->isReferenceType())
1417 if (
T.getNonReferenceType()->isFunctionType())
1420 if (!
Init.isDirectReferenceBinding())
1423 if (Kind == clang::BTT_ReferenceBindsToTemporary)
1427 if (
U->isReferenceType())
1435 OpaqueExprAllocator)
1439 if (Kind == clang::TT_IsNothrowConstructible)
1442 if (Kind == clang::TT_IsTriviallyConstructible) {
1445 if (
T.getNonReferenceType().hasNonTrivialObjCLifetime())
1450 return !Result.get()->hasNonTrivialCall(S.
Context);
1453 llvm_unreachable(
"unhandled type trait");
1457 llvm_unreachable(
"not a TT");
1467 case UTT_HasNothrowAssign:
1468 case UTT_HasNothrowMoveAssign:
1469 Replacement = BTT_IsNothrowAssignable;
1471 case UTT_HasNothrowCopy:
1472 case UTT_HasNothrowConstructor:
1473 Replacement = TT_IsNothrowConstructible;
1475 case UTT_HasTrivialAssign:
1476 case UTT_HasTrivialMoveAssign:
1477 Replacement = BTT_IsTriviallyAssignable;
1479 case UTT_HasTrivialCopy:
1480 Replacement = UTT_IsTriviallyCopyable;
1482 case UTT_HasTrivialDefaultConstructor:
1483 case UTT_HasTrivialMoveConstructor:
1484 Replacement = TT_IsTriviallyConstructible;
1486 case UTT_HasTrivialDestructor:
1487 Replacement = UTT_IsTriviallyDestructible;
1489 case UTT_IsTriviallyRelocatable:
1490 Replacement = clang::UTT_IsCppTriviallyRelocatable;
1492 case BTT_ReferenceBindsToTemporary:
1493 Replacement = clang::BTT_ReferenceConstructsFromTemporary;
1498 S.
Diag(KWLoc, diag::warn_deprecated_builtin)
1504 if (Arity && N != Arity) {
1505 Diag(Loc, diag::err_type_trait_arity)
1506 << Arity << 0 << (Arity > 1) << (
int)N <<
SourceRange(Loc);
1510 if (!Arity && N == 0) {
1511 Diag(Loc, diag::err_type_trait_arity)
1524 if (Kind == TypeTrait::UTT_StructuredBindingSize)
1536 *
this, Kind, KWLoc, Args[0]->
getType()))
1539 DiagnoseBuiltinDeprecation(*
this, Kind, KWLoc);
1542 for (
unsigned I = 0, N = Args.size(); I != N; ++I) {
1543 if (Args[I]->
getType()->isDependentType()) {
1554 KWLoc, Kind, Args, RParenLoc,
Result);
1560 Args, RParenLoc,
Result);
1563 llvm_unreachable(
"unhandled type trait return type");
1570 ConvertedArgs.reserve(Args.size());
1572 for (
unsigned I = 0, N = Args.size(); I != N; ++I) {
1576 TInfo =
Context.getTrivialTypeSourceInfo(
T, KWLoc);
1578 ConvertedArgs.push_back(TInfo);
1591 const RecordType *lhsRecord = LhsT->
getAsCanonical<RecordType>();
1592 const RecordType *rhsRecord = RhsT->
getAsCanonical<RecordType>();
1593 if (!rhsRecord || !lhsRecord) {
1596 if (!LHSObjTy || !RHSObjTy)
1601 if (!BaseInterface || !DerivedInterface)
1605 diag::err_incomplete_type_used_in_type_trait_expr))
1611 assert(
Context.hasSameUnqualifiedType(LhsT, RhsT) ==
1612 (lhsRecord == rhsRecord));
1616 if (lhsRecord && lhsRecord->getOriginalDecl()->isUnion())
1618 if (rhsRecord && rhsRecord->getOriginalDecl()->isUnion())
1621 if (lhsRecord == rhsRecord)
1629 diag::err_incomplete_type_used_in_type_trait_expr))
1644 "Cannot evaluate traits of dependent types");
1650 case BTT_IsVirtualBaseOf: {
1651 const RecordType *BaseRecord = LhsT->
getAsCanonical<RecordType>();
1652 const RecordType *DerivedRecord = RhsT->
getAsCanonical<RecordType>();
1654 if (!BaseRecord || !DerivedRecord) {
1656 tok::kw___builtin_is_virtual_base_of);
1658 tok::kw___builtin_is_virtual_base_of);
1662 if (BaseRecord->isUnionType() || DerivedRecord->isUnionType())
1665 if (!BaseRecord->isStructureOrClassType() ||
1666 !DerivedRecord->isStructureOrClassType())
1670 diag::err_incomplete_type))
1674 ->isVirtuallyDerivedFrom(
1678 return Self.Context.hasSameType(LhsT, RhsT);
1679 case BTT_TypeCompatible: {
1682 QualType Lhs =
Self.getASTContext().getUnqualifiedArrayType(LhsT, LhsQuals);
1683 QualType Rhs =
Self.getASTContext().getUnqualifiedArrayType(RhsT, RhsQuals);
1684 return Self.Context.typesAreCompatible(Lhs, Rhs);
1686 case BTT_IsConvertible:
1687 case BTT_IsConvertibleTo:
1688 case BTT_IsNothrowConvertible: {
1691 llvm::BumpPtrAllocator OpaqueExprAllocator;
1693 OpaqueExprAllocator);
1694 if (Result.isInvalid())
1697 if (BTT != BTT_IsNothrowConvertible)
1703 case BTT_IsAssignable:
1704 case BTT_IsNothrowAssignable:
1705 case BTT_IsTriviallyAssignable: {
1718 Self.RequireCompleteType(
1720 diag::err_incomplete_type_used_in_type_trait_expr))
1723 Self.RequireCompleteType(
1725 diag::err_incomplete_type_used_in_type_trait_expr))
1735 if (Ty->isObjectType() || Ty->isFunctionType())
1736 Ty =
Self.Context.getRValueReferenceType(Ty);
1737 return {KeyLoc, Ty.getNonLValueExprType(
Self.Context),
1741 auto Lhs = createDeclValExpr(LhsT);
1742 auto Rhs = createDeclValExpr(RhsT);
1751 Self.BuildBinOp(
nullptr, KeyLoc, BO_Assign, &Lhs, &Rhs);
1752 if (Result.isInvalid())
1756 Self.CheckUnusedVolatileAssignment(Result.get());
1761 if (BTT == BTT_IsAssignable)
1764 if (BTT == BTT_IsNothrowAssignable)
1767 if (BTT == BTT_IsTriviallyAssignable) {
1773 if (Context.containsAddressDiscriminatedPointerAuth(LhsT) ||
1774 Context.containsAddressDiscriminatedPointerAuth(RhsT))
1776 return !Result.get()->hasNonTrivialCall(
Self.Context);
1779 llvm_unreachable(
"unhandled type trait");
1782 case BTT_IsLayoutCompatible: {
1785 diag::err_incomplete_type);
1788 diag::err_incomplete_type);
1793 return Self.IsLayoutCompatible(LhsT, RhsT);
1795 case BTT_IsPointerInterconvertibleBaseOf: {
1797 !
Self.getASTContext().hasSameUnqualifiedType(LhsT, RhsT)) {
1799 diag::err_incomplete_type);
1803 tok::kw___is_pointer_interconvertible_base_of);
1805 tok::kw___is_pointer_interconvertible_base_of);
1807 return Self.IsPointerInterconvertibleBaseOf(Lhs, Rhs);
1809 case BTT_IsDeducible: {
1812 return Self.DeduceTemplateArgumentsFromType(
1813 TSTToBeDeduced->getTemplateName().getAsTemplateDecl(), RhsT,
1816 case BTT_IsScalarizedLayoutCompatible: {
1819 diag::err_incomplete_type))
1823 diag::err_incomplete_type))
1827 Self, Lhs, tok::kw___builtin_hlsl_is_scalarized_layout_compatible);
1829 Self, Rhs, tok::kw___builtin_hlsl_is_scalarized_layout_compatible);
1831 return Self.HLSL().IsScalarizedLayoutCompatible(LhsT, RhsT);
1833 case BTT_LtSynthesizesFromSpaceship:
1834 case BTT_LeSynthesizesFromSpaceship:
1835 case BTT_GtSynthesizesFromSpaceship:
1836 case BTT_GeSynthesizesFromSpaceship: {
1855 case BTT_LtSynthesizesFromSpaceship:
1856 return BinaryOperatorKind::BO_LT;
1857 case BTT_LeSynthesizesFromSpaceship:
1858 return BinaryOperatorKind::BO_LE;
1859 case BTT_GtSynthesizesFromSpaceship:
1860 return BinaryOperatorKind::BO_GT;
1861 case BTT_GeSynthesizesFromSpaceship:
1862 return BinaryOperatorKind::BO_GE;
1864 llvm_unreachable(
"Trying to Synthesize non-comparison operator?");
1869 Self.LookupBinOp(
Self.TUScope, KeyLoc, OpKind, Functions);
1872 Self.CreateOverloadedBinOp(KeyLoc, OpKind, Functions, &LHS, &RHS);
1879 llvm_unreachable(
"not a BTT");
1881 llvm_unreachable(
"Unknown type trait or not implemented");
1890 TSInfo =
Context.getTrivialTypeSourceInfo(
T);
1898 assert(!
T->isDependentType() &&
"Cannot evaluate traits of dependent type");
1902 if (
T->isArrayType()) {
1906 T = AT->getElementType();
1912 case ATT_ArrayExtent: {
1915 if (
Self.VerifyIntegerConstantExpression(
1916 DimExpr, &
Value, diag::err_dimension_expr_not_constant_integer)
1919 if (
Value.isSigned() &&
Value.isNegative()) {
1920 Self.Diag(KeyLoc, diag::err_dimension_expr_not_constant_integer)
1926 if (
T->isArrayType()) {
1928 bool Matched =
false;
1935 T = AT->getElementType();
1938 if (Matched &&
T->isArrayType()) {
1940 Self.Context.getAsConstantArrayType(
T))
1941 return CAT->getLimitedSize();
1947 llvm_unreachable(
"Unknown type trait or not implemented");
1958 if (!
T->isDependentType())
1967 RParen,
Context.getSizeType());
1983 case ET_IsLValueExpr:
1985 case ET_IsRValueExpr:
1988 llvm_unreachable(
"Expression trait not covered by switch");
2009 return llvm::StringSwitch<std::optional<TypeTrait>>(Name)
2010 .Case(
"is_trivially_relocatable",
2011 TypeTrait::UTT_IsCppTriviallyRelocatable)
2012 .Case(
"is_replaceable", TypeTrait::UTT_IsReplaceable)
2013 .Case(
"is_trivially_copyable", TypeTrait::UTT_IsTriviallyCopyable)
2014 .Case(
"is_assignable", TypeTrait::BTT_IsAssignable)
2015 .Case(
"is_empty", TypeTrait::UTT_IsEmpty)
2016 .Case(
"is_standard_layout", TypeTrait::UTT_IsStandardLayout)
2017 .Case(
"is_aggregate", TypeTrait::UTT_IsAggregate)
2018 .Case(
"is_constructible", TypeTrait::TT_IsConstructible)
2019 .Case(
"is_final", TypeTrait::UTT_IsFinal)
2020 .Case(
"is_abstract", TypeTrait::UTT_IsAbstract)
2021 .Default(std::nullopt);
2025 std::optional<std::pair<TypeTrait, llvm::SmallVector<QualType, 1>>>;
2033 std::optional<TypeTrait> Trait;
2036 if (
const auto *TraitExpr = dyn_cast<TypeTraitExpr>(E)) {
2037 Trait = TraitExpr->getTrait();
2038 for (
const auto *Arg : TraitExpr->getArgs())
2039 Args.push_back(Arg->getType());
2040 return {{Trait.value(), std::move(Args)}};
2042 const auto *Ref = dyn_cast<DeclRefExpr>(E);
2044 return std::nullopt;
2047 if (
const auto *VD =
2048 dyn_cast<VarTemplateSpecializationDecl>(Ref->getDecl())) {
2049 if (!VD->isInStdNamespace())
2050 return std::nullopt;
2051 StringRef Name = VD->getIdentifier()->getName();
2052 if (!Name.consume_back(
"_v"))
2053 return std::nullopt;
2056 return std::nullopt;
2057 for (
const auto &Arg : VD->getTemplateArgs().asArray()) {
2059 for (
const auto &InnerArg : Arg.pack_elements())
2060 Args.push_back(InnerArg.getAsType());
2062 Args.push_back(Arg.getAsType());
2064 llvm_unreachable(
"Unexpected kind");
2067 return {{Trait.value(), std::move(Args)}};
2071 if (
const auto *VD = dyn_cast<VarDecl>(Ref->getDecl());
2072 Ref->hasQualifier() && VD && VD->getIdentifier()->isStr(
"value")) {
2075 return std::nullopt;
2076 const auto *Ts = Qualifier.getAsType()->getAs<TemplateSpecializationType>();
2078 return std::nullopt;
2079 const TemplateDecl *D = Ts->getTemplateName().getAsTemplateDecl();
2081 return std::nullopt;
2084 return std::nullopt;
2085 for (
const auto &Arg : Ts->template_arguments())
2086 Args.push_back(Arg.getAsType());
2087 return {{Trait.value(), std::move(Args)}};
2089 return std::nullopt;
2097 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2098 << diag::TraitNotSatisfiedReason::UnionWithUserDeclaredSMF << K;
2112 const auto *
Decl = cast_or_null<CXXConstructorDecl>(
2114 if (
Decl &&
Decl->isUserProvided())
2115 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2116 << diag::TraitNotSatisfiedReason::UserProvidedCtr
2122 if (
Decl &&
Decl->isUserProvided())
2123 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2124 << diag::TraitNotSatisfiedReason::UserProvidedAssign
2128 Dtr = Dtr->getCanonicalDecl();
2129 if (Dtr->isUserProvided() && !Dtr->isDefaulted())
2130 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2131 << diag::TraitNotSatisfiedReason::DeletedDtr << 1
2132 << Dtr->getSourceRange();
2140 assert(B.getType()->getAsCXXRecordDecl() &&
"invalid base?");
2142 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2143 << diag::TraitNotSatisfiedReason::VBase << B.getType()
2144 << B.getSourceRange();
2146 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2147 << diag::TraitNotSatisfiedReason::NTRBase << B.getType()
2148 << B.getSourceRange();
2151 if (!Field->getType()->isReferenceType() &&
2153 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2154 << diag::TraitNotSatisfiedReason::NTRField << Field
2155 << Field->getType() << Field->getSourceRange();
2158 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2159 << diag::TraitNotSatisfiedReason::DeletedDtr << 0
2162 if (D->
hasAttr<TriviallyRelocatableAttr>())
2170 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait)
2171 <<
T << diag::TraitName::TriviallyRelocatable;
2172 if (
T->isVariablyModifiedType())
2173 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2174 << diag::TraitNotSatisfiedReason::VLA;
2176 if (
T->isReferenceType())
2177 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2178 << diag::TraitNotSatisfiedReason::Ref;
2179 T =
T.getNonReferenceType();
2181 if (
T.hasNonTrivialObjCLifetime())
2182 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2183 << diag::TraitNotSatisfiedReason::HasArcLifetime;
2198 assert(B.getType()->getAsCXXRecordDecl() &&
"invalid base?");
2200 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2201 << diag::TraitNotSatisfiedReason::NonReplaceableBase << B.getType()
2202 << B.getSourceRange();
2206 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2207 << diag::TraitNotSatisfiedReason::NonReplaceableField << Field
2208 << Field->getType() << Field->getSourceRange();
2211 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2212 << diag::TraitNotSatisfiedReason::DeletedDtr << 0
2219 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2220 << diag::TraitNotSatisfiedReason::DeletedCtr
2227 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2228 << diag::TraitNotSatisfiedReason::DeletedAssign
2232 if (D->
hasAttr<ReplaceableAttr>())
2239 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait)
2240 <<
T << diag::TraitName::Replaceable;
2242 if (
T->isVariablyModifiedType())
2243 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2244 << diag::TraitNotSatisfiedReason::VLA;
2246 if (
T->isReferenceType())
2247 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2248 << diag::TraitNotSatisfiedReason::Ref;
2249 T =
T.getNonReferenceType();
2251 if (
T.isConstQualified())
2252 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2253 << diag::TraitNotSatisfiedReason::Const;
2255 if (
T.isVolatileQualified())
2256 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2257 << diag::TraitNotSatisfiedReason::Volatile;
2259 bool IsArray =
T->isArrayType();
2262 if (
T->isScalarType())
2267 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2268 << diag::TraitNotSatisfiedReason::NotScalarOrClass << IsArray;
2285 assert(B.getType()->getAsCXXRecordDecl() &&
"invalid base?");
2287 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2288 << diag::TraitNotSatisfiedReason::VBase << B.getType()
2289 << B.getSourceRange();
2290 if (!B.getType().isTriviallyCopyableType(D->
getASTContext())) {
2291 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2292 << diag::TraitNotSatisfiedReason::NTCBase << B.getType()
2293 << B.getSourceRange();
2297 if (!Field->getType().isTriviallyCopyableType(Field->getASTContext()))
2298 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2299 << diag::TraitNotSatisfiedReason::NTCField << Field
2300 << Field->getType() << Field->getSourceRange();
2304 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2305 << diag::TraitNotSatisfiedReason::DeletedDtr
2309 if (Method->isTrivial() || !Method->isUserProvided()) {
2312 auto SpecialMemberKind =
2314 switch (SpecialMemberKind) {
2326 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2327 << (IsAssignment ? diag::TraitNotSatisfiedReason::UserProvidedAssign
2328 : diag::TraitNotSatisfiedReason::UserProvidedCtr)
2329 << IsMove << Method->getSourceRange();
2345 bool ContainsVoid =
false;
2347 ContainsVoid |= ArgTy->isVoidType();
2351 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2352 << diag::TraitNotSatisfiedReason::CVVoidType;
2355 if (
T->isFunctionType())
2356 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2357 << diag::TraitNotSatisfiedReason::FunctionType;
2359 if (
T->isIncompleteArrayType())
2360 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2361 << diag::TraitNotSatisfiedReason::IncompleteArrayType;
2367 llvm::BumpPtrAllocator OpaqueExprAllocator;
2369 ArgExprs.reserve(Ts.size() - 1);
2370 for (
unsigned I = 1, N = Ts.size(); I != N; ++I) {
2388 Init.Diagnose(SemaRef, To, InitKind, ArgExprs);
2394 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait)
2395 <<
T << diag::TraitName::TriviallyCopyable;
2397 if (
T->isReferenceType())
2398 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2399 << diag::TraitNotSatisfiedReason::Ref;
2416 if (Ty->isObjectType() || Ty->isFunctionType())
2418 return {Loc, Ty.getNonLValueExprType(SemaRef.
Context),
2422 auto LHS = createDeclValExpr(
T);
2423 auto RHS = createDeclValExpr(
U);
2429 SemaRef.
BuildBinOp(
nullptr, Loc, BO_Assign, &LHS, &RHS);
2440 for (
const auto *Field : D->
fields()) {
2441 if (Field->isZeroLengthBitField())
2443 if (Field->isBitField()) {
2444 S.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2445 << diag::TraitNotSatisfiedReason::NonZeroLengthField << Field
2446 << Field->getSourceRange();
2449 S.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2450 << diag::TraitNotSatisfiedReason::NonEmptyMember << Field
2451 << Field->getType() << Field->getSourceRange();
2455 for (
const auto *M : D->
methods()) {
2456 if (M->isVirtual()) {
2457 S.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2458 << diag::TraitNotSatisfiedReason::VirtualFunction << M
2459 << M->getSourceRange();
2465 for (
const auto &B : D->
bases()) {
2466 const auto *BR = B.getType()->getAsCXXRecordDecl();
2467 if (!BR || BR->isInvalidDecl())
2469 if (B.isVirtual()) {
2470 S.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2471 << diag::TraitNotSatisfiedReason::VBase << B.getType()
2472 << B.getSourceRange();
2474 if (!BR->isEmpty()) {
2475 S.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2476 << diag::TraitNotSatisfiedReason::NonEmptyBase << B.getType()
2477 << B.getSourceRange();
2484 S.
Diag(Loc, diag::note_unsatisfied_trait) <<
T << diag::TraitName::Empty;
2489 if (
T->isReferenceType())
2490 S.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2491 << diag::TraitNotSatisfiedReason::Ref;
2492 T =
T.getNonReferenceType();
2495 T = AT->getElementType();
2497 if (
auto *D =
T->getAsCXXRecordDecl()) {
2498 if (D->hasDefinition()) {
2500 S.
Diag(D->getLocation(), diag::note_defined_here) << D;
2512 S.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2513 << diag::TraitNotSatisfiedReason::NotMarkedFinal;
2521 S.
Diag(Loc, diag::note_unsatisfied_trait) <<
T << diag::TraitName::Final;
2522 if (
T->isReferenceType()) {
2523 S.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2524 << diag::TraitNotSatisfiedReason::Ref;
2525 S.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2526 << diag::TraitNotSatisfiedReason::NotClassOrUnion;
2531 S.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2532 << diag::TraitNotSatisfiedReason::NotClassOrUnion;
2535 if (
T->isFunctionType()) {
2536 S.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2537 << diag::TraitNotSatisfiedReason::FunctionType;
2538 S.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2539 << diag::TraitNotSatisfiedReason::NotClassOrUnion;
2542 if (!
T->isRecordType()) {
2543 S.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2544 << diag::TraitNotSatisfiedReason::NotClassOrUnion;
2547 if (
const auto *D =
T->getAsCXXRecordDecl())
2552 int NumBasesWithFields = 0;
2559 if (!Field->isUnnamedBitField()) {
2560 if (++NumBasesWithFields > 1)
2572 assert(B.getType()->getAsCXXRecordDecl() &&
"invalid base?");
2573 if (B.isVirtual()) {
2574 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2575 << diag::TraitNotSatisfiedReason::VBase << B.getType()
2576 << B.getSourceRange();
2578 if (!B.getType()->isStandardLayoutType()) {
2579 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2580 << diag::TraitNotSatisfiedReason::NonStandardLayoutBase << B.getType()
2581 << B.getSourceRange();
2589 if (Field->isUnnamedBitField())
2600 if (Field->getAccess() != FirstAccess) {
2602 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2603 << diag::TraitNotSatisfiedReason::MixedAccess;
2608 SemaRef.
Diag(Field->getLocation(), diag::note_unsatisfied_trait_reason)
2609 << diag::TraitNotSatisfiedReason::MixedAccessField << Field
2617 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2618 << diag::TraitNotSatisfiedReason::MultipleDataBase;
2624 for (
const auto *M : D->
methods()) {
2625 if (M->isVirtual()) {
2631 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2632 << diag::TraitNotSatisfiedReason::VirtualFunction << VirtualMD;
2633 SemaRef.
Diag(VirtualMD->getLocation(), diag::note_defined_here)
2637 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2638 << diag::TraitNotSatisfiedReason::VirtualFunction << D;
2639 SemaRef.
Diag(D->getLocation(), diag::note_defined_here) << D;
2643 if (!Field->getType()->isStandardLayoutType()) {
2644 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2645 << diag::TraitNotSatisfiedReason::NonStandardLayoutMember << Field
2646 << Field->getType() << Field->getSourceRange();
2660 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2661 << diag::TraitNotSatisfiedReason::IndirectBaseWithFields << Indirect
2669 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait)
2670 <<
T << diag::TraitName::StandardLayout;
2673 if (
T->isVariablyModifiedType()) {
2674 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2675 << diag::TraitNotSatisfiedReason::VLA;
2679 if (
T->isReferenceType()) {
2680 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2681 << diag::TraitNotSatisfiedReason::Ref;
2684 T =
T.getNonReferenceType();
2698 if (Ctor->isUserProvided())
2699 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2700 << diag::TraitNotSatisfiedReason::UserDeclaredCtr;
2701 if (Ctor->isInheritingConstructor())
2702 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2703 << diag::TraitNotSatisfiedReason::InheritedCtr;
2706 if (llvm::any_of(D->
decls(), [](
auto const *Sub) {
2707 return isa<ConstructorUsingShadowDecl>(Sub);
2709 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2710 << diag::TraitNotSatisfiedReason::InheritedCtr;
2714 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2715 << diag::TraitNotSatisfiedReason::PolymorphicType
2719 if (B.isVirtual()) {
2720 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2721 << diag::TraitNotSatisfiedReason::VBase << B.getType()
2722 << B.getSourceRange();
2729 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2730 << diag::TraitNotSatisfiedReason::PrivateProtectedDirectBase
2739 if (Method->isVirtual()) {
2740 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2741 << diag::TraitNotSatisfiedReason::VirtualFunction << Method
2742 << Method->getSourceRange();
2751 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2752 << diag::TraitNotSatisfiedReason::PrivateProtectedDirectDataMember
2765 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait)
2766 <<
T << diag::TraitName::Aggregate;
2768 if (
T->isVoidType())
2769 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2770 << diag::TraitNotSatisfiedReason::CVVoidType;
2772 T =
T.getNonReferenceType();
2786 if (B.getType()->castAsCXXRecordDecl()->isAbstract()) {
2787 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2788 << diag::TraitNotSatisfiedReason::OverridesAllPureVirtual
2789 << B.getType() << B.getSourceRange();
2796 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait)
2797 <<
T << diag::TraitName::Abstract;
2799 if (
T->isReferenceType()) {
2800 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2801 << diag::TraitNotSatisfiedReason::Ref;
2802 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2803 << diag::TraitNotSatisfiedReason::NotStructOrClass;
2807 if (
T->isUnionType()) {
2808 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2809 << diag::TraitNotSatisfiedReason::UnionType;
2810 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2811 << diag::TraitNotSatisfiedReason::NotStructOrClass;
2816 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2817 << diag::TraitNotSatisfiedReason::ArrayType;
2818 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2819 << diag::TraitNotSatisfiedReason::NotStructOrClass;
2823 if (
T->isFunctionType()) {
2824 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2825 << diag::TraitNotSatisfiedReason::FunctionType;
2826 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2827 << diag::TraitNotSatisfiedReason::NotStructOrClass;
2831 if (
T->isPointerType()) {
2832 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2833 << diag::TraitNotSatisfiedReason::PointerType;
2834 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2835 << diag::TraitNotSatisfiedReason::NotStructOrClass;
2839 if (!
T->isStructureOrClassType()) {
2840 SemaRef.
Diag(Loc, diag::note_unsatisfied_trait_reason)
2841 << diag::TraitNotSatisfiedReason::NotStructOrClass;
2859 const auto &[Trait, Args] = TraitInfo.value();
2861 case UTT_IsCppTriviallyRelocatable:
2864 case UTT_IsReplaceable:
2867 case UTT_IsTriviallyCopyable:
2870 case BTT_IsAssignable:
2876 case UTT_IsStandardLayout:
2879 case TT_IsConstructible:
2882 case UTT_IsAggregate:
2894 case UTT_IsAbstract:
static CanQualType GetReturnType(QualType RetTy)
Returns the "extra-canonicalized" return type, which discards qualifiers on the return type.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the Diagnostic IDs-related interfaces.
This file declares semantic analysis for HLSL constructs.
static bool EvaluateBinaryTypeTrait(Sema &Self, TypeTrait BTT, const TypeSourceInfo *Lhs, const TypeSourceInfo *Rhs, SourceLocation KeyLoc)
static bool HasNonDeletedDefaultedEqualityComparison(Sema &S, const CXXRecordDecl *Decl, SourceLocation KeyLoc)
static void DiagnoseNonAbstractReason(Sema &SemaRef, SourceLocation Loc, const CXXRecordDecl *D)
static APValue EvaluateSizeTTypeTrait(Sema &S, TypeTrait Kind, SourceLocation KWLoc, ArrayRef< TypeSourceInfo * > Args, SourceLocation RParenLoc, bool IsDependent)
static bool DiagnoseVLAInCXXTypeTrait(Sema &S, const TypeSourceInfo *T, clang::tok::TokenKind TypeTraitID)
Checks that type T is not a VLA.
static bool HasNoThrowOperator(CXXRecordDecl *RD, OverloadedOperatorKind Op, Sema &Self, SourceLocation KeyLoc, ASTContext &C, bool(CXXRecordDecl::*HasTrivial)() const, bool(CXXRecordDecl::*HasNonTrivial)() const, bool(CXXMethodDecl::*IsDesiredOp)() const)
static std::optional< TypeTrait > StdNameToTypeTrait(StringRef Name)
static void DiagnoseNonConstructibleReason(Sema &SemaRef, SourceLocation Loc, const llvm::SmallVector< clang::QualType, 1 > &Ts)
static bool IsEligibleForTrivialRelocation(Sema &SemaRef, const CXXRecordDecl *D)
static CXXMethodDecl * LookupSpecialMemberFromXValue(Sema &SemaRef, const CXXRecordDecl *RD, bool Assign)
static bool hasSuitableMoveAssignmentOperatorForRelocation(Sema &SemaRef, const CXXRecordDecl *D, bool AllowUserDefined)
static bool DiagnoseAtomicInCXXTypeTrait(Sema &S, const TypeSourceInfo *T, clang::tok::TokenKind TypeTraitID)
Checks that type T is not an atomic type (_Atomic).
static void DiagnoseNonStandardLayoutReason(Sema &SemaRef, SourceLocation Loc, const CXXRecordDecl *D)
static void DiagnoseIsFinalReason(Sema &S, SourceLocation Loc, const CXXRecordDecl *D)
static void DiagnoseIsEmptyReason(Sema &S, SourceLocation Loc, const CXXRecordDecl *D)
static bool hasMultipleDataBaseClassesWithFields(const CXXRecordDecl *D)
static bool IsEligibleForReplacement(Sema &SemaRef, const CXXRecordDecl *D)
static bool EvaluateExpressionTrait(ExpressionTrait ET, Expr *E)
static ExtractedTypeTraitInfo ExtractTypeTraitFromExpression(const Expr *E)
std::optional< std::pair< TypeTrait, llvm::SmallVector< QualType, 1 > > > ExtractedTypeTraitInfo
static void DiagnoseNonTriviallyRelocatableReason(Sema &SemaRef, SourceLocation Loc, const CXXRecordDecl *D)
static void DiagnoseNonAssignableReason(Sema &SemaRef, SourceLocation Loc, QualType T, QualType U)
static bool IsTriviallyRelocatableType(Sema &SemaRef, QualType T)
static void DiagnoseNonDefaultMovable(Sema &SemaRef, SourceLocation Loc, const CXXRecordDecl *D)
static bool IsDefaultMovable(Sema &SemaRef, const CXXRecordDecl *D)
static bool hasSuitableConstructorForRelocation(Sema &SemaRef, const CXXRecordDecl *D, bool AllowUserDefined)
static void DiagnoseNonTriviallyCopyableReason(Sema &SemaRef, SourceLocation Loc, const CXXRecordDecl *D)
static bool EvaluateUnaryTypeTrait(Sema &Self, TypeTrait UTT, SourceLocation KeyLoc, TypeSourceInfo *TInfo)
static uint64_t EvaluateArrayTypeTrait(Sema &Self, ArrayTypeTrait ATT, QualType T, Expr *DimExpr, SourceLocation KeyLoc)
static bool CheckUnaryTypeTraitTypeCompleteness(Sema &S, TypeTrait UTT, SourceLocation Loc, QualType ArgTy)
Check the completeness of a type in a unary type trait.
static ExprResult CheckConvertibilityForTypeTraits(Sema &Self, const TypeSourceInfo *Lhs, const TypeSourceInfo *Rhs, SourceLocation KeyLoc, llvm::BumpPtrAllocator &OpaqueExprAllocator)
static void DiagnoseNonReplaceableReason(Sema &SemaRef, SourceLocation Loc, const CXXRecordDecl *D)
static void DiagnoseNonAggregateReason(Sema &SemaRef, SourceLocation Loc, const CXXRecordDecl *D)
static bool EvaluateBooleanTypeTrait(Sema &S, TypeTrait Kind, SourceLocation KWLoc, ArrayRef< TypeSourceInfo * > Args, SourceLocation RParenLoc, bool IsDependent)
static bool IsCXXReplaceableType(Sema &S, const CXXRecordDecl *RD)
static bool isTriviallyEqualityComparableType(Sema &S, QualType Type, SourceLocation KeyLoc)
Defines various enumerations that describe declaration and type specifiers.
Defines enumerations for the type traits support.
C Language Family Type Representation.
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
TranslationUnitDecl * getTranslationUnitDecl() const
QualType getRValueReferenceType(QualType T) const
Return the uniqued reference to the type for an rvalue reference to the specified type.
DeclarationNameTable DeclarationNames
void setRelocationInfoForCXXRecord(const CXXRecordDecl *, CXXRecordDeclRelocationInfo)
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
bool containsAddressDiscriminatedPointerAuth(QualType T) const
Examines a given type, and returns whether the type itself is address discriminated,...
bool hasUniqueObjectRepresentations(QualType Ty, bool CheckIfTriviallyCopyable=true) const
Return true if the specified type has unique object representations according to (C++17 [meta....
QualType getBaseElementType(const ArrayType *VAT) const
Return the innermost element type of an array type.
bool hasSameUnqualifiedType(QualType T1, QualType T2) const
Determine whether the given types are equivalent after cvr-qualifiers have been removed.
const ArrayType * getAsArrayType(QualType T) const
Type Query functions.
TypeSourceInfo * CreateTypeSourceInfo(QualType T, unsigned Size=0) const
Allocate an uninitialized TypeSourceInfo.
llvm::APSInt MakeIntValue(uint64_t Value, QualType Type) const
Make an APSInt of the appropriate width and signedness for the given Value and integer Type.
QualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
CanQualType getCanonicalTagType(const TagDecl *TD) const
std::optional< CXXRecordDeclRelocationInfo > getRelocationInfoForCXXRecord(const CXXRecordDecl *) const
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Represents a base class of a C++ class.
Represents a C++ constructor within a class.
Represents a C++ destructor within a class.
CXXDestructorDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
Represents a static or instance method of a struct/union/class.
bool isMoveAssignmentOperator() const
Determine whether this is a move assignment operator.
bool isCopyAssignmentOperator() const
Determine whether this is a copy-assignment operator, regardless of whether it was declared implicitl...
Represents a C++ struct/union/class.
bool hasTrivialMoveAssignment() const
Determine whether this class has a trivial move assignment operator (C++11 [class....
bool hasNonTrivialCopyAssignment() const
Determine whether this class has a non-trivial copy assignment operator (C++ [class....
bool isEffectivelyFinal() const
Determine whether it's impossible for a class to be derived from this class.
bool hasSimpleMoveConstructor() const
true if we know for sure that this class has a single, accessible, unambiguous move constructor that ...
bool hasTrivialDefaultConstructor() const
Determine whether this class has a trivial default constructor (C++11 [class.ctor]p5).
bool hasTrivialDestructor() const
Determine whether this class has a trivial destructor (C++ [class.dtor]p3)
bool hasUserDeclaredDestructor() const
Determine whether this class has a user-declared destructor.
bool hasUserDeclaredMoveAssignment() const
Determine whether this class has had a move assignment declared by the user.
bool hasDeletedDestructor() const
Returns the destructor decl for this class.
bool hasTrivialMoveConstructor() const
Determine whether this class has a trivial move constructor (C++11 [class.copy]p12)
bool hasUserDeclaredCopyAssignment() const
Determine whether this class has a user-declared copy assignment operator.
method_range methods() const
CXXRecordDecl * getDefinition() const
bool hasTrivialCopyConstructor() const
Determine whether this class has a trivial copy constructor (C++ [class.copy]p6, C++11 [class....
bool isPolymorphic() const
Whether this class is polymorphic (C++ [class.virtual]), which means that the class contains or inher...
bool hasTrivialCopyAssignment() const
Determine whether this class has a trivial copy assignment operator (C++ [class.copy]p11,...
bool isAbstract() const
Determine whether this class has a pure virtual function.
bool hasSimpleMoveAssignment() const
true if we know for sure that this class has a single, accessible, unambiguous move assignment operat...
bool hasNonTrivialMoveConstructor() const
Determine whether this class has a non-trivial move constructor (C++11 [class.copy]p12)
bool hasDirectFields() const
Determine whether this class has direct non-static data members.
bool hasUserDeclaredCopyConstructor() const
Determine whether this class has a user-declared copy constructor.
bool hasDefinition() const
bool hasSimpleCopyConstructor() const
true if we know for sure that this class has a single, accessible, unambiguous copy constructor that ...
bool isEmpty() const
Determine whether this is an empty class in the sense of (C++11 [meta.unary.prop]).
CXXDestructorDecl * getDestructor() const
Returns the destructor decl for this class.
bool hasNonTrivialMoveAssignment() const
Determine whether this class has a non-trivial move assignment operator (C++11 [class....
bool hasUserDeclaredMoveOperation() const
Whether this class has a user-declared move constructor or assignment operator.
bool hasNonTrivialDefaultConstructor() const
Determine whether this class has a non-trivial default constructor (C++11 [class.ctor]p5).
bool hasUserDeclaredMoveConstructor() const
Determine whether this class has had a move constructor declared by the user.
bool forallBases(ForallBasesCallback BaseMatches) const
Determines if the given callback holds for all the direct or indirect base classes of this type.
bool hasNonTrivialCopyConstructor() const
Determine whether this class has a non-trivial copy constructor (C++ [class.copy]p6,...
bool hasSimpleCopyAssignment() const
true if we know for sure that this class has a single, accessible, unambiguous copy assignment operat...
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
FunctionDecl * getDirectCallee()
If the callee is a FunctionDecl, return it. Otherwise return null.
Represents the canonical version of C arrays with a specified constant size.
A POD class for pairing a NamedDecl* with an access specifier.
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
DeclContextLookupResult lookup_result
lookup_result lookup(DeclarationName Name) const
lookup - Find the declarations (if any) with the given Name in this context.
decl_range decls() const
decls_begin/decls_end - Iterate over the declarations stored in this context.
Decl - This represents one declaration (or definition), e.g.
bool isInStdNamespace() const
ASTContext & getASTContext() const LLVM_READONLY
bool isInvalidDecl() const
SourceLocation getLocation() const
AccessSpecifier getAccess() const
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
The name of a declaration.
RAII object that enters a new expression evaluation context.
The return type of classify().
This represents one expression.
bool isTypeDependent() const
Determines whether the type of this expression depends on.
Expr * IgnoreParenImpCasts() LLVM_READONLY
Skip past any parentheses and implicit casts which might surround this expression until reaching a fi...
bool containsErrors() const
Whether this expression contains subexpressions which had errors.
bool isLValue() const
isLValue - True if this expression is an "l-value" according to the rules of the current language.
Classification Classify(ASTContext &Ctx) const
Classify - Classify this expression according to the C++11 expression taxonomy.
bool hasPlaceholderType() const
Returns whether this expression has a placeholder type.
static ExprValueKind getValueKindForType(QualType T)
getValueKindForType - Given a formal return or parameter type, give its value kind.
An expression trait intrinsic.
Represents a member of a struct/union/class.
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
bool isDeleted() const
Whether this function has been deleted.
bool isDefaulted() const
Whether this function is defaulted.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
bool isUserProvided() const
True if this method is user-declared and was not deleted or defaulted on its first declaration.
Represents a prototype with parameter type info, e.g.
unsigned getNumParams() const
bool isNothrow(bool ResultIfDependent=false) const
Determine whether this function type has a non-throwing exception specification.
Declaration of a template function.
StringRef getName() const
Return the actual identifier string.
Describes the kind of initialization being performed, along with location information for tokens rela...
static InitializationKind CreateDirect(SourceLocation InitLoc, SourceLocation LParenLoc, SourceLocation RParenLoc)
Create a direct initialization.
static InitializationKind CreateCopy(SourceLocation InitLoc, SourceLocation EqualLoc, bool AllowExplicitConvs=false)
Create a copy initialization.
Describes the sequence of initializations required to initialize a given object or reference with a s...
Describes an entity that is being initialized.
static InitializedEntity InitializeTemporary(QualType Type)
Create the initialization entity for a temporary.
Represents the results of name lookup.
UnresolvedSetImpl::iterator iterator
void suppressDiagnostics()
Suppress the diagnostics that would normally fire because of this lookup.
This represents a decl that may have a name.
NamedDecl * getUnderlyingDecl()
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl.
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
@ Type
A type, stored as a Type*.
Represents an ObjC class declaration.
bool isSuperClassOf(const ObjCInterfaceDecl *I) const
isSuperClassOf - Return true if this class is the specified class or is a super class of the specifie...
OpaqueValueExpr - An expression referring to an opaque object of a fixed type and value class.
OverloadCandidateSet - A set of overload candidates, used in C++ overload resolution (C++ 13....
@ CSK_Normal
Normal lookup.
SmallVectorImpl< OverloadCandidate >::iterator iterator
OverloadingResult BestViableFunction(Sema &S, SourceLocation Loc, OverloadCandidateSet::iterator &Best)
Find the best viable function on this overload set, if it exists.
A (possibly-)qualified type.
bool isTriviallyCopyableType(const ASTContext &Context) const
Return true if this is a trivially copyable type (C++0x [basic.types]p9)
QualType getNonLValueExprType(const ASTContext &Context) const
Determine the type of a (typically non-lvalue) expression with the specified result type.
QualType getNonReferenceType() const
If Type is a reference type (e.g., const int&), returns the type that the reference refers to ("const...
bool hasNonTrivialObjCLifetime() const
@ PCK_Trivial
The type does not fall into any of the following categories.
@ PCK_ARCStrong
The type is an Objective-C retainable pointer type that is qualified with the ARC __strong qualifier.
The collection of all-type qualifiers we support.
@ OCL_Strong
Assigning into this object requires the old value to be released and the new value to be retained.
@ OCL_ExplicitNone
This object can be modified without requiring retains or releases.
@ OCL_None
There is no lifetime qualification on this type.
@ OCL_Weak
Reading or writing from this object requires a barrier call.
@ OCL_Autoreleasing
Assigning into this object requires a lifetime extension.
bool canPassInRegisters() const
Determine whether this class can be passed in registers.
field_range fields() const
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
Emit a diagnostic.
CXXSpecialMemberKind asSpecialMember() const
RAII class used to determine whether SFINAE has trapped any errors that occur during template argumen...
bool hasErrorOccurred() const
Determine whether any SFINAE errors have been trapped.
Sema - This implements semantic analysis and AST building for C.
DefaultedFunctionKind getDefaultedFunctionKind(const FunctionDecl *FD)
Determine the kind of defaulting that would be done for a given function.
@ LookupOrdinaryName
Ordinary name lookup, which finds ordinary names (functions, variables, typedefs, etc....
ExprResult ActOnExpressionTrait(ExpressionTrait OET, SourceLocation KWLoc, Expr *Queried, SourceLocation RParen)
ActOnExpressionTrait - Parsed one of the unary type trait support pseudo-functions.
bool IsCXXTriviallyRelocatableType(QualType T)
Determines if a type is trivially relocatable according to the C++26 rules.
bool BuiltinIsBaseOf(SourceLocation RhsTLoc, QualType LhsT, QualType RhsT)
void DiagnoseTypeTraitDetails(const Expr *E)
If E represents a built-in type trait, or a known standard type trait, try to print more information ...
ASTContext & getASTContext() const
ASTContext::CXXRecordDeclRelocationInfo CheckCXX2CRelocatableAndReplaceable(const clang::CXXRecordDecl *D)
void LookupBinOp(Scope *S, SourceLocation OpLoc, BinaryOperatorKind Opc, UnresolvedSetImpl &Functions)
ExprResult CreateOverloadedBinOp(SourceLocation OpLoc, BinaryOperatorKind Opc, const UnresolvedSetImpl &Fns, Expr *LHS, Expr *RHS, bool RequiresADL=true, bool AllowRewrittenCandidates=true, FunctionDecl *DefaultedFn=nullptr)
Create a binary operation that may resolve to an overloaded operator.
bool CheckTypeTraitArity(unsigned Arity, SourceLocation Loc, size_t N)
ExprResult ActOnArrayTypeTrait(ArrayTypeTrait ATT, SourceLocation KWLoc, ParsedType LhsTy, Expr *DimExpr, SourceLocation RParen)
ActOnArrayTypeTrait - Parsed one of the binary type trait support pseudo-functions.
void AddMethodTemplateCandidate(FunctionTemplateDecl *MethodTmpl, DeclAccessPair FoundDecl, CXXRecordDecl *ActingContext, TemplateArgumentListInfo *ExplicitTemplateArgs, QualType ObjectType, Expr::Classification ObjectClassification, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool SuppressUserConversions=false, bool PartialOverloading=false, OverloadCandidateParamOrder PO={})
Add a C++ member function template as a candidate to the candidate set, using template argument deduc...
void AddTemplateOverloadCandidate(FunctionTemplateDecl *FunctionTemplate, DeclAccessPair FoundDecl, TemplateArgumentListInfo *ExplicitTemplateArgs, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool SuppressUserConversions=false, bool PartialOverloading=false, bool AllowExplicit=true, ADLCallKind IsADLCandidate=ADLCallKind::NotADL, OverloadCandidateParamOrder PO={}, bool AggregateCandidateDeduction=false)
Add a C++ function template specialization as a candidate in the candidate set, using template argume...
const LangOptions & getLangOpts() const
void AddOverloadCandidate(FunctionDecl *Function, DeclAccessPair FoundDecl, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool SuppressUserConversions=false, bool PartialOverloading=false, bool AllowExplicit=true, bool AllowExplicitConversion=false, ADLCallKind IsADLCandidate=ADLCallKind::NotADL, ConversionSequenceList EarlyConversions={}, OverloadCandidateParamOrder PO={}, bool AggregateCandidateDeduction=false, bool StrictPackMatch=false)
AddOverloadCandidate - Adds the given function to the set of candidate functions, using the given fun...
ExprResult BuildTypeTrait(TypeTrait Kind, SourceLocation KWLoc, ArrayRef< TypeSourceInfo * > Args, SourceLocation RParenLoc)
ExprResult BuildExpressionTrait(ExpressionTrait OET, SourceLocation KWLoc, Expr *Queried, SourceLocation RParen)
bool IsCXXReplaceableType(QualType T)
Determines if a type is replaceable according to the C++26 rules.
ExprResult CheckPlaceholderExpr(Expr *E)
Check for operands with placeholder types and complain if found.
void AddMethodCandidate(DeclAccessPair FoundDecl, QualType ObjectType, Expr::Classification ObjectClassification, ArrayRef< Expr * > Args, OverloadCandidateSet &CandidateSet, bool SuppressUserConversion=false, OverloadCandidateParamOrder PO={})
AddMethodCandidate - Adds a named decl (which is some kind of method) as a method candidate to the gi...
CanThrowResult canThrow(const Stmt *E)
@ Unevaluated
The current expression and its subexpressions occur within an unevaluated operand (C++11 [expr]p7),...
bool RequireCompleteType(SourceLocation Loc, QualType T, CompleteTypeKind Kind, TypeDiagnoser &Diagnoser)
Ensure that the type T is a complete type.
Scope * TUScope
Translation Unit Scope - useful to Objective-C actions that need to lookup file scope declarations in...
ExprResult BuildBinOp(Scope *S, SourceLocation OpLoc, BinaryOperatorKind Opc, Expr *LHSExpr, Expr *RHSExpr, bool ForFoldExpression=false)
ExprResult ActOnTypeTrait(TypeTrait Kind, SourceLocation KWLoc, ArrayRef< ParsedType > Args, SourceLocation RParenLoc)
Parsed one of the type trait support pseudo-functions.
ExprResult BuildArrayTypeTrait(ArrayTypeTrait ATT, SourceLocation KWLoc, TypeSourceInfo *TSInfo, Expr *DimExpr, SourceLocation RParen)
UnsignedOrNone GetDecompositionElementCount(QualType DecompType, SourceLocation Loc)
static QualType GetTypeFromParser(ParsedType Ty, TypeSourceInfo **TInfo=nullptr)
Encodes a location in the source.
A trivial tuple used to represent a source range.
SourceLocation getBegin() const
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
SourceLocation getBeginLoc() const LLVM_READONLY
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
bool isDependentType() const
Whether this declaration declares a type that is dependent, i.e., a type that somehow depends on temp...
@ Pack
The template argument is actually a parameter pack.
@ Type
The template argument is a type.
The base class of all kinds of template declarations (e.g., class, function, etc.).
SourceLocation getBeginLoc() const
Get the begin source location.
A container of type source information.
TypeLoc getTypeLoc() const
Return the TypeLoc wrapper for the type source info.
QualType getType() const
Return the type wrapped by this type source info.
static TypeTraitExpr * Create(const ASTContext &C, QualType T, SourceLocation Loc, TypeTrait Kind, ArrayRef< TypeSourceInfo * > Args, SourceLocation RParenLoc, bool Value)
Create a new type trait expression.
The base class of the type hierarchy.
bool isIncompleteArrayType() const
bool isRValueReferenceType() const
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
RecordDecl * getAsRecordDecl() const
Retrieves the RecordDecl this type refers to.
const T * castAs() const
Member-template castAs<specific type>.
bool isEnumeralType() const
bool isScalarType() const
bool isVariableArrayType() const
bool isLValueReferenceType() const
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
bool isAggregateType() const
Determines whether the type is a C++ aggregate type or C aggregate or union type.
const Type * getBaseElementTypeUnsafe() const
Get the base element type of this type, potentially discarding type qualifiers.
bool isObjectType() const
Determine whether this type is an object type.
bool isIncompleteType(NamedDecl **Def=nullptr) const
Types are partitioned into 3 broad categories (C99 6.2.5p1): object types, function types,...
bool isFunctionType() const
bool isStructureOrClassType() const
bool isVectorType() const
const T * getAsCanonical() const
If this type is canonically the specified type, return its canonical type cast to that specified type...
const T * getAs() const
Member-template getAs<specific type>'.
A set of unresolved declarations.
Provides information about an attempted template argument deduction, whose success or failure was des...
TokenKind
Provides a simple uniform namespace for tokens from all C languages.
The JSON file list parser is used to communicate input to InstallAPI.
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
OverloadedOperatorKind
Enumeration specifying the different kinds of C++ overloaded operators.
bool isa(CodeGen::Address addr)
ArrayTypeTrait
Names for the array type traits.
unsigned getTypeTraitArity(TypeTrait T) LLVM_READONLY
Return the arity of the type trait T.
@ OR_Deleted
Succeeded, but refers to a deleted function.
@ OR_Success
Overload resolution succeeded.
@ Self
'self' clause, allowed on Compute and Combined Constructs, plus 'update'.
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
@ Dependent
Parse the block as a dependent block, which may be used in some template instantiations but not other...
@ Result
The result type of a method or function.
const FunctionProtoType * T
CXXSpecialMemberKind
Kinds of C++ special members.
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
@ VK_XValue
An x-value expression is a reference to an object with independent storage but which can be "moved",...
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
const char * getTraitSpelling(ExpressionTrait T) LLVM_READONLY
Return the spelling of the type trait TT. Never null.
@ Success
Template argument deduction was successful.
U cast(CodeGen::Address addr)
ConstructorInfo getConstructorInfo(NamedDecl *ND)
OpaquePtr< QualType > ParsedType
An opaque type for threading parsed type information through the parser.
ActionResult< Expr * > ExprResult
TypeTrait
Names for traits that operate specifically on types.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...