sdesmalen-arm wrote:

> > The SME type attributes are not part of the name mangling
> 
> If `int(&)() __arm_streaming` is a different type from `int(&)()` for 
> template instantiation, it should have different mangling. If it doesn't, 
> that's a bug. If there is no spec for the correct mangling, someone should 
> write a spec.

I agree that it would be better for the SME attributes to be represented in the 
type mangling, although changing the mangling at this point would be an ABI 
break. I'll probe and follow this up!

Nevertheless I believe there is merit to this patch because Clang should not 
silently generate wrong code. For other instantiations Clang just emits a 
diagnostic, e.g.

```
void fn(int);
void fs(int) __arm_streaming;

template <typename F, typename... Args>
void dispatcher(F f, Args... args) {
  f(args...);
}

void foo() {
  dispatcher(fn, 41);
  dispatcher(fs, 42);
```

Results in a diagnostic `error: definition with same mangled name 
'_Z10dispatcherIPFviEJiEEvT_DpT0_' as another definition`. The fact that a 
similar diagnostic is not produced for lambda instantiations seems like 
something that needs fixing.

https://github.com/llvm/llvm-project/pull/107581
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to