This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/38260] vector_size attribute vs specialization
- From: "paolo.carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 11 Jun 2014 23:47:44 +0000
- Subject: [Bug c++/38260] vector_size attribute vs specialization
- Auto-submitted: auto-generated
- References: <bug-38260-4 at http dot gcc dot gnu dot org/bugzilla/>
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))
{