@@ -2864,6 +2864,11 @@ bool QualType::isCXX98PODType(const ASTContext &Context) const {
28642864 return false ;
28652865
28662866 QualType CanonicalType = getTypePtr ()->CanonicalType ;
2867+
2868+ // Any type that is, or contains, address discriminated data is never POD.
2869+ if (const_cast <ASTContext&>(Context).containsAddressDiscriminatedPointerAuth (CanonicalType))
2870+ return false ;
2871+
28672872 switch (CanonicalType->getTypeClass ()) {
28682873 // Everything not explicitly mentioned is not POD.
28692874 default :
@@ -2922,6 +2927,11 @@ bool QualType::isTrivialType(const ASTContext &Context) const {
29222927 if (CanonicalType->isDependentType ())
29232928 return false ;
29242929
2930+ // Any type that is, or contains, address discriminated data is never a
2931+ // trivial type.
2932+ if (const_cast <ASTContext&>(Context).containsAddressDiscriminatedPointerAuth (CanonicalType))
2933+ return false ;
2934+
29252935 // C++0x [basic.types]p9:
29262936 // Scalar types, trivial class types, arrays of such types, and
29272937 // cv-qualified versions of these types are collectively called trivial
@@ -3019,6 +3029,12 @@ bool QualType::isBitwiseCloneableType(const ASTContext &Context) const {
30193029
30203030 if (CanonicalType->isIncompleteType ())
30213031 return false ;
3032+
3033+ // Any type that is, or contains, address discriminated data is never
3034+ // bitwise clonable.
3035+ if (const_cast <ASTContext&>(Context).containsAddressDiscriminatedPointerAuth (CanonicalType))
3036+ return false ;
3037+
30223038 const auto *RD = CanonicalType->getAsRecordDecl (); // struct/union/class
30233039 if (!RD)
30243040 return true ;
@@ -3264,6 +3280,10 @@ bool QualType::isCXX11PODType(const ASTContext &Context) const {
32643280 if (BaseTy->isIncompleteType ())
32653281 return false ;
32663282
3283+ // Any type that is, or contains, address discriminated data is non-POD.
3284+ if (const_cast <ASTContext&>(Context).containsAddressDiscriminatedPointerAuth (*this ))
3285+ return false ;
3286+
32673287 // As an extension, Clang treats vector types as Scalar types.
32683288 if (BaseTy->isScalarType () || BaseTy->isVectorType ())
32693289 return true ;
0 commit comments