GCC 4.7.2 incorrectly detects noexcept specification in case of move constructor. Here is an example: struct descriptor_owner_movable { descriptor_owner_movable(descriptor_owner_movable&& ) noexcept {} // Without destructor it compiles correctly ~descriptor_owner_movable() {} }; descriptor_owner_movable&& declval() noexcept; int main() { static_assert( noexcept(descriptor_owner_movable(declval())) , "But it is nothrow!"); return 0; }
It's the correct behaviour that the destructor affects noexcept detection, because the operand expression creates *and* destroys temporary objects. G++ 4.7 does not apply the rule that destructors are noexcept, so you need to add an explicit noexcept specification on the destructor. GCC 4.8 correctly makes the destructor noexcept as required by C++11.
N.B. you don't need to CC yourself on bugs, the reporter always gets sent changes to the bug
Oh, thanks for clarification! Initially I was confused by the fact that std::is_nothrow_constructible checks for destructor, but I thought that it is a 'noexcept()' bug. Now I see that this issue is a duplicate for #51452. (In reply to comment #2) > N.B. you don't need to CC yourself on bugs, the reporter always gets sent > changes to the bug Thanks, next time I won't be so paranoid about mail notifications! *** This bug has been marked as a duplicate of bug 5142 ***
Oh, thanks for clarification! Initially I was confused by the fact that std::is_nothrow_constructible checks for destructor, but I thought that it is a 'noexcept()' bug. Now I see that this issue is a duplicate for #51452. (In reply to comment #2) > N.B. you don't need to CC yourself on bugs, the reporter always gets sent > changes to the bug Thanks, next time I won't be so paranoid about mail notifications!
*** This bug has been marked as a duplicate of bug 51452 ***