Skip to content
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

Remove noexcept on DoFAccessor move constructor and assignment operator #12335

Merged
merged 1 commit into from
May 29, 2021

Conversation

simonsticko
Copy link
Contributor

I can't can't compile master with clang 6.0.0 without removing the noexcept keyword on DoFAccessor:

In file included from /home/simon/workspace/dealiiCloseToMaster/source/numerics/data_out.cc:18:                                                                          
/home/simon/workspace/dealiiCloseToMaster/include/deal.II/dofs/dof_accessor.h:280:3: error: exception specification of explicitly defaulted move constructor does not    
      match the calculated one                                                                                                                                           
  DoFAccessor(DoFAccessor<structdim, dim, spacedim, level_dof_access>                                                                                                    
  ^                                                                                                                                                                      
/home/simon/workspace/dealiiCloseToMaster/include/deal.II/dofs/dof_accessor.h:1367:32: note: in instantiation of template class 'dealii::DoFAccessor<1, 1, 1, false>'    
      requested here                                                                                                                                                     
class DoFCellAccessor : public DoFAccessor<dimension_,                                                                                                                   
                               ^                                                                                                                                         
/home/simon/workspace/dealiiCloseToMaster/include/deal.II/grid/tria_iterator.h:277:25: note: in instantiation of template class 'dealii::DoFCellAccessor<1, 1, false>'   
      requested here                                                                                                                                                     
    const Triangulation<Accessor::dimension, Accessor::space_dimension> *parent,                                                                                         
                        ^                                                                                                                                                
/home/simon/workspace/dealiiCloseToMaster/include/deal.II/grid/tria_iterator.h:577:29: note: in instantiation of template class                                          
      'dealii::TriaRawIterator<dealii::DoFCellAccessor<1, 1, false> >' requested here                                                                                    
class TriaIterator : public TriaRawIterator<Accessor>                                                                                                                    
                            ^                                                                                                                                            
/home/simon/workspace/dealiiCloseToMaster/source/numerics/data_out.cc:233:21: note: in instantiation of template class 'dealii::TriaIterator<dealii::DoFCellAccessor<1,  
      1, false> >' requested here
                    dh_cell(&cell_and_index->first->get_triangulation(),
                    ^
/home/simon/workspace/dealiiCloseToMaster/build/source/numerics/data_out.inst:127:16: note: in instantiation of member function 'dealii::DataOut<1, 1>::build_one_patch'
      requested here
template class DataOut< 1 >;

Same problem as #12313.

@masterleinad
Copy link
Member

/rebuild

@simonsticko
Copy link
Contributor Author

clang-tidy complained so I had to spam all lines with \\ NO LINT. It doesn't look very nice combined with clang-format, but I don't know what else to do here:

  DoFAccessor<structdim, dim, spacedim, level_dof_access> &       // NOLINT
  operator=(                                                      // NOLINT
    DoFAccessor<structdim, dim, spacedim, level_dof_access> &&) = // NOLINT
    default;                                                      // NOLINT

@masterleinad
Copy link
Member

It's a pretty unfortunate situation we are in with clang-tidy also wanting to enforce noexecpt where the compiler should come up with the correct noexcept specifier and older clang versions complaining if they don't think it's correct. 🙁
I think it's fine to comment multiple lines here even if it doesn't look nice.

@bangerth
Copy link
Member

Could we teach clang-tidy to just not care about the noexcept?

@masterleinad
Copy link
Member

Could we teach clang-tidy to just not care about the noexcept?

We could disable checking that move constructors and move assignment operators should be noexcept but that would also apply to non-defaulted user-provided ones.

@kronbichler kronbichler merged commit 47ee6f0 into dealii:master May 29, 2021
kronbichler added a commit that referenced this pull request May 30, 2021
[9.3] Take over #12335: Remove noexcept on DoFAccessor move constructor and assignment operator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants