[Bug c++/97419] New: crash in decl_as_string(TFF_DECL_SPECIFIERS | TFF_CHASE_TYPEDEF) from plugin using std::declval()

2020-10-14 Thread sphink at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97419 Bug ID: 97419 Summary: crash in decl_as_string(TFF_DECL_SPECIFIERS | TFF_CHASE_TYPEDEF) from plugin using std::declval() Product: gcc Version: unknown Status: UNCONFIRMED

[Bug c++/97419] crash in decl_as_string(TFF_DECL_SPECIFIERS | TFF_CHASE_TYPEDEF) from plugin using std::declval()

2020-10-14 Thread sphink at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97419 --- Comment #1 from Steve Fink --- Created attachment 49369 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49369&action=edit minimized C++ source C++ source that only includes .

[Bug c++/97419] crash in decl_as_string(TFF_DECL_SPECIFIERS | TFF_CHASE_TYPEDEF) from plugin using std::declval()

2020-10-14 Thread sphink at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97419 --- Comment #2 from Steve Fink --- Created attachment 49370 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49370&action=edit Preprocessed source

[Bug c++/97419] crash in decl_as_string(TFF_DECL_SPECIFIERS | TFF_CHASE_TYPEDEF) from plugin using std::declval()

2020-10-14 Thread sphink at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97419 --- Comment #3 from Steve Fink --- This invokes decl_as_string(decl, TFF_DECL_SPECIFIERS | TFF_CHASE_TYPEDEF) TREE_CODE(decl) is FUNCTION_DECL. dump_function_decl(decl) is attempting to render the return type of the function. It's in a local va

[Bug c++/97419] crash in decl_as_string(TFF_DECL_SPECIFIERS | TFF_CHASE_TYPEDEF) from plugin using std::declval()

2020-10-14 Thread sphink at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97419 --- Comment #4 from Steve Fink --- Created attachment 49371 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49371&action=edit crash stack

[Bug c++/97419] crash in decl_as_string(TFF_DECL_SPECIFIERS | TFF_CHASE_TYPEDEF) from plugin using std::declval()

2020-10-14 Thread sphink at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97419 --- Comment #5 from Steve Fink --- Created attachment 49372 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49372&action=edit backtrace of crash Note that the invalid_nonstatic_memfn_p in the attached crash stack seems bogus. Here's a backt

[Bug c++/97419] crash in decl_as_string(TFF_DECL_SPECIFIERS | TFF_CHASE_TYPEDEF) from plugin using std::declval()

2020-10-15 Thread sphink at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97419 --- Comment #6 from Steve Fink --- The crash still happens with gcc 10.2.0.

[Bug c++/97419] crash in decl_as_string(TFF_DECL_SPECIFIERS | TFF_CHASE_TYPEDEF) from plugin using std::declval()

2020-10-16 Thread sphink at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97419 --- Comment #7 from Steve Fink --- I can workaround the bug by avoiding declval: - using Iter = decltype(std::declval().begin()); - using Elem = decltype(*std::declval()); + using Iter = decltype(static_cast(nullptr)->begin()); + using E