move constructor Follow
Hi,
In my project I'm using make_unique along with unique_ptrs but am getting some errors in the code analysis that are not really errors, ie:
unique_ptr<Foo> a = make_unique<Foo>();
Shows the error:
`unique_ptr::operator=(const unique_ptr&)' is deleted
While this is true, the above uses the move constructor not the copy constructor.
Is this a known issue, and if so is there a fix in the pipeline? It's not a major issue but it's annoying to see errors in the code that aren't really there.
Cheers.
Please sign in to leave a comment.
Hi Jonathan!
I can't reproduce your issue in my environment. Could you please specify your CLion version, OS, the compiler you're using, and provide a sample program to reproduce the issue? The following program does not produce the warning for me (CLion 1.1.1, clang, OS X):
Hi Anna,
Sorry it's taken a few days - i've just come back to this project today.
Trying to replicate the issue it seems it only happens when i'm trying to assign the unique_ptr to a member variable.
In the below example the f_, and g_ assignments both give the warning, but the h assignment in main is fine.
Please note that i've got my own version of make_unique as the version of GCC i'm using doesn't include one.
I'm using CLion 1.1.1, on Linux Mint 17.2 and GCC 4.8.4
Hi Jonathan.