[Bug libstdc++/121827] ext/pointer.h can't be included alone and ext/cast.h shouldn't be included in extc++.h
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Mar 22 05:14:09 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121827
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:f38a98a1c07305a0ff95c076973611485767a02c
commit r13-10167-gf38a98a1c07305a0ff95c076973611485767a02c
Author: Jakub Jelinek <jakub@redhat.com>
Date: Mon Sep 8 11:49:58 2025 +0200
libstdc++: Fix up <ext/pointer.h> [PR121827]
During the tests mentioned in
https://gcc.gnu.org/pipermail/gcc-patches/2025-August/692482.html
(but dunno why I haven't noticed it back in August but only when testing
https://gcc.gnu.org/pipermail/gcc-patches/2025-September/694527.html )
I've noticed two ext header problems.
One is that #include <ext/pointer.h> got broken with the
r13-3037-g18f176d0b25591e28 change and since then is no longer
self-contained, as it includes iosfwd only if _GLIBCXX_HOSTED is defined
but doesn't actually include bits/c++config.h to make sure it is defined,
then includes a bunch of headers which do include bits/c++config.h and
finally uses in #if _GLIBCXX_HOSTED guarded code what is declared in
iosfwd.
The other problem is that ext/cast.h is also not a self-contained header,
but that one has
/** @file ext/cast.h
* This is an internal header file, included by other library headers.
* Do not attempt to use it directly. @headername{ext/pointer.h}
*/
comment, so I think we just shouldn't include it in extc++.h and let
ext/pointer.h include it.
2025-09-08 Jakub Jelinek <jakub@redhat.com>
PR libstdc++/121827
* include/precompiled/extc++.h: Don't include ext/cast.h which is
an
internal header.
* include/ext/pointer.h: Include bits/c++config.h before
#if _GLIBCXX_HOSTED.
(cherry picked from commit 592bafb26eb1fd50979f6cdf2176897c4a02c281)
More information about the Gcc-bugs
mailing list