[clang] [Clang] Fix __is_array returning true for zero-sized arrays (PR #86652)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 26 05:47:47 PDT 2024


AaronBallman 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.

> 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.)

> 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

https://github.com/llvm/llvm-project/pull/86652


More information about the cfe-commits mailing list