This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/62172] Operand to a throw expression is moved when it should be copied
- From: "ville.voutilainen at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 18 Aug 2014 16:02:05 +0000
- Subject: [Bug c++/62172] Operand to a throw expression is moved when it should be copied
- Auto-submitted: auto-generated
- References: <bug-62172-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62172
Ville Voutilainen <ville.voutilainen at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-08-18
CC| |ville.voutilainen at gmail dot com
Ever confirmed|0 |1
--- Comment #1 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
Reduced:
#include <cassert>
int move_count = 0;
struct X {
X() = default;
X(const X&) = default;
X(X&&) {++move_count;}
};
int main()
{
X x;
try {throw x;}
catch (X&) {}
assert(move_count==0);
}
Asserts on gcc, doesn't assert on clang.