return t;
}
+/* Return true if init_complex_type can be called with TARGET_TYPE. */
+
+bool
+can_create_complex_type (struct type *target_type)
+{
+ return (target_type->code () == TYPE_CODE_INT
+ || target_type->code () == TYPE_CODE_FLT);
+}
+
/* Allocate a TYPE_CODE_COMPLEX type structure. NAME is the type
name. TARGET_TYPE is the component type. */
{
struct type *t;
- gdb_assert (target_type->code () == TYPE_CODE_INT
- || target_type->code () == TYPE_CODE_FLT);
+ gdb_assert (can_create_complex_type (target_type));
if (TYPE_MAIN_TYPE (target_type)->flds_bnds.complex_type == nullptr)
{