-
Notifications
You must be signed in to change notification settings - Fork 403
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
NewType Copy-Assign raises compiler warning on GCC 8.4.0 #282
Comments
@ithier On latest master and release 1.0 this warning does not come up, I will close this here for now. |
@dkroenke I think this is because we use this ugly struct Foo : public cxx::NewType<...>
{
/* this is already in the documentation of the NewType pattern */
using ThisType::ThisType;
using ThisType::operator=; // bring all operator= into scope
/* this is new */
// implement copy and move ctors when they are implemented by the base class
Foo(const Foo&) = default;
Foo(Foo&&) = default;
// implement copy and move assingment when they are implemented by the base class
Foo& operator=(const Foo&) = default;
Foo& operator=(Foo&&) = default;
}; @elfenpiff @MatthiasKillat do you think there are any reasons not to do it as suggested? |
@elBoberido no I am fine with this :D |
iox-#282 Fix deprecated-copy warning
Required information
Operating system:
Ubuntu 18.04 LTS
Compiler version:
GCC 8.4.0
Observed result or behaviour:
The following test for the NewType class in utils causes an incorrect compiler warning:
The warning "deprecated-copy" is raised at
b = a;
despite the NewType having no deprecated copy constructor.The source of the error might be elsewhere but this is not clear to me.
GCC 8.4.0 is what is used on the Github Workflow VM so this test causes the build to fail and thus blocks merges.
Expected result or behaviour:
This code should compile without warning.
Conditions where it occurred / Performed steps:
Compile on GCC 8.4.0
The text was updated successfully, but these errors were encountered: