http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55742
--- Comment #27 from Sriraman Tallam <tmsriram at google dot com> 2013-01-16 17:20:28 UTC --- (In reply to comment #26) > On Wed, Jan 16, 2013 at 5:02 PM, jakub at gcc dot gnu.org > <gcc-bugzi...@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. > A proper "forward" declaration for a function with MV applied shouldn't have > any target attribute. Richard, I am not sure I fully understand what you mean. In this example, with your approach: test.cc ------ int foo (); // forward declaration int main () { foo (); } int foo () { ... } int foo () __attribute__ ("sse2") { .... } How can you tell if the call to foo is multi-versioned or not?