This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/55742] [4.8 regression] __attribute__ in class function declaration cause "prototype does not match" errors.


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55742

--- Comment #31 from richard.guenther at gmail dot com <richard.guenther at gmail dot com> 2013-01-18 09:49:11 UTC ---
On Thu, Jan 17, 2013 at 11:45 PM, xinliangli at gmail dot com
<gcc-bugzilla@gcc.gnu.org> wrote:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55742
>
> --- Comment #30 from davidxl <xinliangli at gmail dot com> 2013-01-17 22:45:22 UTC ---
> (In reply to comment #26)
>> On Wed, Jan 16, 2013 at 5:02 PM, jakub at gcc dot gnu.org
>> <gcc-bugzilla@gcc.gnu.org> wrote:
>> >
>> > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55742
>> >
>> > --- Comment #25 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-01-16 16:02:35 UTC ---
>> > The actual merging of target attribute isn't that important, what would be more
>> > important is that other attributes are merged together in that case and the
>> > decls treated as the same thing.
>> >
>> > Anyway, with target("any") attribute, what would happen for
>> > void foo () __attribute__((target ("avx")));
>> > void foo () __attribute__((target ("any")));
>>
>> IMHO the re-declaration with a different target attribute should be an error.
>
> This can be a clean way to handle declarations. The definition should have
> either 'default' attribute or a matching target attribute.
>
>> A proper "forward" declaration for a function with MV applied shouldn't have
>> any target attribute.
>
> What does this sentence mean?

I think it would require to list all MV variants in the single declaration

void foo () __attribute__ ((target ("avx"), target ("any")));

but I suppose this goes against the idea of treating MV variants as regular
overloads which you can all declare.

Of course the issue whether / how to "merge" target attributes then returns.
I didn't pay too close attention, but if you settled on using a different
attribute name and then never perform merging of that attribute that would
indeed work.

Richard.

>
> David
>
> --
> Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]