New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gcc 9.1 -Wdeprecated-copy warnings for implicit copy constructor and assignment operator #161
Comments
This was referenced Jul 2, 2019
Thank you for the report! We are working on the issues and we will fix them in one of the future releases. |
I've closed my PRs since I did not know C++03 is still supported. Is there an EOL plan for C++03 and moving to C++11? |
We are considering this option to drop C++03 support but there is no final decision yet. |
@zmajeed , these warnings have been fixed in the TBB2020 U9 release. |
stonier
added a commit
to stonier/ecl_core
that referenced
this issue
Jul 26, 2020
stonier
added a commit
to stonier/ecl_core
that referenced
this issue
Jul 28, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Building TBB 2019 Update 8 with
make test
with gcc 9.1 and -Wextra generates 1,320 -Wdeprecated-copy warnings. The other warnings are 12 -Wmissing-attributes and 6 -Wclass-memaccess (PR #157).The -Wdeprecated-copy warning was announced in https://www.gnu.org/software/gcc/gcc-9/changes.html. It is documented at https://gcc.gnu.org/onlinedocs/gcc-9.1.0/gcc/C_002b_002b-Dialect-Options.html#index-Wdeprecated-copy
There are two types of causes for -Wdeprecated-copy warnings in TBB
An assignment operator is written without a copy constructor, or a copy constructor is written without an assignment operator
An assignment operator or copy constructor is made private without defining the other
Most of the causes of type 1 can be fixed by declaring the missing function as defaulted
For example:
is fixed by adding:
Causes of type 2 can be fixed by replacing the private declaration with a deleted declaration
For example:
is fixed by replacing the private operator= above with:
There is one example of type 1 that is a bit more complicated to fix
This is caused by a constructor that doubles as a copy constructor or a converting constructor
The warning occurs when
Value
is different fromContainer::value_type
. In this case the constructor above turns into a converting constructor and there is no user-defined copy constructor. The assignment operator is defined so the warning is emitted for the compiler-generated copy constructor.I've fixed this by defining a copy constructor and turning the converting constructor into a template function that is enabled only when
Value
is different fromContainer::value_type
The three types of changes are in separate pull requests referencing this issue
The text was updated successfully, but these errors were encountered: