Ticket #9680: no_exception.patch

File no_exception.patch, 23.7 KB (added by anonymous, 9 years ago)
  • date_time/gregorian/gregorian_io.hpp

     
    2020#include <boost/date_time/special_values_formatter.hpp>
    2121#include <boost/date_time/gregorian/gregorian_types.hpp>
    2222#include <boost/date_time/gregorian/conversion.hpp> // to_tm will be needed in the facets
     23#include "boost/detail/no_exceptions_support.hpp"
    2324
    2425namespace boost {
    2526namespace gregorian {
     
    7677    boost::io::ios_flags_saver iflags(is);
    7778    typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
    7879    if (strm_sentry) {
    79       try {
     80      BOOST_TRY {
    8081        typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
    8182       
    8283        std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
     
    9091          f->get(sit, str_end, is, d);
    9192        }
    9293      }
    93       catch(...) {
     94      BOOST_CATCH(...) {
    9495        // mask tells us what exceptions are turned on
    9596        std::ios_base::iostate exception_mask = is.exceptions();
    9697        // if the user wants exceptions on failbit, we'll rethrow our
    9798        // date_time exception & set the failbit
    9899        if(std::ios_base::failbit & exception_mask) {
    99           try { is.setstate(std::ios_base::failbit); }
    100           catch(std::ios_base::failure&) {} // ignore this one
    101           throw; // rethrow original exception
     100          BOOST_TRY { is.setstate(std::ios_base::failbit); }
     101          BOOST_CATCH(std::ios_base::failure&) {} // ignore this one
     102                  BOOST_CATCH_END
     103          BOOST_RETHROW; // rethrow original exception
    102104        }
    103105        else {
    104106          // if the user want's to fail quietly, we simply set the failbit
     
    106108        }
    107109           
    108110      }
     111          BOOST_CATCH_END
    109112    }   
    110113    return is;
    111114  }
     
    137140    boost::io::ios_flags_saver iflags(is);
    138141    typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
    139142    if (strm_sentry) {
    140       try {
     143      BOOST_TRY {
    141144        typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
    142145       
    143146        std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
     
    151154          f->get(sit, str_end, is, dd);
    152155        }
    153156      }
    154       catch(...) {
     157      BOOST_CATCH(...) {
    155158        std::ios_base::iostate exception_mask = is.exceptions();
    156159        if(std::ios_base::failbit & exception_mask) {
    157           try { is.setstate(std::ios_base::failbit); }
    158           catch(std::ios_base::failure&) {}
    159           throw; // rethrow original exception
     160          BOOST_TRY { is.setstate(std::ios_base::failbit); }
     161          BOOST_CATCH(std::ios_base::failure&) {}
     162                  BOOST_CATCH_END
     163          BOOST_RETHROW; // rethrow original exception
    160164        }
    161165        else {
    162166          is.setstate(std::ios_base::failbit);
    163167        }
    164168           
    165169      }
     170          BOOST_CATCH_END
    166171    }
    167172    return is;
    168173  }
     
    201206    boost::io::ios_flags_saver iflags(is);
    202207    typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
    203208    if (strm_sentry) {
    204       try {
     209      BOOST_TRY {
    205210        typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
    206211
    207212        std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
     
    215220          f->get(sit, str_end, is, dp);
    216221        }
    217222      }
    218       catch(...) {
     223      BOOST_CATCH(...) {
    219224        std::ios_base::iostate exception_mask = is.exceptions();
    220225        if(std::ios_base::failbit & exception_mask) {
    221           try { is.setstate(std::ios_base::failbit); }
    222           catch(std::ios_base::failure&) {}
    223           throw; // rethrow original exception
     226          BOOST_TRY { is.setstate(std::ios_base::failbit); }
     227          BOOST_CATCH(std::ios_base::failure&) {}
     228                  BOOST_CATCH_END
     229          BOOST_RETHROW; // rethrow original exception
    224230        }
    225231        else {
    226232          is.setstate(std::ios_base::failbit);
    227233        }
    228234           
    229235      }
     236          BOOST_CATCH_END
    230237    }
    231238    return is;
    232239  }
     
    260267    boost::io::ios_flags_saver iflags(is);
    261268    typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
    262269    if (strm_sentry) {
    263       try {
     270      BOOST_TRY {
    264271        typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
    265272
    266273        std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
     
    274281          f->get(sit, str_end, is, m);
    275282        }
    276283      }
    277       catch(...) {
     284      BOOST_CATCH(...) {
    278285        std::ios_base::iostate exception_mask = is.exceptions();
    279286        if(std::ios_base::failbit & exception_mask) {
    280           try { is.setstate(std::ios_base::failbit); }
    281           catch(std::ios_base::failure&) {}
    282           throw; // rethrow original exception
     287          BOOST_TRY { is.setstate(std::ios_base::failbit); }
     288          BOOST_CATCH(std::ios_base::failure&) {}
     289                  BOOST_CATCH_END
     290          BOOST_RETHROW; // rethrow original exception
    283291        }
    284292        else {
    285293          is.setstate(std::ios_base::failbit);
    286294        }
    287295           
    288296      }
     297          BOOST_CATCH_END
    289298    }
    290299    return is;
    291300  }
     
    317326    boost::io::ios_flags_saver iflags(is);
    318327    typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
    319328    if (strm_sentry) {
    320       try {
     329      BOOST_TRY {
    321330        typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
    322331
    323332        std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
     
    331340          f->get(sit, str_end, is, wd);
    332341        }
    333342      }
    334       catch(...) {
     343      BOOST_CATCH(...) {
    335344        std::ios_base::iostate exception_mask = is.exceptions();
    336345        if(std::ios_base::failbit & exception_mask) {
    337           try { is.setstate(std::ios_base::failbit); }
    338           catch(std::ios_base::failure&) {}
    339           throw; // rethrow original exception
     346          BOOST_TRY { is.setstate(std::ios_base::failbit); }
     347          BOOST_CATCH(std::ios_base::failure&) {}
     348          BOOST_RETHROW; // rethrow original exception
     349                  BOOST_CATCH_END
    340350        }
    341351        else {
    342352          is.setstate(std::ios_base::failbit);
    343353        }
    344354           
    345355      }
     356          BOOST_CATCH_END
    346357    }
    347358    return is;
    348359  }
     
    358369    boost::io::ios_flags_saver iflags(is);
    359370    typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
    360371    if (strm_sentry) {
    361       try {
     372      BOOST_TRY {
    362373        typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
    363374
    364375        std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
     
    372383          f->get(sit, str_end, is, gd);
    373384        }
    374385      }
    375       catch(...) {
     386      BOOST_CATCH(...) {
    376387        std::ios_base::iostate exception_mask = is.exceptions();
    377388        if(std::ios_base::failbit & exception_mask) {
    378           try { is.setstate(std::ios_base::failbit); }
    379           catch(std::ios_base::failure&) {}
    380           throw; // rethrow original exception
     389          BOOST_TRY { is.setstate(std::ios_base::failbit); }
     390          BOOST_CATCH(std::ios_base::failure&) {}
     391                  BOOST_CATCH_END
     392          BOOST_RETHROW; // rethrow original exception
    381393        }
    382394        else {
    383395          is.setstate(std::ios_base::failbit);
    384396        }
    385397           
    386398      }
     399          BOOST_CATCH_END
    387400    }
    388401    return is;
    389402  }
     
    399412    boost::io::ios_flags_saver iflags(is);
    400413    typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
    401414    if (strm_sentry) {
    402       try {
     415      BOOST_TRY {
    403416        typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
    404417
    405418        std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
     
    413426          f->get(sit, str_end, is, gy);
    414427        }
    415428      }
    416       catch(...) {
     429      BOOST_CATCH(...) {
    417430        std::ios_base::iostate exception_mask = is.exceptions();
    418431        if(std::ios_base::failbit & exception_mask) {
    419           try { is.setstate(std::ios_base::failbit); }
    420           catch(std::ios_base::failure&) {}
    421           throw; // rethrow original exception
     432          BOOST_TRY { is.setstate(std::ios_base::failbit); }
     433          BOOST_CATCH(std::ios_base::failure&) {}
     434                  BOOST_CATCH_END
     435          BOOST_RETHROW; // rethrow original exception
    422436        }
    423437        else {
    424438          is.setstate(std::ios_base::failbit);
    425439        }
    426440           
    427441      }
     442          BOOST_CATCH_END
    428443    }
    429444    return is;
    430445  }
     
    457472    boost::io::ios_flags_saver iflags(is);
    458473    typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
    459474    if (strm_sentry) {
    460       try {
     475      BOOST_TRY {
    461476        typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
    462477
    463478        std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
     
    471486          f->get(sit, str_end, is, pd);
    472487        }
    473488      }
    474       catch(...) {
     489      BOOST_CATCH(...) {
    475490        std::ios_base::iostate exception_mask = is.exceptions();
    476491        if(std::ios_base::failbit & exception_mask) {
    477           try { is.setstate(std::ios_base::failbit); }
    478           catch(std::ios_base::failure&) {}
    479           throw; // rethrow original exception
     492          BOOST_TRY { is.setstate(std::ios_base::failbit); }
     493          BOOST_CATCH(std::ios_base::failure&) {}
     494          BOOST_RETHROW; // rethrow original exception
     495                  BOOST_CATCH_END
    480496        }
    481497        else {
    482498          is.setstate(std::ios_base::failbit);
    483499        }
    484500           
    485501      }
     502          BOOST_CATCH_END
    486503    }
    487504    return is;
    488505  }
     
    514531    boost::io::ios_flags_saver iflags(is);
    515532    typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
    516533    if (strm_sentry) {
    517       try {
     534      BOOST_TRY {
    518535        typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
    519536
    520537        std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
     
    528545          f->get(sit, str_end, is, nday);
    529546        }
    530547      }
    531       catch(...) {
     548      BOOST_CATCH(...) {
    532549        std::ios_base::iostate exception_mask = is.exceptions();
    533550        if(std::ios_base::failbit & exception_mask) {
    534           try { is.setstate(std::ios_base::failbit); }
    535           catch(std::ios_base::failure&) {}
    536           throw; // rethrow original exception
     551          BOOST_TRY { is.setstate(std::ios_base::failbit); }
     552          BOOST_CATCH(std::ios_base::failure&) {}
     553          BOOST_RETHROW; // rethrow original exception
     554                  BOOST_CATCH_END
    537555        }
    538556        else {
    539557          is.setstate(std::ios_base::failbit);
    540558        }
    541559           
    542560      }
     561          BOOST_CATCH_END
    543562    }
    544563    return is;
    545564  }
     
    572591    boost::io::ios_flags_saver iflags(is);
    573592    typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
    574593    if (strm_sentry) {
    575       try {
     594      BOOST_TRY {
    576595        typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
    577596
    578597        std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
     
    586605          f->get(sit, str_end, is, fkd);
    587606        }
    588607      }
    589       catch(...) {
     608      BOOST_CATCH(...) {
    590609        std::ios_base::iostate exception_mask = is.exceptions();
    591610        if(std::ios_base::failbit & exception_mask) {
    592           try { is.setstate(std::ios_base::failbit); }
    593           catch(std::ios_base::failure&) {}
    594           throw; // rethrow original exception
     611          BOOST_TRY { is.setstate(std::ios_base::failbit); }
     612          BOOST_CATCH(std::ios_base::failure&) {}
     613                  BOOST_CATCH_END
     614          BOOST_RETHROW; // rethrow original exception
    595615        }
    596616        else {
    597617          is.setstate(std::ios_base::failbit);
    598618        }
    599619           
    600620      }
     621          BOOST_CATCH_END
    601622    }
    602623    return is;
    603624  }
     
    630651    boost::io::ios_flags_saver iflags(is);
    631652    typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
    632653    if (strm_sentry) {
    633       try {
     654      BOOST_TRY {
    634655        typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
    635656
    636657        std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
     
    644665          f->get(sit, str_end, is, lkd);
    645666        }
    646667      }
    647       catch(...) {
     668      BOOST_CATCH(...) {
    648669        std::ios_base::iostate exception_mask = is.exceptions();
    649670        if(std::ios_base::failbit & exception_mask) {
    650           try { is.setstate(std::ios_base::failbit); }
    651           catch(std::ios_base::failure&) {}
    652           throw; // rethrow original exception
     671          BOOST_TRY { is.setstate(std::ios_base::failbit); }
     672          BOOST_CATCH(std::ios_base::failure&) {}
     673                  BOOST_CATCH_END
     674          BOOST_RETHROW; // rethrow original exception
    653675        }
    654676        else {
    655677          is.setstate(std::ios_base::failbit);
    656678        }
    657679           
    658680      }
     681          BOOST_CATCH_END
    659682    }
    660683    return is;
    661684  }
     
    689712    boost::io::ios_flags_saver iflags(is);
    690713    typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
    691714    if (strm_sentry) {
    692       try {
     715      BOOST_TRY {
    693716        typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
    694717
    695718        std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
     
    703726          f->get(sit, str_end, is, fka);
    704727        }
    705728      }
    706       catch(...) {
     729      BOOST_CATCH(...) {
    707730        std::ios_base::iostate exception_mask = is.exceptions();
    708731        if(std::ios_base::failbit & exception_mask) {
    709           try { is.setstate(std::ios_base::failbit); }
    710           catch(std::ios_base::failure&) {}
    711           throw; // rethrow original exception
     732          BOOST_TRY { is.setstate(std::ios_base::failbit); }
     733          BOOST_CATCH(std::ios_base::failure&) {}
     734                  BOOST_CATCH_END
     735          BOOST_RETHROW; // rethrow original exception
    712736        }
    713737        else {
    714738          is.setstate(std::ios_base::failbit);
    715739        }
    716740           
    717741      }
     742          BOOST_CATCH_END
    718743    }
    719744    return is;
    720745  }
     
    748773    boost::io::ios_flags_saver iflags(is);
    749774    typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
    750775    if (strm_sentry) {
    751       try {
     776      BOOST_TRY {
    752777        typedef typename date_time::date_input_facet<date, CharT> date_input_facet;
    753778
    754779        std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
     
    762787          f->get(sit, str_end, is, fkb);
    763788        }
    764789      }
    765       catch(...) {
     790      BOOST_CATCH(...) {
    766791        std::ios_base::iostate exception_mask = is.exceptions();
    767792        if(std::ios_base::failbit & exception_mask) {
    768           try { is.setstate(std::ios_base::failbit); }
    769           catch(std::ios_base::failure&) {}
    770           throw; // rethrow original exception
     793          BOOST_TRY { is.setstate(std::ios_base::failbit); }
     794          BOOST_CATCH(std::ios_base::failure&) {}
     795                  BOOST_CATCH_END
     796          BOOST_RETHROW; // rethrow original exception
    771797        }
    772798        else {
    773799          is.setstate(std::ios_base::failbit);
    774800        }
    775801           
    776802      }
     803          BOOST_CATCH_END
    777804    }
    778805    return is;
    779806  }
  • date_time/posix_time/posix_time_io.hpp

     
    7474    boost::io::ios_flags_saver iflags(is);
    7575    typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
    7676    if (strm_sentry) {
    77       try {
     77      BOOST_TRY {
    7878        typedef typename date_time::time_input_facet<ptime, CharT> time_input_facet;
    7979        std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
    8080        if(std::has_facet<time_input_facet>(is.getloc())) {
     
    8787          f->get(sit, str_end, is, pt);
    8888        }
    8989      }
    90       catch(...) {
     90      BOOST_CATCH(...) {
    9191        // mask tells us what exceptions are turned on
    9292        std::ios_base::iostate exception_mask = is.exceptions();
    9393        // if the user wants exceptions on failbit, we'll rethrow our
    9494        // date_time exception & set the failbit
    9595        if(std::ios_base::failbit & exception_mask) {
    96           try { is.setstate(std::ios_base::failbit); }
    97           catch(std::ios_base::failure&) {} // ignore this one
    98           throw; // rethrow original exception
     96          BOOST_TRY { is.setstate(std::ios_base::failbit); }
     97          BOOST_CATCH(std::ios_base::failure&) {} // ignore this one
     98                  BOOST_CATCH_END
     99          BOOST_RETHROW; // rethrow original exception
    99100        }
    100101        else {
    101102          // if the user want's to fail quietly, we simply set the failbit
    102103          is.setstate(std::ios_base::failbit);
    103104        }
    104105      }
     106          BOOST_CATCH_END
    105107    }
    106108    return is;
    107109  }
     
    142144    boost::io::ios_flags_saver iflags(is);
    143145    typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
    144146    if (strm_sentry) {
    145       try {
     147      BOOST_TRY {
    146148        typedef typename date_time::time_input_facet<ptime, CharT> time_input_facet;
    147149        std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
    148150        if(std::has_facet<time_input_facet>(is.getloc())) {
     
    155157          f->get(sit, str_end, is, tp);
    156158        }
    157159      }
    158       catch(...) {
     160      BOOST_CATCH(...) {
    159161        std::ios_base::iostate exception_mask = is.exceptions();
    160162        if(std::ios_base::failbit & exception_mask) {
    161           try { is.setstate(std::ios_base::failbit); }
    162           catch(std::ios_base::failure&) {}
    163           throw; // rethrow original exception
     163          BOOST_TRY { is.setstate(std::ios_base::failbit); }
     164          BOOST_CATCH(std::ios_base::failure&) {}
     165                  BOOST_CATCH_END
     166          BOOST_RETHROW; // rethrow original exception
    164167        }
    165168        else {
    166169          is.setstate(std::ios_base::failbit);
    167170        }
    168171      }
     172          BOOST_CATCH_END
    169173    }
    170174    return is;
    171175  }
     
    207211    boost::io::ios_flags_saver iflags(is);
    208212    typename std::basic_istream<CharT, Traits>::sentry strm_sentry(is, false);
    209213    if (strm_sentry) {
    210       try {
     214      BOOST_TRY {
    211215        typedef typename date_time::time_input_facet<ptime, CharT> time_input_facet;
    212216        std::istreambuf_iterator<CharT,Traits> sit(is), str_end;
    213217        if(std::has_facet<time_input_facet>(is.getloc())) {
     
    220224          f->get(sit, str_end, is, td);
    221225        }
    222226      }
    223       catch(...) {
     227      BOOST_CATCH(...) {
    224228        std::ios_base::iostate exception_mask = is.exceptions();
    225229        if(std::ios_base::failbit & exception_mask) {
    226           try { is.setstate(std::ios_base::failbit); }
    227           catch(std::ios_base::failure&) {}
    228           throw; // rethrow original exception
     230          BOOST_TRY { is.setstate(std::ios_base::failbit); }
     231          BOOST_CATCH(std::ios_base::failure&) {}
     232                  BOOST_CATCH_END
     233          BOOST_RETHROW; // rethrow original exception
    229234        }
    230235        else {
    231236          is.setstate(std::ios_base::failbit);
    232237        }
    233238      }
     239          BOOST_CATCH_END
    234240    }
    235241    return is;
    236242  }
  • date_time/time_facet.hpp

     
    10051005                    char_type cs[3] = { '%', *itr };
    10061006                    string_type s(cs);
    10071007                    match_results mr;
    1008                     try {
     1008                    BOOST_TRY {
    10091009                      t_year = this->m_parser.parse_year(sitr, stream_end, s, mr);
    10101010                    }
    1011                     catch(std::out_of_range&) { // base class for bad_year exception
     1011                    BOOST_CATCH(std::out_of_range&) { // base class for bad_year exception
    10121012                      if(this->m_sv_parser.match(sitr, stream_end, mr)) {
    10131013                        t = time_type(static_cast<special_values>(mr.current_match));
    10141014                        return sitr;
    10151015                      }
    10161016                      else {
    1017                         throw; // rethrow bad_year
     1017                        BOOST_RETHROW; // rethrow bad_year
    10181018                      }
     1019                                          BOOST_CATCH_END
    10191020                    }
    10201021                    break;
    10211022                  }
     
    10261027                    char_type cs[3] = { '%', *itr };
    10271028                    string_type s(cs);
    10281029                    match_results mr;
    1029                     try {
     1030                    BOOST_TRY {
    10301031                      t_month = this->m_parser.parse_month(sitr, stream_end, s, mr);
    10311032                    }
    1032                     catch(std::out_of_range&) { // base class for bad_month exception
     1033                    BOOST_CATCH(std::out_of_range&) { // base class for bad_month exception
    10331034                      if(this->m_sv_parser.match(sitr, stream_end, mr)) {
    10341035                        t = time_type(static_cast<special_values>(mr.current_match));
    10351036                        return sitr;
    10361037                      }
    10371038                      else {
    1038                         throw; // rethrow bad_month
     1039                        BOOST_RETHROW; // rethrow bad_month
    10391040                      }
    10401041                    }
     1042                                        BOOST_CATCH_END
    10411043                    // did m_parser already advance sitr to next char?
    10421044                    if(mr.has_remaining()) {
    10431045                      use_current_char = true;
     
    10531055                    string_type s(cs);
    10541056                    match_results mr;
    10551057                    typename date_type::day_of_week_type wd(0);
    1056                     try {
     1058                    BOOST_TRY {
    10571059                      wd = this->m_parser.parse_weekday(sitr, stream_end, s, mr);
    10581060                    }
    1059                     catch(std::out_of_range&) { // base class for bad_weekday exception
     1061                    BOOST_CATCH(std::out_of_range&) { // base class for bad_weekday exception
    10601062                      if(this->m_sv_parser.match(sitr, stream_end, mr)) {
    10611063                        t = time_type(static_cast<special_values>(mr.current_match));
    10621064                        return sitr;
    10631065                      }
    10641066                      else {
    1065                         throw; // rethrow bad_weekday
     1067                        BOOST_RETHROW; // rethrow bad_weekday
    10661068                      }
    10671069                    }
     1070                                        BOOST_CATCH_END
    10681071                    // did m_parser already advance sitr to next char?
    10691072                    if(mr.has_remaining()) {
    10701073                      use_current_char = true;
     
    10891092                  }
    10901093                case 'd':
    10911094                  {
    1092                     try {
     1095                    BOOST_TRY {
    10931096                      t_day = this->m_parser.parse_day_of_month(sitr, stream_end);
    10941097                    }
    1095                     catch(std::out_of_range&) { // base class for exception bad_day_of_month
     1098                    BOOST_CATCH(std::out_of_range&) { // base class for exception bad_day_of_month
    10961099                      match_results mr;
    10971100                      if(this->m_sv_parser.match(sitr, stream_end, mr)) {
    10981101                        t = time_type(static_cast<special_values>(mr.current_match));
    10991102                        return sitr;
    11001103                      }
    11011104                      else {
    1102                         throw; // rethrow bad_day_of_month
     1105                        BOOST_RETHROW; // rethrow bad_day_of_month
    11031106                      }
    11041107                    }
     1108                                        BOOST_CATCH_END
    11051109                    break;
    11061110                  }
    11071111                // time flags