Often we run into situations where we want to ignore
warnings from system headers, but Clang will still
give warnings about the contents of a macro defined
in a system header used in user-code.
Introduce a ShowInSystemMacro option to be able to
specify which warnings we do want to keep raising
warnings for. The current behavior is kept in this patch
(i.e. warnings from system macros are enabled by default).
The decision as to whether this should be an opt-in or opt-out
feature can be made in a separate patch.
To put the feature to test, replace duplicated code for
Wshadow and Wold-style-cast with the SuppressInSystemMacro tag.
Also disable the warning for C++20 designators, fixing #52944.
I think we should be checking Diags.getSuppressSystemWarnings() before considering whether we're in a system header. (Eg, if we're building libc++ and it enables warnings even in system headers, we want to warn if it uses non-C++ designator syntax.)
Given that this is something that we will presumably want to do for a bunch of diagnostics, not just this one, I think we should extend the current ShowInSystemHeader / SuppressInSystemHeader markings in our diagnostics .td files to also have a SuppressInSystemMacro level, and handle this centrally with the other "suppress warnings in system headers" logic, rather than special-casing this here.