https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123995
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Iain Buclaw <[email protected]>: https://gcc.gnu.org/g:815732c2751060c38f0dc872a025632f247dda5c commit r16-7397-g815732c2751060c38f0dc872a025632f247dda5c Author: Iain Buclaw <[email protected]> Date: Sun Feb 8 18:31:50 2026 +0100 d: Fix error when passing assert(0) as argument [PR123995] Library routines that either throw or halt execution already have the call flag ECF_NORETURN. Make their internal type `noreturn' as well, so that they can be "passed" to functions accepting noreturn arguments. PR d/123995 gcc/d/ChangeLog: * d-codegen.cc (build_assert_call): Cast libcall result to `noreturn'. (build_array_bounds_call): Likewise. (build_bounds_index_condition): Likewise. (build_bounds_slice_condition): Likewise. * expr.cc (ExprVisitor::visit (ThrowExp *)): Likewise. * toir.cc (IRVisitor::visit (ThrowStatement *)): Likewise. * runtime.cc (enum d_libcall_type): Add LCT_NORETURN. (get_libcall_type): Handle LCT_NORETURN. * runtime.def (ASSERTP): Change return type to `noreturn'. (ASSERT_MSG): Likewise. (UNITTESTP): Likewise. (UNITTEST_MSG): Likewise. (ARRAYBOUNDSP): Likewise. (ARRAYBOUNDS_SLICEP): Likewise. (ARRAYBOUNDS_INDEXP): Likewise. (THROW): Likewise. gcc/testsuite/ChangeLog: * gdc.dg/pr123995.d: New test.
