This is GCC's bug.
Several tickets describe this behavior as undesired:
-Wsystem-headers
should not be required in this case, as diagnosed construct occurs inside of user's code, not in system header. The macro itself comes from system header, but it is not expanded there.