This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/81256] New: basic_filebuf::close doesn't propagate exceptions
- From: "programmerjake at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 30 Jun 2017 01:40:14 +0000
- Subject: [Bug libstdc++/81256] New: basic_filebuf::close doesn't propagate exceptions
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81256
Bug ID: 81256
Summary: basic_filebuf::close doesn't propagate exceptions
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: programmerjake at gmail dot com
Target Milestone: ---
in line 247 of fstream.tcc, basic_filebuf::close ignores exceptions thrown by
_M_terminate_output. _M_terminate_output calls unshift on the codecvt facet
from the imbued locale. unshift might throw if using a custom codecvt facet.
the standard (N4659) says (30.9.2.3.7), referring to calling unshift and other
functions:
If one of these calls throws an exception,
the exception is caught and rethrown after closing the file.