Skip to content

Commit

Permalink
Replace "throw ()" with noexcept.
Browse files Browse the repository at this point in the history
Generated by clang-tidy modernize-use-noexcept
  • Loading branch information
chenshuo committed Oct 23, 2018
1 parent a9a7274 commit 52f2345
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# Only run a few checks for now.
Checks: 'modernize-use-equals-default'
Checks: 'modernize-use-noexcept'
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
Expand Down
6 changes: 3 additions & 3 deletions muduo/base/Exception.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ Exception::Exception(const string& msg)
fillStackTrace();
}

Exception::~Exception() throw () = default;
Exception::~Exception() noexcept = default;

const char* Exception::what() const throw()
const char* Exception::what() const noexcept
{
return message_.c_str();
}

const char* Exception::stackTrace() const throw()
const char* Exception::stackTrace() const noexcept
{
return stack_.c_str();
}
Expand Down
6 changes: 3 additions & 3 deletions muduo/base/Exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class Exception : public std::exception
public:
explicit Exception(const char* what);
explicit Exception(const string& what);
~Exception() throw() override;
const char* what() const throw() override;
const char* stackTrace() const throw();
~Exception() noexcept override;
const char* what() const noexcept override;
const char* stackTrace() const noexcept;

private:
void fillStackTrace();
Expand Down
2 changes: 1 addition & 1 deletion muduo/base/Mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ extern void __assert_perror_fail (int errnum,
const char *file,
unsigned int line,
const char *function)
__THROW __attribute__ ((__noreturn__));
noexcept __attribute__ ((__noreturn__));
__END_DECLS
#endif

Expand Down

0 comments on commit 52f2345

Please sign in to comment.