[clang] [Headers] Don't declare unreachable() from stddef.h in C++ (PR #86748)

Ian Anderson via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 26 20:49:16 PDT 2024


ian-twilightcoder wrote:

> I'm checking with the C and C++ Compatibility study group (SG22) for what's expected here.

Prior to adding `__need_unreachable` in LLVM 18, clang would never declare `unreachable()` in C++ mode, but would defer to the C++ library to do that. I think we should keep with that behavior and let libc++'s <utility> and possibly <stddef.h> headers handle declaring `unreachable()`.

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


More information about the cfe-commits mailing list