The 08/19/2025 14:06, Jason Merrill wrote:
> On 8/19/25 4:49 AM, Alfie Richards wrote:
> > Adds the target_version and target_clones attributes to diagnostic messages
> > for target_version semantics.
> > 
> > This is because the target_version/target_clones attributes affect the 
> > identity
> > of the decls, so need to be represented in diagnostics for them.
> > 
> > After this change diagnostics look like:
> > 
> > c:
> > ```
> > test.c:6:8: error: redefinition of ‘foo [[target_version("sve")]]’
> >      6 | float  foo  () {return 1;}
> >        |        ^~~
> > ```
> > 
> > c++:
> > ```
> > test.cpp:6:8: error: redefinition of ‘[[target_version("sve")]] float foo()’
> >      6 | float  foo  () {return 1;}
> >        |        ^~~
> > ```
> 
> This is valid attribute syntax, but I'm not sure why we wouldn't want to put
> the attribute immediately after the name for C++ as well?

Happy to change this to match C.

Would you prefer:

redefinition of ‘float foo [[target_version("sve")]] ()’

or

redefinition of ‘float foo() [[target_version("sve")]]’

Both look a little awkward to me, but I am happy to go with whatever you prefer.

Thanks,
Alfie

> 
> Jason
> 

-- 
Alfie Richards

Reply via email to