This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR c++/43704


On Mon, Apr 19, 2010 at 7:45 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Thu, Apr 15, 2010 at 2:12 PM, Dodji Seketeli <dodji@redhat.com> wrote:
>> Hello,
>>
>> In the example of the patch below, when we want to we check that
>> iterator_restrict_traits<typename ty1::ic> in #2 is different from the
>> one in #1, at some point we check the two "typename ty1::ic".
>>
>> structural_comptypes wrongly concludes they are equal because we check
>> the TYPE_MAIN_VARIANT of the two ty1 before checking that they are
>> incompatible typedefs.
>>
>> The patch below checks their incompatibility before checking their
>> TYPE_MAIN_VARIANT.
>>
>> Tested on x86_64-unknown-linux-gnu against trunk and 4.5.
>>
>> OK to commit to trunk and 4.5?
>>
>> commit 4c9e552bbbe009177e30fb0aa2f8f7be7e592214
>> Author: Dodji Seketeli <dodji@redhat.com>
>> Date: ? Thu Apr 15 21:33:24 2010 +0200
>>
>> ? ?Fix PR c++/43704
>>
>> ? ?gcc/cp/ChangeLog:
>> ? ? ? ?PR c++/43704
>> ? ? ? ?* typeck.c (structural_comptypes): Test dependent typedefs
>> ? ? ? ?incompatibility before testing for their main variant based
>> ? ? ? ?equivalence.
>>
>> ? ?gcc/testsuite/ChangeLog:
>> ? ? ? ?PR c++/43704
>> ? ? ? ?* g++.dg/template/typedef32.C: New test.
>>
>
> On Linux/ia32, I got
>
> Executing on host:
> /export/gnu/import/svn/gcc-test/bld/gcc/testsuite/g++2/../../g++
> -B/export/gnu/import/svn/gcc-test/bld/gcc/testsuite/g++2/../../
> /export/gnu/import/svn/gcc-test/src-trunk/gcc/testsuite/g++.dg/template/typedef32.C
> ?-nostdinc++ -I/export/gnu/import/svn/gcc-test/bld/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu
> -I/export/gnu/import/svn/gcc-test/bld/i686-pc-linux-gnu/libstdc++-v3/include
> -I/export/gnu/import/svn/gcc-test/src-trunk/libstdc++-v3/libsupc++
> -I/export/gnu/import/svn/gcc-test/src-trunk/libstdc++-v3/include/backward
> -I/export/gnu/import/svn/gcc-test/src-trunk/libstdc++-v3/testsuite/util
> -fmessage-length=0 ? -ansi -pedantic-errors -Wno-long-long ?-S ?-o
> typedef32.s ? ?(timeout = 300)
> /export/gnu/import/svn/gcc-test/src-trunk/gcc/testsuite/g++.dg/template/typedef32.C:
> In instantiation of 'banded_adaptor<matrix<double> >::iterator1':^M
> /export/gnu/import/svn/gcc-test/src-trunk/gcc/testsuite/g++.dg/template/typedef32.C:43:46:
> ?instantiated from here^M
> /export/gnu/import/svn/gcc-test/src-trunk/gcc/testsuite/g++.dg/template/typedef32.C:35:9:
> error: no type named 'ic' in 'class banded_adaptor<matrix<double>
>>::ty1'^M
> compiler exited with status 1

It may also cause:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43800

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]