re PR libstdc++/9561 (ostream inserters rethrow exception of wrong type)
authorJerry Quinn <jlquinn@optonline.net>
Sun, 9 Mar 2003 04:19:52 +0000 (04:19 +0000)
committerJerry Quinn <jlquinn@gcc.gnu.org>
Sun, 9 Mar 2003 04:19:52 +0000 (04:19 +0000)
2003-03-08  Jerry Quinn  <jlquinn@optonline.net>

PR libstdc++/9561
* include/bits/basic_ios.h (_M_setstate): New.
* include/bits/ostream.tcc (operator<<): Use it.
* include/bits/istream.tcc (operator>>): Use it.
* include/std/std_ostream.h (operator<<): Make friends.
* include/std/std_istream.h (operator>>): Make friends.
* testsuite/27_io/ostream_exception.cc,
testsuite/27_io/istream_exception.cc: New tests.

From-SVN: r64021

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/basic_ios.h
libstdc++-v3/include/bits/istream.tcc
libstdc++-v3/include/bits/ostream.tcc
libstdc++-v3/include/std/std_istream.h
libstdc++-v3/include/std/std_ostream.h
libstdc++-v3/testsuite/27_io/istream_exception.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/ostream_exception.cc [new file with mode: 0644]

index c5a4dbc3f63d6a424248097e75556ef790586411..81ac17ed5d26dfca63b1ffd6cacfc5e7316428f1 100644 (file)
@@ -1,3 +1,14 @@
+2003-03-08  Jerry Quinn  <jlquinn@optonline.net>
+
+       PR libstdc++/9561
+       * include/bits/basic_ios.h (_M_setstate): New.
+       * include/bits/ostream.tcc (operator<<): Use it.
+       * include/bits/istream.tcc (operator>>): Use it.
+       * include/std/std_ostream.h (operator<<): Make friends.
+       * include/std/std_istream.h (operator>>): Make friends.
+       * testsuite/27_io/ostream_exception.cc,
+       testsuite/27_io/istream_exception.cc: New tests.
+
 2003-03-08  Benjamin Kosnik  <bkoz@redhat.com> 
 
        * include/bits/locale_facets.tcc: Fix typo.
index 7d0e47ef3af7abcfe4e1297fe64d743db3cdb61b..03b54b7198be56534223aab598a6d929611833cd 100644 (file)
@@ -441,6 +441,11 @@ namespace std
 
       void
       _M_cache_locale(const locale& __loc);
+
+      // Internal state setter that won't throw, only set the state bits.
+      // Used to guarantee we don't throw when setting badbit.
+      void
+      _M_setstate(iostate __state) { _M_streambuf_state |= __state; }
     };
 } // namespace std
 
index 0bd7fff51da7763ec9868cf6745b2669969a97bf..68295b4c9f3ebbe11507015832fdb2a9bead42e0 100644 (file)
@@ -122,7 +122,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -159,7 +159,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -186,7 +186,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -223,7 +223,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -250,7 +250,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -277,7 +277,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -304,7 +304,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -332,7 +332,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
              __throw_exception_again;
            }
@@ -359,7 +359,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -387,7 +387,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -414,7 +414,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -441,7 +441,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -468,7 +468,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -499,7 +499,7 @@ namespace std
             {
               // 27.6.2.5.1 Common requirements.
               // Turn this on without causing an ios::failure to be thrown.
-              this->setstate(ios_base::badbit);
+              this->_M_setstate(ios_base::badbit);
               if ((this->exceptions() & ios_base::badbit) != 0)
                 __throw_exception_again;
             }
@@ -531,7 +531,7 @@ namespace std
            {
              // 27.6.1.3 paragraph 1
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -565,7 +565,7 @@ namespace std
            {
              // 27.6.1.3 paragraph 1
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -604,7 +604,7 @@ namespace std
            {
              // 27.6.1.3 paragraph 1
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -647,7 +647,7 @@ namespace std
            {
              // 27.6.1.3 paragraph 1
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -698,7 +698,7 @@ namespace std
            {
              // 27.6.1.3 paragraph 1
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -739,7 +739,7 @@ namespace std
            {
              // 27.6.1.3 paragraph 1
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -763,7 +763,7 @@ namespace std
            {
              // 27.6.1.3 paragraph 1
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -790,7 +790,7 @@ namespace std
            {
              // 27.6.1.3 paragraph 1
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -826,7 +826,7 @@ namespace std
            {
              // 27.6.1.3 paragraph 1
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -856,7 +856,7 @@ namespace std
            {
              // 27.6.1.3 paragraph 1
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -887,7 +887,7 @@ namespace std
            {
              // 27.6.1.3 paragraph 1
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -922,7 +922,7 @@ namespace std
            {
              // 27.6.1.3 paragraph 1
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -998,7 +998,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             __in.setstate(ios_base::badbit);
+             __in._M_setstate(ios_base::badbit);
              if ((__in.exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -1055,7 +1055,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             __in.setstate(ios_base::badbit);
+             __in._M_setstate(ios_base::badbit);
              if ((__in.exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
index a60dd7207399df9c8f33d759e5c6f2c72977a87a..64b37a4882671d80e234db6ecb2187b985663bf5 100644 (file)
@@ -70,7 +70,7 @@ namespace std
            {
              // 27.6.2.5.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -92,7 +92,7 @@ namespace std
            {
              // 27.6.2.5.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -114,7 +114,7 @@ namespace std
            {
              // 27.6.2.5.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -138,7 +138,7 @@ namespace std
            {
              // 27.6.2.5.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -166,7 +166,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -205,7 +205,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -231,7 +231,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -272,7 +272,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -298,7 +298,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -325,7 +325,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -351,7 +351,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -377,7 +377,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             this->setstate(ios_base::badbit);
+             this->_M_setstate(ios_base::badbit);
              if ((this->exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -499,7 +499,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             __out.setstate(ios_base::badbit);
+             __out._M_setstate(ios_base::badbit);
              if ((__out.exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -535,7 +535,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             __out.setstate(ios_base::badbit);
+             __out._M_setstate(ios_base::badbit);
              if ((__out.exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -570,7 +570,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             __out.setstate(ios_base::badbit);
+             __out._M_setstate(ios_base::badbit);
              if ((__out.exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -619,7 +619,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             __out.setstate(ios_base::badbit);
+             __out._M_setstate(ios_base::badbit);
              if ((__out.exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
@@ -658,7 +658,7 @@ namespace std
            {
              // 27.6.1.2.1 Common requirements.
              // Turn this on without causing an ios::failure to be thrown.
-             __out.setstate(ios_base::badbit);
+             __out._M_setstate(ios_base::badbit);
              if ((__out.exceptions() & ios_base::badbit) != 0)
                __throw_exception_again;
            }
index aab3db3d7c2740b7f67efabcd180380e0db0f416..fa97f72209399d0ec9b892d96262d4f6b012be77 100644 (file)
@@ -73,6 +73,14 @@ namespace std
       typedef num_get<_CharT, __istreambuf_iter>        __numget_type;
       typedef ctype<_CharT>                            __ctype_type;
 
+      template<typename _CharT2, typename _Traits2>
+        friend basic_istream<_CharT2, _Traits2>&
+        operator>>(basic_istream<_CharT2, _Traits2>&, _CharT2&);
+      template<typename _CharT2, typename _Traits2>
+        friend basic_istream<_CharT2, _Traits2>&
+        operator>>(basic_istream<_CharT2, _Traits2>&, _CharT2*);
     protected:
       // Data Members:
       /**
index 9f7c386f181647ee8a2906d6a83dfc7367cab5c1..103b3fd729997f33f720d2c10e64fe0a9e6dcaba 100644 (file)
@@ -73,6 +73,26 @@ namespace std
       typedef num_put<_CharT, __ostreambuf_iter>        __numput_type;
       typedef ctype<_CharT>                            __ctype_type;
 
+      template<typename _CharT2, typename _Traits2>
+        friend basic_ostream<_CharT2, _Traits2>&
+        operator<<(basic_ostream<_CharT2, _Traits2>&, _CharT2);
+      template<typename _Traits2>
+        friend basic_ostream<char, _Traits2>&
+        operator<<(basic_ostream<char, _Traits2>&, char);
+      template<typename _CharT2, typename _Traits2>
+        friend basic_ostream<_CharT2, _Traits2>&
+        operator<<(basic_ostream<_CharT2, _Traits2>&, const _CharT2*);
+      template<typename _Traits2>
+        friend basic_ostream<char, _Traits2>&
+        operator<<(basic_ostream<char, _Traits2>&, const char*);
+      template<typename _CharT2, typename _Traits2>
+        friend basic_ostream<_CharT2, _Traits2>&
+        operator<<(basic_ostream<_CharT2, _Traits2>&, const char*);
+
       // [27.6.2.2] constructor/destructor
       /**
        *  @brief  Base constructor.
diff --git a/libstdc++-v3/testsuite/27_io/istream_exception.cc b/libstdc++-v3/testsuite/27_io/istream_exception.cc
new file mode 100644 (file)
index 0000000..2c3b121
--- /dev/null
@@ -0,0 +1,68 @@
+// 2003-03-08  Jerry Quinn  <jlquinn@optonline.net>
+
+// Copyright (C) 2003 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <istream>
+#include <streambuf>
+#include <testsuite_hooks.h>
+
+// libstdc++/9561
+struct foobar: std::exception { };
+
+struct buf: std::streambuf
+{
+    virtual int_type underflow () {
+        throw foobar ();
+        return -1;
+    }
+    virtual int_type uflow () {
+        throw foobar ();
+        return -1;
+    }
+};
+
+void test01()
+{
+  using namespace std;
+
+  buf b;
+  std::istream strm (&b);
+  strm.exceptions (std::ios::badbit);
+  int i = 0;
+
+  try {
+    i = strm.get();
+  }
+  catch (foobar) {
+    // strm should throw foobar and not do anything else
+    VERIFY(strm.bad());
+  }
+  catch (...) {
+    VERIFY(false);
+  }
+
+  VERIFY(i == 0);
+}
+
+
+int main()
+{
+  test01();
+  return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/ostream_exception.cc b/libstdc++-v3/testsuite/27_io/ostream_exception.cc
new file mode 100644 (file)
index 0000000..8c2b340
--- /dev/null
@@ -0,0 +1,66 @@
+// 2003-03-08  Jerry Quinn  <jlquinn@optonline.net>
+
+// Copyright (C) 2003 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <ostream>
+#include <streambuf>
+#include <testsuite_hooks.h>
+
+// libstdc++/9561
+struct foobar: std::exception { };
+
+struct buf: std::streambuf
+{
+    virtual int_type overflow (int_type) {
+        throw foobar ();
+        return -1;
+    }
+};
+
+void test01()
+{
+  using namespace std;
+  bool test = true;
+
+  buf b;
+  std::ostream strm (&b);
+  strm.exceptions (std::ios::badbit);
+
+  try {
+    strm << std::endl;
+  }
+  catch (foobar) {
+    // strm should throw foobar and not do anything else
+    VERIFY(strm.bad());
+    return;
+  }
+  catch (...) {
+    VERIFY(false);
+    return;
+  }
+
+  VERIFY(false);
+}
+
+
+int main()
+{
+  test01();
+  return 0;
+}