2005-01-05 Benjamin Kosnik <bkoz@redhat.com>
authorBenjamin Kosnik <bkoz@redhat.com>
Thu, 6 Jan 2005 07:08:48 +0000 (07:08 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Thu, 6 Jan 2005 07:08:48 +0000 (07:08 +0000)
* testsuite/testsuite_hooks.h:
(copy_constructor::mark_call):  Use __throw_runtime_error.
(assignment_operator::mark_call): Same.
* testsuite/testsuite_hooks.cc (verify_demangle): Same.
(locale_data): Remove, just use runtime_error directly.
(environment_variable): Same.
(not_found): Same.
(run_tests_wrapped_locale): Use __throw_runtime_error.
(run_tests_wrapped_env): Same.
(semaphore::semaphore): Same.
(semaphore::signal): Same.
(semaphore::wait): Same.
* testsuite/testsuite_abi.h (symbol_error): Remove, use logic_error.
* testsuite/testsuite_abi.cc (get_symbol): Use __throw_logic_error.
(create_symbols): Use __throw_runtime_error.
* src/bitmap_allocator.cc: Use __throw_bad_alloc.

From-SVN: r92989

libstdc++-v3/ChangeLog
libstdc++-v3/src/bitmap_allocator.cc
libstdc++-v3/testsuite/testsuite_abi.cc
libstdc++-v3/testsuite/testsuite_abi.h
libstdc++-v3/testsuite/testsuite_hooks.cc
libstdc++-v3/testsuite/testsuite_hooks.h

index 521f8fba981ae4668694be7d19f00ce11ba7a0d2..ee303ac664dd4c37dd07e1e2c7aecfb454ba27c6 100644 (file)
@@ -1,3 +1,22 @@
+2005-01-05  Benjamin Kosnik  <bkoz@redhat.com>
+
+       * testsuite/testsuite_hooks.h: 
+       (copy_constructor::mark_call):  Use __throw_runtime_error.
+       (assignment_operator::mark_call): Same.
+       * testsuite/testsuite_hooks.cc (verify_demangle): Same.
+       (locale_data): Remove, just use runtime_error directly.
+       (environment_variable): Same.
+       (not_found): Same.
+       (run_tests_wrapped_locale): Use __throw_runtime_error.
+       (run_tests_wrapped_env): Same.
+       (semaphore::semaphore): Same.
+       (semaphore::signal): Same.
+       (semaphore::wait): Same.
+       * testsuite/testsuite_abi.h (symbol_error): Remove, use logic_error.
+       * testsuite/testsuite_abi.cc (get_symbol): Use __throw_logic_error.
+       (create_symbols): Use __throw_runtime_error.
+       * src/bitmap_allocator.cc: Use __throw_bad_alloc.
+
 2005-01-05  Mark Mitchell  <mark@codesourcery.com>
 
        * testsuite/27_io/basic_filebuf/open/char/9507.cc: Remove child
index 6e774a2c4081047887e4a2d81981474a8374274c..c379664c31a87014f98e4da984b1e8b5c6cd1126 100644 (file)
@@ -1,6 +1,6 @@
 // Bitmap Allocator. Out of line function definitions. -*- C++ -*-
 
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -96,7 +96,7 @@ namespace __gnu_cxx
            *__ret = __sz;
            return __ret + 1;
          }
-       __throw_exception_again std::bad_alloc();
+       std::__throw_bad_alloc();
       }
     else
       {
index 5957b78f9e9cb30346535e851800152de6615840..1120c7d3399d32de7b08a48a5a93974483172e45 100644 (file)
@@ -1,6 +1,6 @@
 // -*- C++ -*-
 
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
@@ -263,7 +263,7 @@ get_symbol(const string& mangled, const symbols& s)
     {
       ostringstream os;
       os << "get_symbol failed for symbol " << mangled;
-      __throw_exception_again symbol_error(os.str());
+      __throw_logic_error(os.str().c_str());
     }
 }
 
@@ -420,7 +420,7 @@ create_symbols(const char* file)
     {
       ostringstream os;
       os << "create_symbols failed for file " << file;
-      __throw_exception_again runtime_error(os.str());
+      __throw_runtime_error(os.str().c_str());
     }
   return s;
 }
index ebacb6a46e8fc3ce6eeb67f529ad133865a22637..2078eb76fa37fb8741f7e871b1d63e5144a0886d 100644 (file)
@@ -1,6 +1,6 @@
 // -*- C++ -*-
 
-// Copyright (C) 2004 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
@@ -69,12 +69,6 @@ struct symbol
   init(std::string& data);
 };
 
-struct symbol_error : public std::logic_error
-{
-  explicit symbol_error(const std::string& s) : std::logic_error(s) { }
-};
-
-
 typedef __gnu_cxx::hash_map<std::string, symbol>       symbol_objects;
 
 typedef std::deque<std::string>                                symbol_names;
index 4e7887bc214a67af1f9912c10672495e3c4a020e..8048738c02813fbf36a40b8e8b14468eeaf4f4b2 100644 (file)
@@ -151,32 +151,9 @@ namespace __gnu_test
 
     std::string w(wanted);
     if (w != s)
-      __throw_exception_again std::runtime_error(std::string(s));
+      std::__throw_runtime_error(s);
   }
 
-  
-  // Useful exceptions.
-  class locale_data : public std::runtime_error 
-  {
-  public:
-    explicit 
-    locale_data(const std::string&  __arg) : runtime_error(__arg) { }
-  };
-
-  class environment_variable: public std::runtime_error 
-  {
-  public:
-    explicit 
-    environment_variable(const std::string&  __arg) : runtime_error(__arg) { }
-  };
-
-  class not_found : public std::runtime_error 
-  {
-  public:
-    explicit 
-    not_found(const std::string&  __arg) : runtime_error(__arg) { }
-  };
-
   void 
   run_tests_wrapped_locale(const char* name, const func_callback& l)
   {
@@ -198,8 +175,11 @@ namespace __gnu_test
        VERIFY( preLC_ALL == postLC_ALL );
       }
     else
-      __throw_exception_again
-       environment_variable(string("LC_ALL for ") + string(name));
+      {
+       string s("LC_ALL for ");
+       s += name;
+       __throw_runtime_error(s.c_str());
+      }
   }
   
   void 
@@ -224,8 +204,12 @@ namespace __gnu_test
        setenv(env, oldENV ? oldENV : "", 1);
       }
     else
-      __throw_exception_again
-       environment_variable(string(env) + string(" to ") + string(name));
+      {
+       string s(env);
+       s += string(" to ");
+       s += string(name);
+       __throw_runtime_error(s.c_str());
+      }
 #endif
   }
 
@@ -278,7 +262,8 @@ namespace __gnu_test
   };
 #endif
 
-  semaphore::semaphore() {
+  semaphore::semaphore() 
+  {
 #ifdef _GLIBCXX_SYSV_SEM
     // Remeber the PID for the process that created the semaphore set
     // so that only one process will destroy the set.
@@ -296,15 +281,13 @@ namespace __gnu_test
     // Get a semaphore set with one semaphore.
     sem_set_ = semget(IPC_PRIVATE, 1, SEM_R | SEM_A);
     if (sem_set_ == -1)
-      __throw_exception_again 
-       std::runtime_error ("could not obtain semaphore set");
+      std::__throw_runtime_error("could not obtain semaphore set");
 
     // Initialize the semaphore.
     union semun val;
     val.val = 0;
     if (semctl(sem_set_, 0, SETVAL, val) == -1)
-      __throw_exception_again
-       std::runtime_error("could not initialize semaphore");
+      std::__throw_runtime_error("could not initialize semaphore");
 #else
     // There are no semaphores on this system.  We have no way to mark
     // a test as "unsupported" at runtime, so we just exit, pretending
@@ -313,7 +296,8 @@ namespace __gnu_test
 #endif
   }
 
-  semaphore::~semaphore() {
+  semaphore::~semaphore() 
+  {
 #ifdef _GLIBCXX_SYSV_SEM
     union semun val;
     // Destroy the semaphore set only in the process that created it. 
@@ -323,26 +307,28 @@ namespace __gnu_test
   }
 
   void
-  semaphore::signal() {
+  semaphore::signal() 
+  {
 #ifdef _GLIBCXX_SYSV_SEM
-    struct sembuf op[1] = {
-      { 0, 1, 0 }
-    };
+    struct sembuf op[1] = 
+      {
+       { 0, 1, 0 }
+      };
     if (semop(sem_set_, op, 1) == -1)
-      __throw_exception_again
-       std::runtime_error("could not signal semaphore");
+      std::__throw_runtime_error("could not signal semaphore");
 #endif
   }
 
   void
-  semaphore::wait() {
+  semaphore::wait() 
+  {
 #ifdef _GLIBCXX_SYSV_SEM
-    struct sembuf op[1] = {
-      { 0, -1, SEM_UNDO }
-    };
+    struct sembuf op[1] = 
+      {
+       { 0, -1, SEM_UNDO }
+      };
     if (semop(sem_set_, op, 1) == -1)
-      __throw_exception_again
-       std::runtime_error("could not wait for semaphore");
+      std::__throw_runtime_error("could not wait for semaphore");
 #endif    
   }
 }; // namespace __gnu_test
index 1ce9c65b0dfacf9ba45c94d1a2d46d30309cace1..171cdc6cee6a4ac4ba1b3bb137dbccc4a4fc4939 100644 (file)
@@ -1,7 +1,8 @@
 // -*- C++ -*-
 // Utility subroutines for the C++ library testsuite. 
 //
-// Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+// Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -224,7 +225,7 @@ namespace __gnu_test
     {
       count_++;
       if (count_ == throw_on_)
-       __throw_exception_again "copy constructor exception";
+       std::__throw_runtime_error("copy_constructor::mark_call");
     }
       
     static void
@@ -255,7 +256,7 @@ namespace __gnu_test
     {
       count_++;
       if (count_ == throw_on_)
-       __throw_exception_again "assignment operator exception";
+       std::__throw_runtime_error("assignment_operator::mark_call");
     }
 
     static void