Skip to content

Fix implicitly-declared 'constexpr...' warnings#3267

Merged
andypugh merged 1 commit intoLinuxCNC:masterfrom
BsAtHome:fix_deprecated-copy
Jan 11, 2025
Merged

Fix implicitly-declared 'constexpr...' warnings#3267
andypugh merged 1 commit intoLinuxCNC:masterfrom
BsAtHome:fix_deprecated-copy

Conversation

@BsAtHome
Copy link
Contributor

A couple of warnings are detected when adding -Wdeprecated-copy. Defining a copy-constructor in C++11 and beyond requires you to overload the operator= too, just as you probably need a destructor (rule-of-three).

This PR fixes the warnings for posemath by simply disabling the appropriate define.

The EMC_TOOL_STAT class had a strange operator= override, making a copy and then returning another copy. This has been fixed in the PR to use standard const reference as argument and returning the new object. It also blocks any use of the copy-constructor to be sure to use the right assignment code.

@andypugh andypugh merged commit 4747e59 into LinuxCNC:master Jan 11, 2025
10 checks passed
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.

2 participants