This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/24280] New: bad throw specification error on implicit destructor
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Oct 2005 23:59:51 -0000
- Subject: [Bug c++/24280] New: bad throw specification error on implicit destructor
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Got a "looser throw specification" error on the implicitly generated destructor
when instantiating a template with std::string. The instantiated class derives
from the std::string parameter. Neither the instantiated class nor its other
base throws anything, nor do either have a throw specification, nor an explicit
destructor. Std::string does have an explicit destructor, but that has no throw
specification:
~basic_string()
{ _M_rep()->_M_dispose(this->get_allocator()); }
I tried to reproduce this with:
struct s : std::string{};
and
template<typename T> struct s1 : public T {}; s1<std::string> sx;
but both compile fine.
Note that one of the line numbers (261) in the diagnostic points to an
unrelated
line. This may suggest the source of the problem.
--
Summary: bad throw specification error on implicit destructor
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24280