#include <utility>
struct A {};
struct B {
B(A&&) {}
B(const B&) = delete;
};
static void func(B) {}
int main() {
A a;
func(std::move(a));
}
This program is accepted by:
- GCC since 7.1 with
-std=c++17 - GCC trunk (perhaps with C++17 as default?)
- clang since 5.0 with
-std=c++17 - MSVC all versions I could find.
Was the standard changed regarding this in C++17? Is MSVC wrong in accepting this before C++17?