https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50871
--- Comment #17 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #16) > (In reply to Jason Merrill from comment #15) > > (In reply to Jonathan Wakely from comment #14) > > > It's better than what we have today, but I'm not sure it's where we want > > > to > > > get to in the long term. > > > > > > I've been trying a patch that allows the system_header pragma to be > > > disabled when building and testing. > > > > How about using > > > > #pragma GCC diagnostic warning "-Wsystem-headers" > > > > instead? > > That doesn't work well, see PR 80472 Oh, did you mean putting that in the libstdc++-v3/src/*/*.cc sources, and tests, rather than in the headers? That could work as long as it doesn't also enable warnings for C library headers, which we generally can't fix or avoid.