So, g++ 10.5.0 gave me "201709" for `__cplusplus`, but the bitcoin core 28.0 build fails when it's "< 202002L", meaning you need a newer compiler now. If you're also still on Ubuntu 20.04, there's no available system package for something newer in the normal repos, but you can add e.g. the "ppa:ubuntu-toolchain-r/test" repo, which includes g++-13.
If you're also running LND, then you'll find that the current LND release is not yet compatible with bitcoin core 28.0 out of the box. You can fix the problem by setting "deprecatedrpc=warnings" for your bitcoind, until LND v0.18.4 is released.