https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38260
Paolo Carlini <paolo.carlini at oracle dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-06-11 CC|paolo.carlini at oracle dot com | Assignee|unassigned at gcc dot gnu.org |paolo.carlini at oracle dot com Ever confirmed|0 |1 --- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> --- With the below, the attributes are applied to the bare float return type *before* the specialization is checked, and the testcase finally is accepted. But I didn't regression test anything, and at the moment I have no idea if there are other unwanted effects of anticipating cplus_decl_attributes. Index: decl.c =================================================================== --- decl.c (revision 211478) +++ decl.c (working copy) @@ -7786,6 +7786,12 @@ grokfndecl (tree ctype, && !processing_template_decl) deduce_noexcept_on_destructor (decl); + if (attrlist) + { + cplus_decl_attributes (&decl, *attrlist, 0); + *attrlist = NULL_TREE; + } + decl = check_explicit_specialization (orig_declarator, decl, template_count, 2 * funcdef_flag + @@ -7796,12 +7802,6 @@ grokfndecl (tree ctype, if (DECL_STATIC_FUNCTION_P (decl)) check_static_quals (decl, quals); - if (attrlist) - { - cplus_decl_attributes (&decl, *attrlist, 0); - *attrlist = NULL_TREE; - } - /* Check main's type after attributes have been applied. */ if (ctype == NULL_TREE && DECL_MAIN_P (decl)) {