summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-06 07:08:48 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-06 07:08:48 +0000
commitdfafcdbf984f8df3becf014cb6f3217e84a1d611 (patch)
treefb2d84bf63906b7e344def297290378960b40a45 /libstdc++-v3
parent18d43aa0ba45545e6d09d1d4a0f64986617a4d46 (diff)
downloadgcc-dfafcdbf984f8df3becf014cb6f3217e84a1d611.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92989 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog19
-rw-r--r--libstdc++-v3/src/bitmap_allocator.cc4
-rw-r--r--libstdc++-v3/testsuite/testsuite_abi.cc6
-rw-r--r--libstdc++-v3/testsuite/testsuite_abi.h8
-rw-r--r--libstdc++-v3/testsuite/testsuite_hooks.cc78
-rw-r--r--libstdc++-v3/testsuite/testsuite_hooks.h7
6 files changed, 61 insertions, 61 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 521f8fba981..ee303ac664d 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -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
diff --git a/libstdc++-v3/src/bitmap_allocator.cc b/libstdc++-v3/src/bitmap_allocator.cc
index 6e774a2c408..c379664c31a 100644
--- a/libstdc++-v3/src/bitmap_allocator.cc
+++ b/libstdc++-v3/src/bitmap_allocator.cc
@@ -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
{
diff --git a/libstdc++-v3/testsuite/testsuite_abi.cc b/libstdc++-v3/testsuite/testsuite_abi.cc
index 5957b78f9e9..1120c7d3399 100644
--- a/libstdc++-v3/testsuite/testsuite_abi.cc
+++ b/libstdc++-v3/testsuite/testsuite_abi.cc
@@ -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;
}
diff --git a/libstdc++-v3/testsuite/testsuite_abi.h b/libstdc++-v3/testsuite/testsuite_abi.h
index ebacb6a46e8..2078eb76fa3 100644
--- a/libstdc++-v3/testsuite/testsuite_abi.h
+++ b/libstdc++-v3/testsuite/testsuite_abi.h
@@ -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;
diff --git a/libstdc++-v3/testsuite/testsuite_hooks.cc b/libstdc++-v3/testsuite/testsuite_hooks.cc
index 4e7887bc214..8048738c028 100644
--- a/libstdc++-v3/testsuite/testsuite_hooks.cc
+++ b/libstdc++-v3/testsuite/testsuite_hooks.cc
@@ -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
diff --git a/libstdc++-v3/testsuite/testsuite_hooks.h b/libstdc++-v3/testsuite/testsuite_hooks.h
index 1ce9c65b0df..171cdc6cee6 100644
--- a/libstdc++-v3/testsuite/testsuite_hooks.h
+++ b/libstdc++-v3/testsuite/testsuite_hooks.h
@@ -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