[Bug c++/106937] [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 since r10-1214-g1bf32c1141e23074

2022-10-10 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106937

--- Comment #3 from CVS Commits  ---
The trunk branch has been updated by Marek Polacek :

https://gcc.gnu.org/g:67efffec943656a509e036cd3c785a5c3d6885e1

commit r13-3202-g67efffec943656a509e036cd3c785a5c3d6885e1
Author: Marek Polacek 
Date:   Thu Sep 29 17:49:32 2022 -0400

c-family: ICE with [[gnu::nocf_check]] [PR106937]

When getting the name of an attribute, we ought to use
get_attribute_name, which handles both [[]] and __attribute__(())
forms.  Failure to do so may result in an ICE, like here.

pp_c_attributes_display wasn't able to print the [[]] form of
attributes, so this patch teaches it to.

When printing a pointer to function with a standard attribute, the
attribute
should be printed after the parameter-list.  With this patch we print:

  aka 'void (*)(int) [[gnu::nocf_check]]'

or, in C++ with noexcept:

  aka 'void (*)(int) noexcept [[gnu::nocf_check]]'

pp_c_attributes has been unused since its introduction in r56273 so
this patch removes it.

PR c++/106937

gcc/c-family/ChangeLog:

* c-pretty-print.cc (pp_c_specifier_qualifier_list): Print only GNU
attributes here.
(c_pretty_printer::direct_abstract_declarator): Print the standard
[[]]
attributes here.
(pp_c_attributes): Remove.
(pp_c_attributes_display): Print the [[]] form if appropriate.  Use
get_attribute_name.  Don't print a trailing space when printing the
[[]] form.
* c-pretty-print.h (pp_c_attributes): Remove.

gcc/cp/ChangeLog:

* error.cc: Include "attribs.h".
(dump_type_prefix): Print only GNU attributes here.
(dump_type_suffix): Print standard attributes here.

gcc/testsuite/ChangeLog:

* c-c++-common/pointer-to-fn1.c: New test.

[Bug c++/106937] [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 since r10-1214-g1bf32c1141e23074

2022-09-15 Thread mpolacek at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106937

Marek Polacek  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 Status|NEW |ASSIGNED

--- Comment #2 from Marek Polacek  ---
Mine then.

[Bug c++/106937] [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 since r10-1214-g1bf32c1141e23074

2022-09-14 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106937

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |10.5

[Bug c++/106937] [10/11/12/13 Regression] ICE tree check: expected identifier_node, have tree_list in pp_tree_identifier, at tree-pretty-print.cc:4606 since r10-1214-g1bf32c1141e23074

2022-09-13 Thread marxin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106937

Martin Liška  changed:

   What|Removed |Added

   Last reconfirmed||2022-09-13
 Ever confirmed|0   |1
Summary|[10/11/12/13 Regression]|[10/11/12/13 Regression]
   |ICE tree check: expected|ICE tree check: expected
   |identifier_node, have   |identifier_node, have
   |tree_list in|tree_list in
   |pp_tree_identifier, at  |pp_tree_identifier, at
   |tree-pretty-print.cc:4606   |tree-pretty-print.cc:4606
   ||since
   ||r10-1214-g1bf32c1141e23074
 Status|UNCONFIRMED |NEW
 CC||marxin at gcc dot gnu.org,
   ||mpolacek at gcc dot gnu.org

--- Comment #1 from Martin Liška  ---
Likely started with r10-1214-g1bf32c1141e23074.