Bug#666539: Patch to type_traits works

Mario Lang mlang at debian.org
Thu Sep 27 23:42:07 UTC 2012


Hi.

The patch (http://clang.llvm.org/libstdc++4.7-clang11.patch) mentioned
in thsi bug report to type_traits in libstdc++ is very small, and
actually appears to fix the problem.  It is not only <chrono> that can
be included with this minimal change applied, now <thread> (which is a
quite nice part of C++11) can be used with clang as well since <thread> depends
on <chrono>.

Index: include/std/type_traits
===================================================================
--- include/std/type_traits	(revision 185724)
+++ include/std/type_traits	(working copy)
@@ -1746,7 +1746,7 @@
 
   template<typename _Tp, typename _Up>
     struct common_type<_Tp, _Up>
-    { typedef decltype(true ? declval<_Tp>() : declval<_Up>()) type; };
+    { typedef typename decay<decltype(true ? declval<_Tp>() : declval<_Up>())>::type type; };
 
   template<typename _Tp, typename _Up, typename... _Vp>
     struct common_type<_Tp, _Up, _Vp...>


-- 
CYa,
  ⡍⠁⠗⠊⠕ | Debian Developer <URL:http://debian.org/>
  .''`. | Get my public key via finger mlang/key at db.debian.org
 : :' : | 1024D/7FC1A0854909BCCDBE6C102DDFFC022A6B113E44
 `. `'
   `-      <URL:http://delysid.org/>  <URL:http://www.staff.tugraz.at/mlang/>



More information about the Pkg-llvm-team mailing list