This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH for c++/36628


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>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]