This is the mail archive of the
mailing list for the GCC project.
Re: [c++-concepts] requires expression semantics
- From: Jason Merrill <jason at redhat dot com>
- To: Andrew Sutton <andrew dot n dot sutton at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Gabriel Dos Reis <gdr at axiomatics dot org>
- Date: Wed, 10 Jul 2013 19:07:03 -0700
- Subject: Re: [c++-concepts] requires expression semantics
- References: <CANq5SyvWKM8dm_Qaiu2_UHqXyWU=6tetPrEwhuZH3i+DYd42Xg at mail dot gmail dot com> <51CC7AC4 dot 9070400 at redhat dot com> <CANq5Syu9hxwKk8qma1Chc3NtqdtU9+EKjAzs3ZusTmYN5Q18Kg at mail dot gmail dot com> <51D44F61 dot 5040701 at redhat dot com> <CANq5Syt-Zkf-41OWUKTPdZQmpF0cBx2eF04imobhDtrtOR7v8A at mail dot gmail dot com> <51DAFD19 dot 3040502 at redhat dot com> <CANq5SyvwAiO65cLT+doN4oDztJtBxydi=Odq=ZvV-05eNgwd-g at mail dot gmail dot com>
On 07/10/2013 08:24 AM, Andrew Sutton wrote:
That's a good idea. I changed every existing use of can_convert to
can_convert_standard for the time being. That will preserve the
existing behavior, and we can determine which of the existing uses can
include user-defined conversions later.
Let's leave alone cases where we know the arguments are non-class types,
and only build the CAST_EXPR if one of the types is a class. And you
don't need is_reference_to_function_type anymore.
+// Returns a type that suitable to be used as an rvalue of type T.
+// Except for function types, this is the same as T. For function
+// types, this is an rvalue reference to T.
To be pedantic, describing it as an rvalue of type T isn't exactly
right; the reason we need to do this for functions is that an rvalue
reference to function produces an lvalue, whereas all other rvalue
references produce xvalues.
Go ahead and apply the patch with those tweaks.