https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92194
--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> --- With -Wsystem-headers you also get the warning in C++17 (and it is actually a bit more informative, at least it says where it is used).