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

            Bug ID: 98492
           Summary: C++ pp_gimple_stmt_1 doesn't output function call
                    arguments
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

When called for a call statement in a C program, the pp_gimple_stmt_1()
function outputs the full call statement, including its arguments (and the
variable to which the result is assigned).

But when called for a call statement in the same program compiled as C++, the
pp_gimple_stmt_1() function only outputs the name of the called function.

I tracked this down to the C++ front end reinitializing the pretty-printer (by
calling reinit_cxx_pp()) from lang_decl_name(), which ends up called from
lang_hooks.decl_printable_name().

The following is the sequence of calls:

print_call_name () in tree-pretty-print.c
 +- calls -> dump_function_name()
             +-> pp_string (pp, lang_hooks.decl_printable_name (node, 1))

C++ lang_hooks.decl_printable_name () points to
  cxx_printable_name() in cp/tree.c
  +- calls -> cxx_printable_name_internal()
              +-> lang_decl_name()
                  +-> reinit_cxx_pp()

(This is a problem when the pretty printer is used to format diagnostics.)

Reply via email to