This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/51452] New: has_nothrow_.*constructor bugs
- From: "dave at boost-consulting dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 07 Dec 2011 16:55:00 +0000
- Subject: [Bug libstdc++/51452] New: has_nothrow_.*constructor bugs
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51452
Bug #: 51452
Summary: has_nothrow_.*constructor bugs
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: dave@boost-consulting.com
The traits that detect nothrow constructibility are buggy because they are
influenced by whether the object has a nothrow dtor; destruction is invoked at
the end of evaluation of the full expression in the noexcept( ... ) operator.
They all use the pattern of constructing a temporary inside noexcept, whereas
they should be using placement new:
struct X
{
X() noexcept;
~X();
};
static_assert( noexcept( X() ), "fails because of ~X" );
static_assert( noexcept(new (nullptr) X()), "works" );