@@ -2715,6 +2715,11 @@ bool QualType::isCXX98PODType(const ASTContext &Context) const {
27152715 return false ;
27162716
27172717 QualType CanonicalType = getTypePtr ()->CanonicalType ;
2718+
2719+ // Any type that is, or contains, address discriminated data is never POD.
2720+ if (const_cast <ASTContext&>(Context).containsAddressDiscriminatedPointerAuth (CanonicalType))
2721+ return false ;
2722+
27182723 switch (CanonicalType->getTypeClass ()) {
27192724 // Everything not explicitly mentioned is not POD.
27202725 default :
@@ -2773,6 +2778,11 @@ bool QualType::isTrivialType(const ASTContext &Context) const {
27732778 if (CanonicalType->isDependentType ())
27742779 return false ;
27752780
2781+ // Any type that is, or contains, address discriminated data is never a
2782+ // trivial type.
2783+ if (const_cast <ASTContext&>(Context).containsAddressDiscriminatedPointerAuth (CanonicalType))
2784+ return false ;
2785+
27762786 // C++0x [basic.types]p9:
27772787 // Scalar types, trivial class types, arrays of such types, and
27782788 // cv-qualified versions of these types are collectively called trivial
@@ -2870,6 +2880,12 @@ bool QualType::isBitwiseCloneableType(const ASTContext &Context) const {
28702880
28712881 if (CanonicalType->isIncompleteType ())
28722882 return false ;
2883+
2884+ // Any type that is, or contains, address discriminated data is never
2885+ // bitwise clonable.
2886+ if (const_cast <ASTContext&>(Context).containsAddressDiscriminatedPointerAuth (CanonicalType))
2887+ return false ;
2888+
28732889 const auto *RD = CanonicalType->getAsRecordDecl (); // struct/union/class
28742890 if (!RD)
28752891 return true ;
@@ -3115,6 +3131,10 @@ bool QualType::isCXX11PODType(const ASTContext &Context) const {
31153131 if (BaseTy->isIncompleteType ())
31163132 return false ;
31173133
3134+ // Any type that is, or contains, address discriminated data is non-POD.
3135+ if (const_cast <ASTContext&>(Context).containsAddressDiscriminatedPointerAuth (*this ))
3136+ return false ;
3137+
31183138 // As an extension, Clang treats vector types as Scalar types.
31193139 if (BaseTy->isScalarType () || BaseTy->isVectorType ())
31203140 return true ;
0 commit comments