diff --git a/modules/core/include/opencv2/core/persistence.hpp b/modules/core/include/opencv2/core/persistence.hpp index 192e307bce..ba02d698f4 100644 --- a/modules/core/include/opencv2/core/persistence.hpp +++ b/modules/core/include/opencv2/core/persistence.hpp @@ -320,7 +320,7 @@ public: BASE64 = 64, //!< flag, write rawdata in Base64 by default. (consider using WRITE_BASE64) WRITE_BASE64 = BASE64 | WRITE, //!< flag, enable both WRITE and BASE64 }; - enum + enum State { UNDEFINED = 0, VALUE_EXPECTED = 1, diff --git a/modules/core/src/persistence.cpp b/modules/core/src/persistence.cpp index 101c1bbf94..ab684c98e6 100644 --- a/modules/core/src/persistence.cpp +++ b/modules/core/src/persistence.cpp @@ -342,14 +342,6 @@ static inline void writeReal(uchar* p, double fval) class FileStorage::Impl : public FileStorage_API { public: - enum State - { - UNDEFINED = 0, - VALUE_EXPECTED = 1, - NAME_EXPECTED = 2, - INSIDE_MAP = 4 - }; - void init() { flags = 0; diff --git a/modules/core/test/test_ptr.cpp b/modules/core/test/test_ptr.cpp index 87fd559283..885516d1b6 100644 --- a/modules/core/test/test_ptr.cpp +++ b/modules/core/test/test_ptr.cpp @@ -160,7 +160,14 @@ TEST(Core_Ptr, assignment) { Ptr p1(new Reporter(&deleted1)); +#if defined(__clang__) && (__clang_major__ >= 9) && !defined(__APPLE__) +CV_DO_PRAGMA(GCC diagnostic push) +CV_DO_PRAGMA(GCC diagnostic ignored "-Wself-assign-overloaded") +#endif p1 = p1; +#if defined(__clang__) && (__clang_major__ >= 9) && !defined(__APPLE__) +CV_DO_PRAGMA(GCC diagnostic pop) +#endif EXPECT_FALSE(deleted1); } diff --git a/modules/gapi/include/opencv2/gapi/gcompoundkernel.hpp b/modules/gapi/include/opencv2/gapi/gcompoundkernel.hpp index c5ac8a7d24..f4c02344ee 100644 --- a/modules/gapi/include/opencv2/gapi/gcompoundkernel.hpp +++ b/modules/gapi/include/opencv2/gapi/gcompoundkernel.hpp @@ -78,7 +78,7 @@ template struct tuple_wrap_helper template struct tuple_wrap_helper> { - static std::tuple get(std::tuple&& objs) { return objs; } + static std::tuple get(std::tuple&& objs) { return std::forward>(objs); } }; template diff --git a/modules/stitching/src/camera.cpp b/modules/stitching/src/camera.cpp index 0b1ae36a94..149ba74760 100644 --- a/modules/stitching/src/camera.cpp +++ b/modules/stitching/src/camera.cpp @@ -66,7 +66,7 @@ Mat CameraParams::K() const Mat_ k = Mat::eye(3, 3, CV_64F); k(0,0) = focal; k(0,2) = ppx; k(1,1) = focal * aspect; k(1,2) = ppy; - return k; + return std::move(k); } } // namespace detail diff --git a/modules/video/src/optical_flow_io.cpp b/modules/video/src/optical_flow_io.cpp index 8a2d70bc83..8f9efedc33 100644 --- a/modules/video/src/optical_flow_io.cpp +++ b/modules/video/src/optical_flow_io.cpp @@ -52,12 +52,12 @@ CV_EXPORTS_W Mat readOpticalFlow( const String& path ) Mat_ flow; std::ifstream file(path.c_str(), std::ios_base::binary); if ( !file.good() ) - return flow; // no file - return empty matrix + return std::move(flow); // no file - return empty matrix float tag; file.read((char*) &tag, sizeof(float)); if ( tag != FLOW_TAG_FLOAT ) - return flow; + return std::move(flow); int width, height; @@ -76,14 +76,14 @@ CV_EXPORTS_W Mat readOpticalFlow( const String& path ) if ( !file.good() ) { flow.release(); - return flow; + return std::move(flow); } flow(i, j) = u; } } file.close(); - return flow; + return std::move(flow); } CV_EXPORTS_W bool writeOpticalFlow( const String& path, InputArray flow )