https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124828
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Last reconfirmed| |2026-04-09
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
CC| |jakub at gcc dot gnu.org
Status|UNCONFIRMED |ASSIGNED
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This is due to _GLIBCXX20_CONSTEXPR on _M_dispose, which makes it explicitly
constexpr (and therefore explicitly inline for -Winline purposes), and
libstdc++-v3/scripts/testsuite_flags using -I .../libstdc++-v3/... instead of
-isystem .../libstdc++-v3/...
i.e. the libstdc++ headers being actually not system headers during testing,
plus
inliner decision not to inline that function.
And most importantly the r15-3859 change which made #pragma GCC system_header
in libstdc++ headers conditional.
Given that the 20091022-2_0.C test was added for PR41791 - i.e. failure to
stream the system header flags for LTO, I think the right fix is since r15-3859
to
2026-04-09 Jakub Jelinek <[email protected]>
PR lto/124828
* g++.dg/lto/20091022-2_0.C (_GLIBCXX_SYSHDR): Define before including
<string>.
--- gcc/testsuite/g++.dg/lto/20091022-2_0.C.jj 2026-03-27 10:17:15.910301758
+0100
+++ gcc/testsuite/g++.dg/lto/20091022-2_0.C 2026-04-09 09:09:30.703737425
+0200
@@ -2,6 +2,7 @@
// { dg-lto-options {{-O3 -flto -Winline}} }
// { dg-skip-if "requires hosted libstdc++ for string" { ! hostedlib } }
+#define _GLIBCXX_SYSHDR
#include <string>
int
otherwise the test since r15-3859 doesn't test what it is supposed to test.