philnik777 wrote:

> > According to the spec it's ill-formed, so I'm not sure it falls under any 
> > sensible category.
> 
> It's an extension we support so it's up to us to decide what sensible is.

Sure. If we end up putting it in the array category we should probably 
coordinate with GCC.

> > For T[0] this returns false.
> 
> Understood, but why is this not the bug to be fixed? (It would also fix the 
> `takes_an_array` case as well.)

Because I don't think we can. AFAICT this is valid C++:
```c++
template <unsigned Size, class = int[Size]>
int func() {
  return 1;
}

template <unsigned Size>
int func() {
  return 0;
}
```
If clang accepted `int[0]` in this context the observable behaviour would 
change.

> > We don't use the trait currently in libc++ because of this bug and GCC only 
> > added it in trunk (and have the same bug), so probably not.
> 
> For example, it seems to be used in Unreal Engine: 
> https://github.com/windystrife/UnrealEngine_NVIDIAGameWorks/blob/b50e6338a7c5b26374d66306ebc7807541ff815e/Engine/Source/Runtime/Core/Public/Templates/UnrealTemplate.h#L128

If you think it's a significant enough change that we should add an ABI tag I 
can do that.


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

Reply via email to