https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69721
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- 17.6.2.2 [using.headers] "A translation unit shall include a header only outside of any declaration or definition," That includes namespace declarations ("header" in the standard means a standard header, this rule doesn't apply to non-standard include files).