facebookincubator / gloo

Collective communications library with various primitives for multi-machine training.
Other
1.23k stars 303 forks source link

Delete default error constructors #351

Closed malfet closed 1 year ago

malfet commented 1 year ago

As they should have been deleted, since std::runtime_error does not provide a default constructor.

Fixes following compilation warnings:

/Users/malfet/git/pytorch/pytorch/third_party/gloo/gloo/common/error.h:25:3: warning: explicitly defaulted default constructor is implicitly deleted [-Wdefaulted-function-deleted]
  Exception() = default;
  ^
/Users/malfet/git/pytorch/pytorch/third_party/gloo/gloo/common/error.h:24:20: note: default constructor of 'Exception' is implicitly deleted because base class 'std::runtime_error' has no default constructor
struct Exception : public std::runtime_error {
                   ^
/Users/malfet/git/pytorch/pytorch/third_party/gloo/gloo/common/error.h:35:3: warning: explicitly defaulted default constructor is implicitly deleted [-Wdefaulted-function-deleted]
  InvalidOperationException() = default;
  ^
/Users/malfet/git/pytorch/pytorch/third_party/gloo/gloo/common/error.h:34:36: note: default constructor of 'InvalidOperationException' is implicitly deleted because base class '::gloo::Exception' has a deleted default constructor
struct InvalidOperationException : public ::gloo::Exception {
                                   ^
/Users/malfet/git/pytorch/pytorch/third_party/gloo/gloo/common/error.h:25:3: note: explicitly defaulted function was implicitly deleted here
  Exception() = default;
  ^
/Users/malfet/git/pytorch/pytorch/third_party/gloo/gloo/common/error.h:24:20: note: default constructor of 'Exception' is implicitly deleted because base class 'std::runtime_error' has no default constructor
struct Exception : public std::runtime_error {
                   ^
/Users/malfet/git/pytorch/pytorch/third_party/gloo/gloo/common/error.h:46:3: warning: explicitly defaulted default constructor is implicitly deleted [-Wdefaulted-function-deleted]
  IoException() = default;
  ^
/Users/malfet/git/pytorch/pytorch/third_party/gloo/gloo/common/error.h:45:22: note: default constructor of 'IoException' is implicitly deleted because base class '::gloo::Exception' has a deleted default constructor
struct IoException : public ::gloo::Exception {
                     ^
/Users/malfet/git/pytorch/pytorch/third_party/gloo/gloo/common/error.h:25:3: note: explicitly defaulted function was implicitly deleted here
  Exception() = default;
  ^
/Users/malfet/git/pytorch/pytorch/third_party/gloo/gloo/common/error.h:24:20: note: default constructor of 'Exception' is implicitly deleted because base class 'std::runtime_error' has no default constructor
struct Exception : public std::runtime_error {
                   ^
3 warnings generated.
facebook-github-bot commented 1 year ago

@malfet has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot commented 1 year ago

@malfet merged this pull request in facebookincubator/gloo@56b221c0a811491d2dc2a3254b468ad687bbdaab.