AaronBallman wrote:

> Why do the Clang builtin headers even try to define this? Shouldn't this be 
> provided by the platform's C library instead? I am really confused about 
> what's the intended layering here and it seems to me like Clang is 
> overstepping its responsibilities by basically implementing parts of the C 
> library.

I did that in a9797d7d2d7878464868312e0c147b4e747a31c6

It's a freestanding feature in C23, so we need to expose it from `stddef.h` at 
least when not in hosted builds. I don't understand why this is making into C++ 
builds at all: 

We set `__need_unreachable` based on `__STDC_VERSION__`:
https://github.com/llvm/llvm-project/blob/c388690a8b96cbdfa8c38a1e050088201da648e5/clang/lib/Headers/stddef.h#L59

We only include `__stddef_unreachable.h` if `__need_unreachable` is defined:
https://github.com/llvm/llvm-project/blob/c388690a8b96cbdfa8c38a1e050088201da648e5/clang/lib/Headers/stddef.h#L102


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

Reply via email to