C++ PATCH for c++/44193 (incorrect handling of functions, cv-quals and typename)

Jason Merrill jason@redhat.com
Wed May 19 21:12:00 GMT 2010


On 05/19/2010 11:43 AM, Jason Merrill wrote:
> In the code for handling TEMPLATE_TYPE_PARM we properly drop cv-quals
> when substituting in a function type, but we fail to do the same for
> TYPENAME_TYPE. Fixed on the release branches by copying over the code
> from the type parm case. For 4.6 I have a more involved patch in the works.

As promised: For 4.6 I'm changing cp_build_qualified_type and 
cp_type_quals to ignore the quals on FUNCTION_TYPE in favor of using new 
functions type_memfn_quals and apply_memfn_quals, since 
function-cv-qualifiers are completely distinct from normal type 
qualifiers.  This should help to avoid any other similar situations in 
the future.

While I was looking at these bits, I also tweaked some related things:

merge-fn-quals.patch -- we were droping function-cv-qualifiers in 
merge_types.

dr295.patch -- our handling of applying cv quals to functions was 
scattered around the compiler and not consistent.  I think we should 
just apply the DR 295 resolution in all cases; limiting it to C++0x mode 
doesn't make any sense, since it was part of CD1.

cp_type_quals.patch -- Change almost all users of build_qualified_type 
and TYPE_QUALS to use cp_build_qualified_type and cp_type_quals 
consistently.

Tested x86_64-pc-linux-gnu, applied to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 44193-trunk.patch
Type: text/x-patch
Size: 13028 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100519/e7baaf94/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: merge-fn-quals.patch
Type: text/x-patch
Size: 2378 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100519/e7baaf94/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dr295.patch
Type: text/x-patch
Size: 5886 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100519/e7baaf94/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cp_type_quals.patch
Type: text/x-patch
Size: 18254 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100519/e7baaf94/attachment-0003.bin>


More information about the Gcc-patches mailing list