Re:C++ std::move doesn't move anything: A deep dive into Val...
by rfc3092 on Sunday January 11, 2026 @11:01AM
(#46576841)
performance-noexcept-move-constructor is great but it also complains about move assignment operators, which are completely different beasts and are practically impossible to make noexcept if your destructors throw.
[ Parent
| on HN ]
Re:C++ std::move doesn't move anything: A deep dive into Val...
by dataflow on Sunday January 11, 2026 @12:13PM
(#46577525)
If that's the issue you're facing, consider clang-query, e.g.: https://godbolt.org/z/bfG94qGan
match cxxConstructExpr(hasDeclaration(cxxConstructorDecl(isMoveConstructor(), unless(isNoThrow())).bind("throwing-move")))
You can put extra constraints on the caller if you'd like (e.g., isInStdNamespace()), though it's less trivial. Happy to help write something if you have a precise idea of what you want to match.
Re:C++ std::move doesn't move anything: A deep dive into Val...
by beached_whale on Sunday January 11, 2026 @12:34PM
(#46577691)
Throwing destructors will generally end in termination of the program if they are used as class members. Types like scope_exit are fine, but anywhere else will probably have noexcept(true) on it's destructor.