On 8/15/23 09:41, Javier Martinez wrote:
On Mon, Aug 14, 2023 at 8:32 PM Jason Merrill <ja...@redhat.com
<mailto:ja...@redhat.com>> wrote:
> I think you also want to check for ATTR_FLAG_TYPE_IN_PLACE.
> [...]
> > + propagate_class_warmth_attribute (t);
> Maybe call this in check_bases_and_members instead?
Yes, that is sensible. Done.
You still need an update to doc/extend.texi for this additional use of
the attribute. Sorry I didn't think of that before.
+ warning (OPT_Wattributes, "ignoring attribute %qE because it "
+ "conflicts with attribute %qs", name, "cold");
...
+ warning (OPT_Wattributes, "ignoring attribute %qE because it "
+ "conflicts with attribute %qs", name, "hot");
Function arguments continuing on the next line should line up with the '('.
+ tree class_has_cold_attr = lookup_attribute ("cold",
+ TYPE_ATTRIBUTES (t));
+ tree class_has_hot_attr = lookup_attribute ("hot",
+ TYPE_ATTRIBUTES (t));
...so I'd suggest reformatting these lines as:
tree class_has_cold_attr
= lookup_attribute ("cold", TYPE_ATTRIBUTES (t));
tree class_has_hot_attr
= lookup_attribute ("hot", TYPE_ATTRIBUTES (t));
+ decl_attributes (&fn,
+ tree_cons (get_identifier ("cold"), NULL, NULL), 0);
...and maybe use a local variable for the result of tree_cons.
+ if (has_cold_attr || has_hot_attr)
+ {
+
+ /* Transparently ignore the new warmth attribute if it
Unnecessary blank line.
Jason