@@ -2821,6 +2821,11 @@ bool QualType::isCXX98PODType(const ASTContext &Context) const {
28212821 return false ;
28222822
28232823 QualType CanonicalType = getTypePtr ()->CanonicalType ;
2824+
2825+ // Any type that is, or contains, address discriminated data is never POD.
2826+ if (const_cast <ASTContext&>(Context).containsAddressDiscriminatedPointerAuth (CanonicalType))
2827+ return false ;
2828+
28242829 switch (CanonicalType->getTypeClass ()) {
28252830 // Everything not explicitly mentioned is not POD.
28262831 default : return false ;
@@ -2878,6 +2883,11 @@ bool QualType::isTrivialType(const ASTContext &Context) const {
28782883 if (CanonicalType->isDependentType ())
28792884 return false ;
28802885
2886+ // Any type that is, or contains, address discriminated data is never a
2887+ // trivial type.
2888+ if (const_cast <ASTContext&>(Context).containsAddressDiscriminatedPointerAuth (CanonicalType))
2889+ return false ;
2890+
28812891 // C++0x [basic.types]p9:
28822892 // Scalar types, trivial class types, arrays of such types, and
28832893 // cv-qualified versions of these types are collectively called trivial
@@ -2975,6 +2985,12 @@ bool QualType::isBitwiseCloneableType(const ASTContext &Context) const {
29752985
29762986 if (CanonicalType->isIncompleteType ())
29772987 return false ;
2988+
2989+ // Any type that is, or contains, address discriminated data is never
2990+ // bitwise clonable.
2991+ if (const_cast <ASTContext&>(Context).containsAddressDiscriminatedPointerAuth (CanonicalType))
2992+ return false ;
2993+
29782994 const auto *RD = CanonicalType->getAsRecordDecl (); // struct/union/class
29792995 if (!RD)
29802996 return true ;
@@ -3218,6 +3234,10 @@ bool QualType::isCXX11PODType(const ASTContext &Context) const {
32183234 if (BaseTy->isIncompleteType ())
32193235 return false ;
32203236
3237+ // Any type that is, or contains, address discriminated data is non-POD.
3238+ if (const_cast <ASTContext&>(Context).containsAddressDiscriminatedPointerAuth (*this ))
3239+ return false ;
3240+
32213241 // As an extension, Clang treats vector types as Scalar types.
32223242 if (BaseTy->isScalarType () || BaseTy->isVectorType ()) return true ;
32233243 if (const auto *RT = BaseTy->getAs <RecordType>()) {
0 commit comments