https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112796

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #1)
> This is not a bug in GCC, the C++ standard allows any header to include any
> other.


See [res.on.headers] in the C++ standard:
"A C++ header may include other C++ headers. A C++ header shall provide the
declarations and definitions that appear in its synopsis. A C++ header shown in
its synopsis as including other C++ headers shall provide the declarations and
definitions that appear in the synopses of those other headers."

N.B. this is different from C, which does not allow e.g. <stdio.h> to include
<stdlib.h>.

Reply via email to