From e191ee84f4075bfe103b67bef9b763a2ad1f1a2e Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 30 Jun 2018 17:34:20 +0200 Subject: [PATCH] cppparser: class is not implicitly copyable if it has a move ctor --- dtool/src/cppparser/cppStructType.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dtool/src/cppparser/cppStructType.cxx b/dtool/src/cppparser/cppStructType.cxx index aba4bdbb60..d0707c4404 100644 --- a/dtool/src/cppparser/cppStructType.cxx +++ b/dtool/src/cppparser/cppStructType.cxx @@ -545,6 +545,13 @@ is_copy_constructible(CPPVisibility min_vis) const { return true; } + if (get_move_constructor() != nullptr || + get_move_assignment_operator() != nullptr) { + // A user-declared move constructor or move assignment operator means that + // the implicitly-declared copy constructor is deleted. + return false; + } + CPPInstance *destructor = get_destructor(); if (destructor != nullptr) { if (destructor->_vis > min_vis) {