https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81568
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic, wrong-code Severity|normal |minor --- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> --- The cause of the problem is in the validation for these two attributes being done in two places: one in handle_always_inline_attribute and handle_noinline_attribute in c-attribs.c, and another in diagnose_mismatched_attributes. The former rejects the attribute if it's found to conflict with the other on the same declaration, but it doesn't detect conflicts across declarations. The latter does detect those conflicts but it doesn't reject them. As a result, the same problem gets handled differently in the two situations.