https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119111
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Why do you think this is a bug? https://eel.is/c++draft/dcl.decl#dcl.fct-1.sentence-5 says that the attribute-specifier-seq in your old{4,5,6,7} declarations appertains to the function type. And https://eel.is/c++draft/dcl.attr.deprecated#2 lists to what entities it may be applied, and function type is not one of those. GCC 15 will error on those 4 lines with -pedantic-errors, I think clang++ rejects it by default.