@@ -1129,6 +1129,12 @@ class QualType {
1129
1129
PCK_Struct
1130
1130
};
1131
1131
1132
+ // / Check if this is a non-trivial type that would cause a C struct
1133
+ // / transitively containing this type to be non-trivial. This function can be
1134
+ // / used to determine whether a field of this type can be declared inside a C
1135
+ // / union.
1136
+ bool isNonTrivialPrimitiveCType (const ASTContext &Ctx) const ;
1137
+
1132
1138
// / Check if this is a non-trivial type that would cause a C struct
1133
1139
// / transitively containing this type to be non-trivial to copy and return the
1134
1140
// / kind.
@@ -1158,22 +1164,6 @@ class QualType {
1158
1164
return isDestructedTypeImpl (*this );
1159
1165
}
1160
1166
1161
- // / Check if this is or contains a C union that is non-trivial to
1162
- // / default-initialize, which is a union that has a member that is non-trivial
1163
- // / to default-initialize. If this returns true,
1164
- // / isNonTrivialToPrimitiveDefaultInitialize returns PDIK_Struct.
1165
- bool hasNonTrivialToPrimitiveDefaultInitializeCUnion () const ;
1166
-
1167
- // / Check if this is or contains a C union that is non-trivial to destruct,
1168
- // / which is a union that has a member that is non-trivial to destruct. If
1169
- // / this returns true, isDestructedType returns DK_nontrivial_c_struct.
1170
- bool hasNonTrivialToPrimitiveDestructCUnion () const ;
1171
-
1172
- // / Check if this is or contains a C union that is non-trivial to copy, which
1173
- // / is a union that has a member that is non-trivial to copy. If this returns
1174
- // / true, isNonTrivialToPrimitiveCopy returns PCK_Struct.
1175
- bool hasNonTrivialToPrimitiveCopyCUnion () const ;
1176
-
1177
1167
// / Determine whether expressions of the given type are forbidden
1178
1168
// / from being lvalues in C.
1179
1169
// /
@@ -1246,11 +1236,6 @@ class QualType {
1246
1236
const ASTContext &C);
1247
1237
static QualType IgnoreParens (QualType T);
1248
1238
static DestructionKind isDestructedTypeImpl (QualType type);
1249
-
1250
- // / Check if \param RD is or contains a non-trivial C union.
1251
- static bool hasNonTrivialToPrimitiveDefaultInitializeCUnion (const RecordDecl *RD);
1252
- static bool hasNonTrivialToPrimitiveDestructCUnion (const RecordDecl *RD);
1253
- static bool hasNonTrivialToPrimitiveCopyCUnion (const RecordDecl *RD);
1254
1239
};
1255
1240
1256
1241
} // namespace clang
@@ -6264,24 +6249,6 @@ inline Qualifiers::GC QualType::getObjCGCAttr() const {
6264
6249
return getQualifiers ().getObjCGCAttr ();
6265
6250
}
6266
6251
6267
- inline bool QualType::hasNonTrivialToPrimitiveDefaultInitializeCUnion () const {
6268
- if (auto *RD = getTypePtr ()->getBaseElementTypeUnsafe ()->getAsRecordDecl ())
6269
- return hasNonTrivialToPrimitiveDefaultInitializeCUnion (RD);
6270
- return false ;
6271
- }
6272
-
6273
- inline bool QualType::hasNonTrivialToPrimitiveDestructCUnion () const {
6274
- if (auto *RD = getTypePtr ()->getBaseElementTypeUnsafe ()->getAsRecordDecl ())
6275
- return hasNonTrivialToPrimitiveDestructCUnion (RD);
6276
- return false ;
6277
- }
6278
-
6279
- inline bool QualType::hasNonTrivialToPrimitiveCopyCUnion () const {
6280
- if (auto *RD = getTypePtr ()->getBaseElementTypeUnsafe ()->getAsRecordDecl ())
6281
- return hasNonTrivialToPrimitiveCopyCUnion (RD);
6282
- return false ;
6283
- }
6284
-
6285
6252
inline FunctionType::ExtInfo getFunctionExtInfo (const Type &t) {
6286
6253
if (const auto *PT = t.getAs <PointerType>()) {
6287
6254
if (const auto *FT = PT->getPointeeType ()->getAs <FunctionType>())
0 commit comments