https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86885
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Known to fail| |4.1.2 --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Hmm, the code does: if (TREE_CODE (decl) == FUNCTION_DECL && TREE_CODE (type) == FUNCTION_TYPE && decl_function_context (decl) == 0) { Which means this was supposed to be rejected (decl_function_context is supposed to return if the context of a function is a function or not) but maybe we set the DECL_CONTEXT of the function too late now. The decl_function_context check has been there since constructor attribute support was added by Jason in 1995 (r0-8721-g2c5f4139a91db2) . I am 90% sure this worked at one point but I have no way to test anything earlier than 4.1.2 though.