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] -fno-exceptions fixes


Caught this with a CXXFLAGS="-fno-exceptions -std=gnu++0x" build of the
sources while working on something entirely unrelated. It appears that

testsuite/17_intro/headers/c++200x/all_no_exceptions.cc

did not catch these instances (guess is no template instantiations of
basic_string<char> or alternates.). 

tested x86_64/linux

-benjamin
2010-02-02  Benjamin Kosnik  <bkoz@redhat.com>

	* include/bits/allocator.h: Fix for -fno-exceptions.
	* include/bits/basic_string.h (basic_string::shrink_to_fit): Same.

Index: include/bits/basic_string.h
===================================================================
--- include/bits/basic_string.h	(revision 156454)
+++ include/bits/basic_string.h	(working copy)
@@ -743,9 +743,9 @@
       void
       shrink_to_fit()
       {
-	try
+	__try
 	  { reserve(0); }
-	catch(...)
+	__catch(...)
 	  { }
       }
 #endif
Index: include/bits/allocator.h
===================================================================
--- include/bits/allocator.h	(revision 156454)
+++ include/bits/allocator.h	(working copy)
@@ -194,9 +194,9 @@
        static void
        _S_do_it(_Tp& __v)
        {
-	 try
+	 __try
 	   { _Tp(__v).swap(__v); }
-	 catch(...) { }
+	 __catch(...) { }
        }
      };
 #endif

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