@@ -2715,6 +2715,11 @@ bool QualType::isCXX98PODType(const ASTContext &Context) const {
2715
2715
return false ;
2716
2716
2717
2717
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
+
2718
2723
switch (CanonicalType->getTypeClass ()) {
2719
2724
// Everything not explicitly mentioned is not POD.
2720
2725
default :
@@ -2773,6 +2778,11 @@ bool QualType::isTrivialType(const ASTContext &Context) const {
2773
2778
if (CanonicalType->isDependentType ())
2774
2779
return false ;
2775
2780
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
+
2776
2786
// C++0x [basic.types]p9:
2777
2787
// Scalar types, trivial class types, arrays of such types, and
2778
2788
// cv-qualified versions of these types are collectively called trivial
@@ -2870,6 +2880,12 @@ bool QualType::isBitwiseCloneableType(const ASTContext &Context) const {
2870
2880
2871
2881
if (CanonicalType->isIncompleteType ())
2872
2882
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
+
2873
2889
const auto *RD = CanonicalType->getAsRecordDecl (); // struct/union/class
2874
2890
if (!RD)
2875
2891
return true ;
@@ -3115,6 +3131,10 @@ bool QualType::isCXX11PODType(const ASTContext &Context) const {
3115
3131
if (BaseTy->isIncompleteType ())
3116
3132
return false ;
3117
3133
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
+
3118
3138
// As an extension, Clang treats vector types as Scalar types.
3119
3139
if (BaseTy->isScalarType () || BaseTy->isVectorType ())
3120
3140
return true ;
0 commit comments