This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81167] [8 Regression] ICE on valid C++ code in deferred_printed_type, at cp/error.c:118
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 18 Jan 2018 18:23:59 +0000
- Subject: [Bug c++/81167] [8 Regression] ICE on valid C++ code in deferred_printed_type, at cp/error.c:118
- Auto-submitted: auto-generated
- References: <bug-81167-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81167
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org,
| |jason at gcc dot gnu.org,
| |nathan at gcc dot gnu.org
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think it is fine that %H/%I crash on bogus arguments, but we should fix here
the real bug.
+ if (! DECL_CONSTRUCTOR_P (w->fn)
+ && TREE_TYPE (source))
looks just like a workaround. The main question is what is:
tree source = source_type (w->convs[0]);
if (! DECL_CONSTRUCTOR_P (w->fn))
source = TREE_TYPE (source);
code meant to do exactly, I bet it relies on the assumption that this argument
to w->fn must be a POINTER_TYPE_P, but in this case source is neither pointer
nor reference type, because source_type looked through the ck_ref_bind
conversion which had reference to bar type to the next conversion which is
ck_identity with bar type. So, source already is a RECORD_TYPE rather than a
pointer/reference.