-
Notifications
You must be signed in to change notification settings - Fork 707
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
Fix warnings using clang 13.0 #12299
Conversation
include/deal.II/dofs/dof_accessor.h
Outdated
/** | ||
* Copy constructor. | ||
*/ | ||
DoFAccessor(const DoFAccessor<structdim, dim, spacedim, level_dof_access> &) = | ||
default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to implicitly delete the move constructor? I would prefer to just go with the rule of 5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also be in favor to adhere to the rule of five, and additionally specify move constructors and copy and move assignment operators like in #12294.
include/deal.II/grid/tria_accessor.h
Outdated
/** | ||
* Move assignment operator. | ||
*/ | ||
void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void | |
CellAccessor<dim, spacedim> & |
include/deal.II/grid/tria_accessor.h
Outdated
@@ -2868,6 +2883,12 @@ class CellAccessor : public TriaAccessor<dim, dim, spacedim> | |||
void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void | |
CellAccessor<dim, spacedim> & |
fa4353b
to
7409336
Compare
This is ready for review. They were a few classes that triggered the warning that I missed the first time. |
/rebuild |
hmmm looks like we can't get osx and clang-tidy to be happy at the same time. clang-tidy complains that the move constructors are not marked |
What are the error messages with OSX? I would rather use |
The code does not compile because when the object is moved into a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably apply the rule of zero in step-47
but I don't feel strongly about it.
CopyData(const CopyData &) = default; | ||
|
||
|
||
CopyData(CopyData &&) = default; | ||
|
||
|
||
~CopyData() = default; | ||
|
||
|
||
CopyData &operator=(const CopyData &) = default; | ||
|
||
|
||
CopyData &operator=(CopyData &&) = default; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CopyData(const CopyData &) = default; | |
CopyData(CopyData &&) = default; | |
~CopyData() = default; | |
CopyData &operator=(const CopyData &) = default; | |
CopyData &operator=(CopyData &&) = default; |
107c1ef
to
750cf31
Compare
Let's get this to the release branch as well. |
* Move assignment operator. | ||
*/ | ||
DoFAccessor<structdim, dim, spacedim, level_dof_access> & | ||
operator=(DoFAccessor<structdim, dim, spacedim, level_dof_access> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work with older versions of clang? I expect that we would need a NOLINT
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We currently have a bunch of places in the library with noexcept
for move constructor/assignment operator. I suspect the noexcept
problem triggers when a std container calls move
but it's just a guess. Not sure if it matters if we are using libc++
or libstc++
. The CI OSX did trigger the bug in my PR, so I was hoping that it would catch it again.
#12294 does not fix all the warnings from clang 13.0. This fixes the others.