This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Require canonical type comparison for typedefs again.
- From: Paolo Carlini <pcarlini at gmail dot com>
- To: Dodji Seketeli <dodji at redhat dot com>
- Cc: Jason Merrill <jason at redhat dot com>, "H.J. Lu" <hjl dot tools at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 7 Oct 2010 00:16:02 +0200
- Subject: Re: Require canonical type comparison for typedefs again.
- References: <m38w4dovkv.fsf@redhat.com> <4C630F87.9060303@redhat.com> <m339ukotsm.fsf@redhat.com> <4C640257.4080804@redhat.com> <m38w2xcwbd.fsf_-_@redhat.com> <4C9673B7.5010505@oracle.com> <m3wrqgaftk.fsf@redhat.com> <AANLkTi=r9jP=WnFHMrDXxSFbTYBPf9CtWFVjD6Z6XObb@mail.gmail.com> <m3d3s89y5d.fsf@redhat.com> <4C97C9E5.2090907@redhat.com> <m3lj6p4zre.fsf@seketeli.org> <4C9E863C.30208@redhat.com> <m3hbha154q.fsf@seketeli.org> <4CA1F184.4080708@redhat.com> <m3sk0sz7yr.fsf@redhat.com> <4CA397D0.3000100@redhat.com> <m3zkurw3us.fsf@redhat.com>
Hi,
> diff --git a/gcc/testsuite/g++.dg/template/typedef36.C b/gcc/testsuite/g++.dg/template/typedef36.C
> new file mode 100644
> index 0000000..f6155c1
> --- /dev/null
> +++ b/gcc/testsuite/g++.dg/template/typedef36.C
> @@ -0,0 +1,23 @@
> +// Origin: PR c++/45606
> +// { dg-do compile }
> +
> +#include <list>
> +
> +template<class T>
> +class Test
> +{
> +protected:
> + typedef std::list<T> ListAlias;
> + ListAlias list;
> +public:
> + typedef typename ListAlias::const_iterator const_iterator;
> + inline const_iterator begin() const;
> +
> +};
> +
> +template<class T>
> +inline typename std::list<T>::const_iterator Test<T>::begin() const
> +{
> + return list.begin();
> +}
> +
Once again, if, thanks to the analysis you did to fix the problem, you are able to quickly figure out a shorter testcase, not including the entire <list>, I think it would be good.
Thanks,
Paolo