2009-05-22  Farid Zaripov  <faridz@apache.org>

	Merged r777603 from 4.2.x branch

	* etc/config/src/DOMAIN_ERROR_DTOR.cpp: New configuration test checking for domain_error dtor
	* etc/config/src/INVALID_ARGUMENT_DTOR.cpp: Same for invalid_argument.
	* etc/config/src/LENGTH_ERROR_DTOR.cpp: Same for length_error.
	* etc/config/src/LOGIC_ERROR_DTOR.cpp: Same for logic_error.
	* etc/config/src/OUT_OF_RANGE_DTOR.cpp: Same for out_of_range.
	* etc/config/src/OVERFLOW_ERROR_DTOR.cpp: Same for overflow_error.
	* etc/config/src/RANGE_ERROR_DTOR.cpp: Same for range_error.
	* etc/config/src/RUNTIME_ERROR_DTOR.cpp: Same for runtime_error.
	* etc/config/src/UNDERFLOW_ERROR_DTOR.cpp: Same for underflow_error.
	* src/domain_error.cpp: Define dtor if it is not defined in libc only.
	* src/invalid_argument.cpp: Ditto.
	* src/length_error.cpp: Ditto.
	* src/logic_error.cpp: Ditto.
	* src/out_of_range.cpp: Ditto.
	* src/overflow_error.cpp: Ditto.
	* src/range_error.cpp: Ditto.
	* src/runtime_error.cpp: Ditto.
	* src/underflow_error.cpp: Ditto.


git-svn-id: https://svn.apache.org/repos/asf/stdcxx/trunk@777607 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/etc/config/src/DOMAIN_ERROR_DTOR.cpp b/etc/config/src/DOMAIN_ERROR_DTOR.cpp
new file mode 100644
index 0000000..9237bf8
--- /dev/null
+++ b/etc/config/src/DOMAIN_ERROR_DTOR.cpp
@@ -0,0 +1,40 @@
+// checking for domain_error dtor
+
+/***************************************************************************
+ *
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  License); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1999-2007 Rogue Wave Software, Inc.
+ * 
+ **************************************************************************/
+
+#if 0   // guard invalid preprocessor symbol below
+   // establish a dependency on RUNTIME_IN_STD.cpp
+#  ifndef _RWSTD_NO_RUNTIME_IN_STD
+#  endif   // _RWSTD_NO_RUNTIME_IN_STD
+#endif   // 0
+
+#define TEST_DTOR
+#define bad_alloc domain_error
+#define main      test_domain_error_dtor
+#include "BAD_ALLOC_ASSIGNMENT.cpp"
+#undef main
+
+int main (int argc, char *argv[])
+{
+    return test_domain_error_dtor (argc, argv);
+}
diff --git a/etc/config/src/INVALID_ARGUMENT_DTOR.cpp b/etc/config/src/INVALID_ARGUMENT_DTOR.cpp
new file mode 100644
index 0000000..c475a2d
--- /dev/null
+++ b/etc/config/src/INVALID_ARGUMENT_DTOR.cpp
@@ -0,0 +1,40 @@
+// checking for invalid_argument dtor
+
+/***************************************************************************
+ *
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  License); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1999-2007 Rogue Wave Software, Inc.
+ * 
+ **************************************************************************/
+
+#if 0   // guard invalid preprocessor symbol below
+   // establish a dependency on RUNTIME_IN_STD.cpp
+#  ifndef _RWSTD_NO_RUNTIME_IN_STD
+#  endif   // _RWSTD_NO_RUNTIME_IN_STD
+#endif   // 0
+
+#define TEST_DTOR
+#define bad_alloc invalid_argument
+#define main      test_invalid_argument_dtor
+#include "BAD_ALLOC_ASSIGNMENT.cpp"
+#undef main
+
+int main (int argc, char *argv[])
+{
+    return test_invalid_argument_dtor (argc, argv);
+}
diff --git a/etc/config/src/LENGTH_ERROR_DTOR.cpp b/etc/config/src/LENGTH_ERROR_DTOR.cpp
new file mode 100644
index 0000000..72c23c8
--- /dev/null
+++ b/etc/config/src/LENGTH_ERROR_DTOR.cpp
@@ -0,0 +1,40 @@
+// checking for length_error dtor
+
+/***************************************************************************
+ *
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  License); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1999-2007 Rogue Wave Software, Inc.
+ * 
+ **************************************************************************/
+
+#if 0   // guard invalid preprocessor symbol below
+   // establish a dependency on RUNTIME_IN_STD.cpp
+#  ifndef _RWSTD_NO_RUNTIME_IN_STD
+#  endif   // _RWSTD_NO_RUNTIME_IN_STD
+#endif   // 0
+
+#define TEST_DTOR
+#define bad_alloc length_error
+#define main      test_length_error_dtor
+#include "BAD_ALLOC_ASSIGNMENT.cpp"
+#undef main
+
+int main (int argc, char *argv[])
+{
+    return test_length_error_dtor (argc, argv);
+}
diff --git a/etc/config/src/LOGIC_ERROR_DTOR.cpp b/etc/config/src/LOGIC_ERROR_DTOR.cpp
new file mode 100644
index 0000000..84de850
--- /dev/null
+++ b/etc/config/src/LOGIC_ERROR_DTOR.cpp
@@ -0,0 +1,40 @@
+// checking for logic_error dtor
+
+/***************************************************************************
+ *
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  License); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1999-2007 Rogue Wave Software, Inc.
+ * 
+ **************************************************************************/
+
+#if 0   // guard invalid preprocessor symbol below
+   // establish a dependency on RUNTIME_IN_STD.cpp
+#  ifndef _RWSTD_NO_RUNTIME_IN_STD
+#  endif   // _RWSTD_NO_RUNTIME_IN_STD
+#endif   // 0
+
+#define TEST_DTOR
+#define bad_alloc logic_error
+#define main      test_logic_error_dtor
+#include "BAD_ALLOC_ASSIGNMENT.cpp"
+#undef main
+
+int main (int argc, char *argv[])
+{
+    return test_logic_error_dtor (argc, argv);
+}
diff --git a/etc/config/src/OUT_OF_RANGE_DTOR.cpp b/etc/config/src/OUT_OF_RANGE_DTOR.cpp
new file mode 100644
index 0000000..87edc6a
--- /dev/null
+++ b/etc/config/src/OUT_OF_RANGE_DTOR.cpp
@@ -0,0 +1,40 @@
+// checking for out_of_range dtor
+
+/***************************************************************************
+ *
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  License); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1999-2007 Rogue Wave Software, Inc.
+ * 
+ **************************************************************************/
+
+#if 0   // guard invalid preprocessor symbol below
+   // establish a dependency on RUNTIME_IN_STD.cpp
+#  ifndef _RWSTD_NO_RUNTIME_IN_STD
+#  endif   // _RWSTD_NO_RUNTIME_IN_STD
+#endif   // 0
+
+#define TEST_DTOR
+#define bad_alloc out_of_range
+#define main      test_out_of_range_dtor
+#include "BAD_ALLOC_ASSIGNMENT.cpp"
+#undef main
+
+int main (int argc, char *argv[])
+{
+    return test_out_of_range_dtor (argc, argv);
+}
diff --git a/etc/config/src/OVERFLOW_ERROR_DTOR.cpp b/etc/config/src/OVERFLOW_ERROR_DTOR.cpp
new file mode 100644
index 0000000..162d47b
--- /dev/null
+++ b/etc/config/src/OVERFLOW_ERROR_DTOR.cpp
@@ -0,0 +1,40 @@
+// checking for overflow_error dtor
+
+/***************************************************************************
+ *
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  License); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1999-2007 Rogue Wave Software, Inc.
+ * 
+ **************************************************************************/
+
+#if 0   // guard invalid preprocessor symbol below
+   // establish a dependency on RUNTIME_IN_STD.cpp
+#  ifndef _RWSTD_NO_RUNTIME_IN_STD
+#  endif   // _RWSTD_NO_RUNTIME_IN_STD
+#endif   // 0
+
+#define TEST_DTOR
+#define bad_alloc overflow_error
+#define main      test_overflow_error_dtor
+#include "BAD_ALLOC_ASSIGNMENT.cpp"
+#undef main
+
+int main (int argc, char *argv[])
+{
+    return test_overflow_error_dtor (argc, argv);
+}
diff --git a/etc/config/src/RANGE_ERROR_DTOR.cpp b/etc/config/src/RANGE_ERROR_DTOR.cpp
new file mode 100644
index 0000000..fc37d11
--- /dev/null
+++ b/etc/config/src/RANGE_ERROR_DTOR.cpp
@@ -0,0 +1,40 @@
+// checking for range_error dtor
+
+/***************************************************************************
+ *
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  License); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1999-2007 Rogue Wave Software, Inc.
+ * 
+ **************************************************************************/
+
+#if 0   // guard invalid preprocessor symbol below
+   // establish a dependency on RUNTIME_IN_STD.cpp
+#  ifndef _RWSTD_NO_RUNTIME_IN_STD
+#  endif   // _RWSTD_NO_RUNTIME_IN_STD
+#endif   // 0
+
+#define TEST_DTOR
+#define bad_alloc range_error
+#define main      test_range_error_dtor
+#include "BAD_ALLOC_ASSIGNMENT.cpp"
+#undef main
+
+int main (int argc, char *argv[])
+{
+    return test_range_error_dtor (argc, argv);
+}
diff --git a/etc/config/src/RUNTIME_ERROR_DTOR.cpp b/etc/config/src/RUNTIME_ERROR_DTOR.cpp
new file mode 100644
index 0000000..d172018
--- /dev/null
+++ b/etc/config/src/RUNTIME_ERROR_DTOR.cpp
@@ -0,0 +1,40 @@
+// checking for runtime_error dtor
+
+/***************************************************************************
+ *
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  License); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1999-2007 Rogue Wave Software, Inc.
+ * 
+ **************************************************************************/
+
+#if 0   // guard invalid preprocessor symbol below
+   // establish a dependency on RUNTIME_IN_STD.cpp
+#  ifndef _RWSTD_NO_RUNTIME_IN_STD
+#  endif   // _RWSTD_NO_RUNTIME_IN_STD
+#endif   // 0
+
+#define TEST_DTOR
+#define bad_alloc runtime_error
+#define main      test_runtime_error_dtor
+#include "BAD_ALLOC_ASSIGNMENT.cpp"
+#undef main
+
+int main (int argc, char *argv[])
+{
+    return test_runtime_error_dtor (argc, argv);
+}
diff --git a/etc/config/src/UNDERFLOW_ERROR_DTOR.cpp b/etc/config/src/UNDERFLOW_ERROR_DTOR.cpp
new file mode 100644
index 0000000..31a237c
--- /dev/null
+++ b/etc/config/src/UNDERFLOW_ERROR_DTOR.cpp
@@ -0,0 +1,40 @@
+// checking for underflow_error dtor
+
+/***************************************************************************
+ *
+ * Licensed to the Apache Software  Foundation (ASF) under one or more
+ * contributor  license agreements.  See  the NOTICE  file distributed
+ * with  this  work  for  additional information  regarding  copyright
+ * ownership.   The ASF  licenses this  file to  you under  the Apache
+ * License, Version  2.0 (the  License); you may  not use  this file
+ * except in  compliance with the License.   You may obtain  a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the  License is distributed on an  "AS IS" BASIS,
+ * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
+ * implied.   See  the License  for  the  specific language  governing
+ * permissions and limitations under the License.
+ *
+ * Copyright 1999-2007 Rogue Wave Software, Inc.
+ * 
+ **************************************************************************/
+
+#if 0   // guard invalid preprocessor symbol below
+   // establish a dependency on RUNTIME_IN_STD.cpp
+#  ifndef _RWSTD_NO_RUNTIME_IN_STD
+#  endif   // _RWSTD_NO_RUNTIME_IN_STD
+#endif   // 0
+
+#define TEST_DTOR
+#define bad_alloc underflow_error
+#define main      test_underflow_error_dtor
+#include "BAD_ALLOC_ASSIGNMENT.cpp"
+#undef main
+
+int main (int argc, char *argv[])
+{
+    return test_underflow_error_dtor (argc, argv);
+}
diff --git a/src/domain_error.cpp b/src/domain_error.cpp
index 3c90904..3f0c191 100644
--- a/src/domain_error.cpp
+++ b/src/domain_error.cpp
@@ -32,6 +32,8 @@
 
 _RWSTD_NAMESPACE (std) {
 
+#ifdef _RWSTD_NO_DOMAIN_ERROR_DTOR
+
 // outlined to avoid generating a vtable in each translation unit
 // that uses the class
 /* virtual */ domain_error::
@@ -40,4 +42,6 @@
     // no-op
 }
 
+#endif   // _RWSTD_NO_DOMAIN_ERROR_DTOR
+
 }   // namespace std
diff --git a/src/invalid_argument.cpp b/src/invalid_argument.cpp
index 427f9b5..0f8f0d2 100644
--- a/src/invalid_argument.cpp
+++ b/src/invalid_argument.cpp
@@ -32,6 +32,8 @@
 
 _RWSTD_NAMESPACE (std) {
 
+#ifdef _RWSTD_NO_INVALID_ARGUMENT_DTOR
+
 // outlined to avoid generating a vtable in each translation unit
 // that uses the class
 /* virtual */ invalid_argument::
@@ -40,4 +42,6 @@
     // no-op
 }
 
+#endif   // _RWSTD_NO_INVALID_ARGUMENT_DTOR
+
 }   // namespace std
diff --git a/src/length_error.cpp b/src/length_error.cpp
index 85a1b5e..8c01e8b 100644
--- a/src/length_error.cpp
+++ b/src/length_error.cpp
@@ -32,6 +32,8 @@
 
 _RWSTD_NAMESPACE (std) {
 
+#ifdef _RWSTD_NO_LENGTH_ERROR_DTOR
+
 // outlined to avoid generating a vtable in each translation unit
 // that uses the class
 /* virtual */ length_error::
@@ -40,4 +42,6 @@
     // no-op
 }
 
+#endif   // _RWSTD_NO_LENGTH_ERROR_DTOR
+
 }   // namespace std
diff --git a/src/logic_error.cpp b/src/logic_error.cpp
index 3b2a93b..683a0b6 100644
--- a/src/logic_error.cpp
+++ b/src/logic_error.cpp
@@ -32,6 +32,8 @@
 
 _RWSTD_NAMESPACE (std) {
 
+#ifdef _RWSTD_NO_LOGIC_ERROR_DTOR
+
 // outlined to avoid generating a vtable in each translation unit
 // that uses the class
 /* virtual */ logic_error::
@@ -40,4 +42,6 @@
     // no-op
 }
 
+#endif   // _RWSTD_NO_LOGIC_ERROR_DTOR
+
 }   // namespace std
diff --git a/src/out_of_range.cpp b/src/out_of_range.cpp
index c955d16..a79898d 100644
--- a/src/out_of_range.cpp
+++ b/src/out_of_range.cpp
@@ -32,6 +32,8 @@
 
 _RWSTD_NAMESPACE (std) {
 
+#ifdef _RWSTD_NO_OUT_OF_RANGE_DTOR
+
 // outlined to avoid generating a vtable in each translation unit
 // that uses the class
 /* virtual */ out_of_range::
@@ -40,4 +42,6 @@
     // no-op
 }
 
+#endif   // _RWSTD_NO_OUT_OF_RANGE_DTOR
+
 }   // namespace std
diff --git a/src/overflow_error.cpp b/src/overflow_error.cpp
index 1a7f68e..e327d89 100644
--- a/src/overflow_error.cpp
+++ b/src/overflow_error.cpp
@@ -32,6 +32,8 @@
 
 _RWSTD_NAMESPACE (std) {
 
+#ifdef _RWSTD_NO_OVERFLOW_ERROR_DTOR
+
 // outlined to avoid generating a vtable in each translation unit
 // that uses the class
 /* virtual */ overflow_error::
@@ -40,4 +42,6 @@
     // no-op
 }
 
+#endif   // _RWSTD_NO_OVERFLOW_ERROR_DTOR
+
 }   // namespace std
diff --git a/src/range_error.cpp b/src/range_error.cpp
index c928138..cacff38 100644
--- a/src/range_error.cpp
+++ b/src/range_error.cpp
@@ -32,6 +32,8 @@
 
 _RWSTD_NAMESPACE (std) {
 
+#ifdef _RWSTD_NO_RANGE_ERROR_DTOR
+
 // outlined to avoid generating a vtable in each translation unit
 // that uses the class
 /* virtual */ range_error::
@@ -40,4 +42,6 @@
     // no-op
 }
 
+#endif   // _RWSTD_NO_RANGE_ERROR_DTOR
+
 }   // namespace std
diff --git a/src/runtime_error.cpp b/src/runtime_error.cpp
index 6105a4e..164b69d 100644
--- a/src/runtime_error.cpp
+++ b/src/runtime_error.cpp
@@ -32,6 +32,8 @@
 
 _RWSTD_NAMESPACE (std) {
 
+#ifdef _RWSTD_NO_RUNTIME_ERROR_DTOR
+
 // outlined to avoid generating a vtable in each translation unit
 // that uses the class
 /* virtual */ runtime_error::
@@ -40,4 +42,6 @@
     // no-op
 }
 
+#endif   // _RWSTD_NO_RUNTIME_ERROR_DTOR
+
 }   // namespace std
diff --git a/src/underflow_error.cpp b/src/underflow_error.cpp
index 0f5bb26..24ff1f1 100644
--- a/src/underflow_error.cpp
+++ b/src/underflow_error.cpp
@@ -32,6 +32,8 @@
 
 _RWSTD_NAMESPACE (std) {
 
+#ifdef _RWSTD_NO_UNDERFLOW_ERROR_DTOR
+
 // outlined to avoid generating a vtable in each translation unit
 // that uses the class
 /* virtual */ underflow_error::
@@ -40,4 +42,6 @@
     // no-op
 }
 
+#endif   // _RWSTD_NO_UNDERFLOW_ERROR_DTOR
+
 }   // namespace std