Suppress -Wshadow / -Wold-style-cast expanded from system header macros

Thanks to Jonathan Sauer for providing initial test cases.

Fixes PR16093 and PR18147.