Bug#597090: libstdc++6-4.5-dev: several STL classes implicitly add to the exception specification of containing classes' destructors
Package: libstdc++6-4.5-dev
Version: 4.5-20100227-1
Severity: minor
Hi,
the attached code fails to compile with
test.cpp:11: error: looser throw specifier for ‘virtual implementation::~implementation()’
test.cpp:6: error: overriding ‘virtual interface::~interface() throw ()’
The reason for this is that the std::string destructor is not declared
to never throw, and the implicit dtor inherits the exception
specification from the members' destructors.
The same applies to several other STL types, like list, map, ...
The problem can be worked around by defining an explicit destructor.
Simon
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages libstdc++6-4.5-dev depends on:
ii g++-4.5 4.5-20100227-1 The GNU C++ compiler
ii gcc-4.5-base 4.5-20100227-1 The GNU Compiler Collection (base
ii libc6-dev 2.11.2-6 Embedded GNU C Library: Developmen
ii libstdc++6 4.5-20100227-1 The GNU Standard C++ Library v3
libstdc++6-4.5-dev recommends no packages.
Versions of packages libstdc++6-4.5-dev suggests:
pn libstdc++6-4.5-doc <none> (no description available)
-- no debconf information
Reply to: