Generally, compile-time checks should be close to the code that use them. Especially, since compat/assumptions.h is only included in one place, where iwyu suggests to remove it.
Fix all issues:
- The NDEBUG check is used in util/check, so it is redundant in compat/assumptions.h.
- The __cplusplus check is redundant with doc/dependencies.md (see commit message).
> Remove duplicate NDEBUG check from compat/assumptions.h
>
> The check is already done in util/check.h, which is more widely
> included.
> Remove __cplusplus from compat/assumptions.h
>
> It is unclear what the goal of this check is, given that the value may
> need to be set lower for the mimimum supported version of compilers that
> forgot to bump the value, see
> https://github.com/bitcoin/bitcoin/pull/28349#issuecomment-1745143612 .
>
> The minimum supported compiler versions are already documented in
> doc/dependencies.md and using an older compiler will already result in a
> compile failure, so this check can be removed as redundant. Especially
> given that it is only included in one file, where iwyu suggests to
> remove it.
> Move compat/assumptions.h include to one place that actually needs it
> refactor: Remove redundant checks in compat/assumptions.h