This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: C++ PATCH for c++/36628
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Mon, 13 Jul 2009 01:27:29 +0200
- Subject: Re: C++ PATCH for c++/36628
- References: <4A5A510B.2070407@redhat.com>
Hi,
> Another use for the new lvalue_or_rvalue_with_address_p. When we're
> forcing something to be considered an rvalue, that includes forgetting
> about its rvalue referenceness.
Many thanks. I committed the below, mainline only for now.
Paolo.
//////////////////////
2009-07-12 Paolo Carlini <paolo.carlini@oracle.com>
* include/std/type_traits (common_type): Remove workaround for
PR36628, now fixed.
Index: include/std/type_traits
===================================================================
--- include/std/type_traits (revision 149536)
+++ include/std/type_traits (working copy)
@@ -580,13 +580,8 @@
static _Tp&& __t();
static _Up&& __u();
- // HACK: Prevents optimization of ?: in the decltype
- // expression when the condition is the literal, "true".
- // See, PR36628.
- static bool __true_or_false();
-
public:
- typedef decltype(__true_or_false() ? __t() : __u()) type;
+ typedef decltype(true ? __t() : __u()) type;
};
template<typename _Tp, typename _Up, typename... _Vp>