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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <[email protected]>:

https://gcc.gnu.org/g:d911f3f4372472ca0278ccad587f2792b1e3e470

commit r16-8559-gd911f3f4372472ca0278ccad587f2792b1e3e470
Author: Jakub Jelinek <[email protected]>
Date:   Fri Apr 10 09:47:36 2026 +0200

    testsuite: Fix up g++.dg/lto/20091022-2_0.C test [PR124828]

    From what I can see, this test was added for PR41791 where we didn't stream
    in/out the system header flags for LTO.  The test isn't perfect, because
    even when we actually do stream those flags, whether it fails or not
depends
    on the exact decisions of the inliner whether it decides to inline all
    inline/constexpr functions or not (maybe it would help to use some
    --params to request inlining as few functions as possible).

    Anyway, guess at some point we simply started to inline everything that was
    used and so whether the test stopped failing even if it would use
    -Wsystem-headers.  Now, when not using installed gcc testing, we use
    libstdc++-v3/scripts/testsuite_flags script which uses -I options rather
    than -isystem, but the headers still had #pragma GCC system_header pragmas.
    Except that r15-3859 guarded those pragmas with a macro which isn't defined
    by default and needs to be defined only when we want to make sure the
    headers are treated as system headers.
    And later on the recent changes for C++20 stable string exports started
    seeing a constexpr (thus implicitly inline for -Winline purposes) being too
    large for default inlining and so the test started to fail again.

    The following patch fixes it by making sure the libstdc++ headers are
    treated as system headers, so the test tests again what it was supposed to
    test.

    2026-04-10  Jakub Jelinek  <[email protected]>

            PR lto/124828
            * g++.dg/lto/20091022-2_0.C (_GLIBCXX_SYSHDR): Define before
including
            <string>.

    Reviewed-by: Richard Biener <[email protected]>

Reply via email to