Skip to content

Fixed clang -Wdeprecated-copy warnings in OpenCV#33

Merged
dmatveev merged 1 commit intoopencv:masterfrom
mshabunin:fix-clang-warn
May 31, 2023
Merged

Fixed clang -Wdeprecated-copy warnings in OpenCV#33
dmatveev merged 1 commit intoopencv:masterfrom
mshabunin:fix-clang-warn

Conversation

@mshabunin
Copy link
Copy Markdown
Contributor

@mshabunin mshabunin commented Feb 6, 2023

If the class definition does not explicitly declare a copy constructor, a non-explicit one is declared implicitly. If the class definition declares a move constructor or move assignment operator, the implicitly declared copy constructor is defined as deleted; otherwise, it is defaulted ([dcl.fct.def]). The latter case is deprecated if the class has a user-declared copy assignment operator or a user-declared destructor ([depr.impldec]).

See http://eel.is/c++draft/class.copy.ctor#6 and https://bugs.llvm.org/show_bug.cgi?id=45634

I decided to implement copy constructor instead of removing explicit operator= , hope it is correct.

resolves #32

Copy link
Copy Markdown
Collaborator

@dmatveev dmatveev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe @Hardcode84 has some comments on this? Fine for me, actually.

Copy link
Copy Markdown
Collaborator

@dmatveev dmatveev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe @Hardcode84 has some comments on this? Fine for me, actually.

@dmatveev dmatveev merged commit 0ee020d into opencv:master May 31, 2023
@mshabunin mshabunin deleted the fix-clang-warn branch May 31, 2023 15:15
@mshabunin
Copy link
Copy Markdown
Contributor Author

@dmatveev , thank you!
Are you going to make a new release soon?

@dmatveev
Copy link
Copy Markdown
Collaborator

@mshabunin there was no enough content in master since then, if it is critical to include into the latest OpenCV then we can push a new tag for sure.

@mshabunin
Copy link
Copy Markdown
Contributor Author

Well, these warnings are quite annoying. Taking in account that previous minor release have been created to address similar problem, I think it's not a big issue. So I'm making a new minor-minor 🙂 release 0.1.2b.

@dmatveev
Copy link
Copy Markdown
Collaborator

@mshabunin thanks a lot for taking care of this!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple -Wdeprecated-copy warnings on Mac OS since clang 13.1

2 participants