dglazier / brufit

GNU General Public License v3.0
2 stars 7 forks source link

Warnings from -Wdefaulted-function-deleted #23

Closed c-dilks closed 2 years ago

c-dilks commented 3 years ago

Building brufit with a newer version of root (6.24/02) causes several -Wdefaulted-function-deleted. I think this is because of a cling update, where -Wdefaulted-function-deleted is now on by default. I've only tested this on the dev branch.

Here are a couple sample warnings:

In file included from input_line_9:14:
/home/dilks/j/dispin/deps/brufit/core/Setup.h:61:14: warning: explicitly defaulted move assignment operator is implicitly deleted [-Wdefaulted-function-deleted]
      Setup& operator=(Setup&& other) = default;
             ^
/home/dilks/j/dispin/deps/brufit/core/Setup.h:211:20: note: move assignment operator of 'Setup' is implicitly deleted because field 'fWS' has a deleted move assignment operator
      RooWorkspace fWS;
                   ^
/home/dilks/builds/root-6.24.02-install/include/RooWorkspace.h:278:39: note: copy assignment operator of 'RooWorkspace' is implicitly deleted because field '_factory' has a deleted copy assignment operator
    std::unique_ptr<RooFactoryWSTool> _factory; //! Factory tool associated with workspace
                                      ^
/usr/include/c++/7/bits/unique_ptr.h:384:19: note: 'operator=' has been explicitly marked deleted here
      unique_ptr& operator=(const unique_ptr&) = delete;
                  ^
In file included from input_line_9:15:
/home/dilks/j/dispin/deps/brufit/core/Binner.h:27:7: warning: explicitly defaulted copy constructor is implicitly deleted [-Wdefaulted-function-deleted]
      Binner(const Binner&)=default;
      ^
/home/dilks/j/dispin/deps/brufit/core/Binner.h:74:12: note: copy constructor of 'Binner' is implicitly deleted because field 'fBins' has multiple copy constructors
      Bins fBins;
           ^

A common solution seems to be changing default to delete

c-dilks commented 2 years ago

Looks like this is resolved on master