This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug libstdc++/66145] [5/6 Regression] std::ios_base::failure objects thrown from libstdc++.so use old ABI


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66145

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Reduced from testcase at  https://bugzilla.redhat.com/show_bug.cgi?id=1269290

#include <iostream>
#include <fstream>
#include <system_error>
#include <exception>


int main() {

  try {
    std::ifstream input("notafile");
    input.exceptions(std::ifstream::failbit | std::ifstream::badbit);
    input.get();
  } catch(const std::ios::failure &e) {
    std::cout << "caught a failure " << e.what()
      << '\n';
  } catch(const std::system_error &e) {
    std::cout << "caught a system_error " << e.what()
      << '\n';
  } catch(const std::runtime_error &e) {
    std::cout << "caught a runtime_error " << e.what()
      << '\n';
  } catch(const std::exception &e) {
    std::cout << "caught an exception " << e.what()
      << '\n';
  }
}

The last handler matches, but it should have matched earlier.


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