Commit 702d7b71 by Nathan Sidwell

c++: QT overload regression with attribute [PR94946]

Jason's fix for 90570 & 79585 was a bit overzealous.  Dependent attribs should still
attach to a parameter decl.

	* decl.c (grokdeclarator): Don't splice template attributes in
	parm context -- they can apply to the parm.
parent 5a57016d
2020-05-06 Nathan Sidwell <nathan@acm.org>
PR c++/94946
* decl.c (grokdeclarator): Don't splice template attributes in
parm context -- they can apply to the parm.
2020-04-30 Jason Merrill <jason@redhat.com> 2020-04-30 Jason Merrill <jason@redhat.com>
Nathan Sidwell <nathan@acm.org> Nathan Sidwell <nathan@acm.org>
......
...@@ -11937,9 +11937,12 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -11937,9 +11937,12 @@ grokdeclarator (const cp_declarator *declarator,
attr_flags |= (int) ATTR_FLAG_FUNCTION_NEXT; attr_flags |= (int) ATTR_FLAG_FUNCTION_NEXT;
if (declarator->kind == cdk_array) if (declarator->kind == cdk_array)
attr_flags |= (int) ATTR_FLAG_ARRAY_NEXT; attr_flags |= (int) ATTR_FLAG_ARRAY_NEXT;
/* Assume that any attributes that get applied late to templates will tree late_attrs = NULL_TREE;
DTRT when applied to the declaration as a whole. */ if (decl_context != PARM)
tree late_attrs = splice_template_attributes (&attrs, type); /* Assume that any attributes that get applied late to
templates will DTRT when applied to the declaration
as a whole. */
late_attrs = splice_template_attributes (&attrs, type);
returned_attrs = decl_attributes (&type, returned_attrs = decl_attributes (&type,
chainon (returned_attrs, attrs), chainon (returned_attrs, attrs),
attr_flags); attr_flags);
......
// { dg-do compile { target { i?86-*-* x86_64-*-* } } }
// { dg-options -m32 }
// PR 94946
class a {
template <typename b> a(b (*)());
template <typename b> a(b(__attribute__((fastcall)) *c)());
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment