[PATCH] PR c++/13101
Dodji Seketeli
dseketel@redhat.com
Thu Jul 10 21:58:00 GMT 2008
Jason Merrill a écrit :
[...]
>
> Ah, I see the problem. type_quals just holds the qualifiers that are in
> the decl-specifier-seq, which is the wrong thing for this warning to be
> checking. Instead, it should wait until we've finished calculating the
> type for the declaration and test whether that type is const.
>
That's right.
I have updated the patch to delay the test (to generate the warning)
after the type has been properly computed. It seems to work.
Please note that in the process, the test
gcc/testsuite/g++.old-deja/g++.jason/crash11.C now spits a warning
precisely because a non const pointer that has external linkage gets
initialized. I just catch that with a dg-warning clause.
This has been regtested on x86.
Thanks,
Dodji.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: PR13101-patch-v2.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080710/dd4ab99e/attachment.txt>
More information about the Gcc-patches
mailing list