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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |8.3.1
           Keywords|                            |rejects-valid
   Last reconfirmed|                            |2019-05-30
                 CC|                            |dmalcolm at gcc dot gnu.org
     Ever confirmed|0                           |1
            Summary|gcc-9.1.0 fails to build    |[9/10 Regression] gcc-9.1.0
                   |__gcc_diag__ souce: error:  |fails to build __gcc_diag__
                   |'cgraph_node' is not        |souce: error: 'cgraph_node'
                   |defined as a type           |is not defined as a type
   Target Milestone|---                         |9.2
      Known to fail|                            |10.0, 9.1.0

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Sorry, I misunderstood the report and the reduced example. I agree that your
reduced code should compile. The regression started with r265918. It seems that
after this change the identifier 'cgraph_node' can only be used for types, not
variables. Since it's not a reserved name and could occur in user code, that's
a bug.

    dump_printf: add "%C" for dumping cgraph_node *

    This patch implements support for %C in dump_printf for dumping
    cgraph_node *.
    (I would have preferred to have a code for printing symtab_node *
    and both subclasses, but there doesn't seem to be a good way for
    -Wformat to handle inheritance, so, failing that, I went with
    this approach).

    gcc/c-family/ChangeLog:
            * c-format.c (local_cgraph_node_ptr_node): New variable.
            (gcc_dump_printf_char_table): Add entry for %C.
            (get_pointer_to_named_type): New function, taken from the handling
            code for "gimple *" from...
            (init_dynamic_diag_info): ...here.  Add handling for
            "cgraph_node *".
            * c-format.h (T_CGRAPH_NODE): New.

    gcc/ChangeLog:
            * dump-context.h (ASSERT_IS_CGRAPH_NODE): New macro.
            * dumpfile.c (make_item_for_dump_cgraph_node): Move to before...
            (dump_pretty_printer::decode_format): Implement "%C" for
            cgraph_node *.
            (selftest::test_capture_of_dump_calls): Rename "where" to
            "stmt_loc".  Convert test_decl to a function decl and set its
            location.  Add a symbol_table_test RAII instance and a
            cgraph_node, using it to test "%C" and dump_symtab_node.

    gcc/testsuite/ChangeLog:
            * gcc.dg/format/gcc_diag-10.c (cgraph_node): New typedef.
            (test_dump): Add testing of %C.

Reply via email to