This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH for c++/44193 (incorrect handling of functions, cv-quals and typename)
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 14 Jun 2010 14:34:48 -0700
- Subject: Re: C++ PATCH for c++/44193 (incorrect handling of functions, cv-quals and typename)
- References: <4BF40733.8060607@redhat.com> <4BF450C4.4020904@redhat.com>
On Wed, May 19, 2010 at 1:57 PM, Jason Merrill <jason@redhat.com> wrote:
> 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.
>
This patch caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44540
--
H.J.