Blame SOURCES/gcc44-rh808590.patch

f28b6a
2012-10-09  Benjamin Kosnik  <bkoz@redhat.com>
f28b6a
f28b6a
	* testsuite/20_util/specialized_algorithms/uninitialized_copy/808590.cc:
f28b6a
	Fix constant value.
f28b6a
f28b6a
2012-04-17  Benjamin Kosnik  <bkoz@redhat.com>
f28b6a
f28b6a
	* testsuite/20_util/specialized_algorithms/uninitialized_copy/
f28b6a
	808590.cc: New.
f28b6a
f28b6a
2009-09-02  Paolo Carlini  <paolo.carlini@oracle.com>
f28b6a
f28b6a
	* include/bits/stl_uninitialized.h
f28b6a
	(__uninitialized_copy::uninitialized_copy): Just call (the now 
f28b6a
	forwarding) _Construct.
f28b6a
f28b6a
2009-08-29  Benjamin Kosnik  <bkoz@redhat.com>
f28b6a
	    Chris Jefferson  <chris@bubblescope.net>
f28b6a
f28b6a
	* include/bits/stl_construct.h (_Construct(_T1*, _T2&&)): Add in
f28b6a
	C++0x mode.
f28b6a
f28b6a
--- libstdc++-v3/include/bits/stl_construct.h	(revision 186113)
f28b6a
+++ libstdc++-v3/include/bits/stl_construct.h	(working copy)
f28b6a
@@ -67,12 +67,19 @@
f28b6a
    */
f28b6a
   template<typename _T1, typename _T2>
f28b6a
     inline void
f28b6a
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
f28b6a
+    _Construct(_T1* __p, _T2&& __value)
f28b6a
+    {
f28b6a
+      ::new(static_cast<void*>(__p)) _T1(std::forward<_T2>(__value));
f28b6a
+    }
f28b6a
+#else
f28b6a
     _Construct(_T1* __p, const _T2& __value)
f28b6a
     {
f28b6a
       // _GLIBCXX_RESOLVE_LIB_DEFECTS
f28b6a
       // 402. wrong new expression in [some_]allocator::construct
f28b6a
       ::new(static_cast<void*>(__p)) _T1(__value);
f28b6a
     }
f28b6a
+#endif
f28b6a
 
f28b6a
   /**
f28b6a
    * Destroy the object pointed to by a pointer type.
f28b6a
--- libstdc++-v3/include/bits/stl_uninitialized.h	(revision 186113)
f28b6a
+++ libstdc++-v3/include/bits/stl_uninitialized.h	(working copy)
f28b6a
@@ -71,8 +71,7 @@
f28b6a
 	  __try
f28b6a
 	    {
f28b6a
 	      for (; __first != __last; ++__first, ++__cur)
f28b6a
-		::new(static_cast<void*>(&*__cur)) typename
f28b6a
-		    iterator_traits<_ForwardIterator>::value_type(*__first);
f28b6a
+		std::_Construct(&*__cur, *__first);
f28b6a
 	      return __cur;
f28b6a
 	    }
f28b6a
 	  __catch(...)
f28b6a
--- libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/808590.cc	(revision 0)
f28b6a
+++ libstdc++-v3/testsuite/20_util/specialized_algorithms/uninitialized_copy/808590.cc	(revision 186539)
f28b6a
@@ -0,0 +1,48 @@
f28b6a
+// Copyright (C) 2012 Free Software Foundation, Inc.
f28b6a
+//
f28b6a
+// This file is part of the GNU ISO C++ Library.  This library is free
f28b6a
+// software; you can redistribute it and/or modify it under the
f28b6a
+// terms of the GNU General Public License as published by the
f28b6a
+// Free Software Foundation; either version 3, or (at your option)
f28b6a
+// any later version.
f28b6a
+
f28b6a
+// This library is distributed in the hope that it will be useful,
f28b6a
+// but WITHOUT ANY WARRANTY; without Pred the implied warranty of
f28b6a
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f28b6a
+// GNU General Public License for more details.
f28b6a
+
f28b6a
+// You should have received a copy of the GNU General Public License along
f28b6a
+// with this library; see the file COPYING3.  If not see
f28b6a
+// <http://www.gnu.org/licenses/>.
f28b6a
+
f28b6a
+#include <vector>
f28b6a
+#include <stdexcept>
f28b6a
+
f28b6a
+// 4.4.x only
f28b6a
+struct c 
f28b6a
+{
f28b6a
+  void *m;
f28b6a
+
f28b6a
+  c(void* o = 0) : m(o) {}
f28b6a
+  c(const c &r) : m(r.m) {}
f28b6a
+
f28b6a
+  template<class T>
f28b6a
+    explicit c(T &o) : m((void*)0xdeadbeef) { }
f28b6a
+};
f28b6a
+
f28b6a
+int main() 
f28b6a
+{
f28b6a
+  std::vector<c> cbs;
f28b6a
+  const c cb((void*)0xcafebabe);
f28b6a
+
f28b6a
+  for (int fd = 62; fd < 67; ++fd) 
f28b6a
+    {
f28b6a
+      cbs.resize(fd + 1);
f28b6a
+      cbs[fd] = cb;
f28b6a
+    }
f28b6a
+
f28b6a
+  for (int fd = 62; fd< 67; ++fd)
f28b6a
+    if (cb.m != cbs[fd].m)
f28b6a
+      throw std::runtime_error("wrong");
f28b6a
+  return 0;
f28b6a
+}