/* The ABI says that record types with a single member are treated
just like that member would be. */
+ bool cxx17_empty_base_seen = false;
while (TREE_CODE (type) == RECORD_TYPE)
{
tree field, single = NULL_TREE;
for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
- if (TREE_CODE (field) != FIELD_DECL
- || cxx17_empty_base_field_p (field))
+ if (TREE_CODE (field) != FIELD_DECL)
continue;
+ if (cxx17_empty_base_field_p (field))
+ {
+ cxx17_empty_base_seen = true;
+ continue;
+ }
+
if (single == NULL_TREE)
single = TREE_TYPE (field);
else
}
}
- return VECTOR_TYPE_P (type);
+ if (!VECTOR_TYPE_P (type))
+ return false;
+
+ if (warn_psabi && cxx17_empty_base_seen)
+ {
+ static unsigned last_reported_type_uid;
+ unsigned uid = TYPE_UID (TYPE_MAIN_VARIANT (type));
+ if (uid != last_reported_type_uid)
+ {
+ last_reported_type_uid = uid;
+ inform (input_location, "parameter passing for argument of type "
+ "%qT when C++17 is enabled changed to match "
+ "C++14 in GCC 10.1", type);
+ }
+ }
+ return true;
}
/* Return true if a function argument of type TYPE and mode MODE
/* The ABI says that record types with a single member are treated
just like that member would be. */
+ bool cxx17_empty_base_seen = false;
while (TREE_CODE (type) == RECORD_TYPE)
{
tree field, single = NULL_TREE;
for (field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
{
- if (TREE_CODE (field) != FIELD_DECL
- || cxx17_empty_base_field_p (field))
+ if (TREE_CODE (field) != FIELD_DECL)
continue;
+ if (cxx17_empty_base_field_p (field))
+ {
+ cxx17_empty_base_seen = true;
+ continue;
+ }
if (single == NULL_TREE)
single = TREE_TYPE (field);
type = single;
}
- return TREE_CODE (type) == REAL_TYPE;
+ if (TREE_CODE (type) != REAL_TYPE)
+ return false;
+
+ if (warn_psabi && cxx17_empty_base_seen)
+ {
+ static unsigned last_reported_type_uid;
+ unsigned uid = TYPE_UID (TYPE_MAIN_VARIANT (type));
+ if (uid != last_reported_type_uid)
+ {
+ last_reported_type_uid = uid;
+ inform (input_location, "parameter passing for argument of type "
+ "%qT when C++17 is enabled changed to match "
+ "C++14 in GCC 10.1", type);
+ }
+ }
+
+ return true;
}
/* Return true if a function argument of type TYPE and mode MODE