https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122483

--- Comment #15 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #14)
> I think diagnosing
> 
> void sc_b ();
> void sc_b () [[arm::streaming_compatible]]; // { dg-error "conflicting
> types" }
> 
> which still works is good.  Diagnosing
> 
> void sc_a () [[arm::streaming_compatible]];
> void sc_a (); // { dg-error "conflicting types" }
> 
> which no longer works is not necessary - the latter declaration does not
> actually remove the attribute, so the type of sc_a isn't changed and all
> possible users of sc_a see the attributed declaration.
> 
> So IMO this works as expected and in the appropriate way.

Note this is intentional so that when, like, glibc declares a function
with a load of attributes (which are implementation specific), a program
can still re-declare the function with the C subset of attributes w/o
diagnostics and w/o risking to drop important attributes.

Reply via email to