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]

[v3] Fix libstdc++/40916 and 40917


Hi,

tested x86_64-linux without PCHs, committed to mainline.

Paolo.

/////////////////////
2009-07-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/40917
	* testsuite/util/replacement_memory_operators.h: Add missing includes,
	tweak qualifications.

2009-07-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/40916
	* testsuite/23_containers/list/modifiers/swap/1.cc: Fix include order.
	* testsuite/23_containers/list/modifiers/swap/2.cc: Likewise.
	* testsuite/23_containers/list/modifiers/swap/2.cc: Likewise.
Index: testsuite/23_containers/list/modifiers/swap/1.cc
===================================================================
--- testsuite/23_containers/list/modifiers/swap/1.cc	(revision 150269)
+++ testsuite/23_containers/list/modifiers/swap/1.cc	(working copy)
@@ -15,8 +15,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+#include <list>
 #include "1.h"
-#include <list>
 
 namespace std
 {
Index: testsuite/23_containers/list/modifiers/swap/2.cc
===================================================================
--- testsuite/23_containers/list/modifiers/swap/2.cc	(revision 150269)
+++ testsuite/23_containers/list/modifiers/swap/2.cc	(working copy)
@@ -17,8 +17,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+#include <list>
 #include "2.h"
-#include <list>
 
 int main()
 { 
Index: testsuite/23_containers/list/modifiers/swap/3.cc
===================================================================
--- testsuite/23_containers/list/modifiers/swap/3.cc	(revision 150269)
+++ testsuite/23_containers/list/modifiers/swap/3.cc	(working copy)
@@ -17,8 +17,8 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
+#include <list>
 #include "3.h"
-#include <list>
 
 int main()
 { 
Index: testsuite/util/replacement_memory_operators.h
===================================================================
--- testsuite/util/replacement_memory_operators.h	(revision 150269)
+++ testsuite/util/replacement_memory_operators.h	(working copy)
@@ -17,6 +17,9 @@
 // <http://www.gnu.org/licenses/>.
 
 #include <exception>
+#include <stdexcept>
+#include <cstdlib>
+#include <cstdio>
 
 namespace __gnu_test
 {
@@ -24,7 +27,7 @@
 
   struct counter
   {
-    size_t 	_M_count;
+    std::size_t _M_count;
     bool	_M_throw;
 
     counter() : _M_count(0), _M_throw(true) { }
@@ -48,7 +51,7 @@
       return g;
     }
   
-    static size_t
+    static std::size_t
     count() { return get()._M_count; }
 
     static void
@@ -85,7 +88,7 @@
 
 void* operator new(std::size_t size) throw(std::bad_alloc)
 {
-  printf("operator new is called \n");
+  std::printf("operator new is called \n");
   void* p = std::malloc(size);
   if (p == NULL)
     throw std::bad_alloc();
@@ -95,7 +98,7 @@
  
 void operator delete(void* p) throw()
 {
-  printf("operator delete is called \n");
+  std::printf("operator delete is called \n");
   if (p != NULL)
     {
       std::free(p);
@@ -103,8 +106,8 @@
 
       std::size_t count = __gnu_test::counter::count(); 
       if (count == 0)
-	printf("All memory released \n");
+	std::printf("All memory released \n");
       else
-	printf("%lu allocations to be released \n", count);
+	std::printf("%lu allocations to be released \n", count);
     }
 }

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