C++ feature checks: Filter out warnings caused by local configuration
In some environments the linker produces warnings like
warning: directory not found for option
warning: object file compiled with -mlong-branch ...
These do not affect the availability of C++ features we're checking, so filter them out.
Fixes: #17850 (closed), #17947 (closed)