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

--- Comment #15 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by David Malcolm <dmalc...@gcc.gnu.org>:

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

commit r16-3092-gd3fe5a560f0bcca8e11ec0f9bb916f59615f51d8
Author: David Malcolm <dmalc...@redhat.com>
Date:   Fri Aug 8 16:55:46 2025 -0400

    diagnostics: enable nested diagnostics by default [PR116253]

    In GCC 15 I added an experimental nesting view in text sinks
    for hierarchical diagnostics, such as C++ template problems.

    This patch enables it for text sinks by default.  The old
    behavior can be restored via -fno-diagnostics-show-nesting,
    which the patch also adds to -fdiagnostics-plain-output.

    The patch does not yet enable it for text sinks in sarif-replay.

    gcc/ChangeLog:
            PR diagnostics/116253
            * common.opt (fdiagnostics-show-nesting): New option.
            (fdiagnostics-show-nesting-locations): New option.
            (fdiagnostics-show-nesting-levels): New option.
            * common.opt.urls: Regenerate.
            * diagnostics/context.cc (context::set_show_nesting): New.
            (context::set_show_nesting_locations): New.
            (context::set_show_nesting_levels): New.
            * diagnostics/context.h (context::set_show_nesting): New decl.
            (context::set_show_nesting_locations): New decl.
            (context::set_show_nesting_levels): New decl.
            * diagnostics/html-sink.cc: Tweak comment.
            * diagnostics/output-spec.cc (text_scheme_handler::make_sink):
            Rename "experimental-nesting" to "show-nesting" and enable by
            default.  Rename "experimental-nesting-show-locations" to
            "show-nesting-locations".  Rename
            "experimental-nesting-show-levels" to "show-nesting-levels".
            * diagnostics/sink.h (sink::dyn_cast_text_sink): New.
            * diagnostics/text-sink.h (text_sink::dyn_cast_text_sink): New.
            * doc/invoke.texi: Add -fdiagnostics-show-nesting,
            -fdiagnostics-show-nesting-locations, and
            -fdiagnostics-show-nesting-levels.  Update for changes to
            output-spec.cc above.
            * lto-wrapper.cc (merge_and_complain): Ignore
            OPT_fdiagnostics_show_nesting,
            OPT_fdiagnostics_show_nesting_locations, and
            OPT_fdiagnostics_show_nesting_levels.
            (append_compiler_options): Likewise.
            (append_diag_options): Likewise.
            * opts-common.cc (decode_cmdline_options_to_array): Add
            "-fno-diagnostics-show-nesting" to -fdiagnostics-plain-output.
            * opts.cc (common_handle_option): Handle the new options.
            (gen_command_line_string): Ignore the new options.
            * toplev.cc (general_init): Call set_show_nesting,
            set_show_nesting_locations, and set_show_nesting_levels on
            global_dc.

    gcc/testsuite/ChangeLog:
            PR diagnostics/116253
            * g++.dg/concepts/nested-diagnostics-1-truncated.C: Update for
            renamed keys to -fdiagnostics-set-output=text
            * g++.dg/concepts/nested-diagnostics-1.C: Likewise.
            * g++.dg/concepts/nested-diagnostics-2.C: Likewise.
            * gcc.dg/plugin/diagnostic-test-nesting-no-show-nesting.c: New
            test.
            * gcc.dg/plugin/diagnostic-test-nesting-show-nesting.c: New test.
            *
gcc.dg/plugin/diagnostic-test-nesting-text-indented-show-levels.c:
            Update for renamed keys to -fdiagnostics-set-output=text.
            * gcc.dg/plugin/diagnostic-test-nesting-text-indented-unicode.c:
            Likewise.
            * gcc.dg/plugin/diagnostic-test-nesting-text-indented.c: Likewise.
            * gcc.dg/plugin/plugin.exp: Add the new tests.

    Signed-off-by: David Malcolm <dmalc...@redhat.com>

Reply via email to