This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH for c++/92106 - ICE with structured bindings and -Wreturn-local-addr
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>
- Date: Tue, 15 Oct 2019 20:41:37 +0200
- Subject: Re: C++ PATCH for c++/92106 - ICE with structured bindings and -Wreturn-local-addr
- References: <20191015171717.GB2922@redhat.com> <20191015173431.GI2116@tucnak> <20191015182812.GC2922@redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Oct 15, 2019 at 02:28:12PM -0400, Marek Polacek wrote:
> --- /dev/null
> +++ gcc/testsuite/g++.dg/cpp1z/decomp50.C
> @@ -0,0 +1,51 @@
> +// PR c++/92106 - ICE with structured bindings and -Wreturn-local-addr.
> +// { dg-do compile { target c++17 } }
> +
> +template <typename> struct B;
> +template <typename _Tp> struct B<_Tp *> { typedef _Tp reference; };
I've looked at the unreduced testcase and it seems to have
template <typename _Tp> struct B<_Tp *> { typedef _Tp& reference; };
for this line instead. I'd think it would be better to change the testcase,
so that it is well defined rather than undefined then.
It is struct iterator_traits<_Tp*>, right?
Otherwise, the patch LGTM, but I'll defer to Jason as the maintainer.
Jakub