mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-02 20:32:49 +00:00
Fix by @dixlorenz for clang warnings "'return' will never be executed" (#96)
This commit is contained in:
parent
45d70b71ec
commit
37ad436068
@ -66,8 +66,10 @@ using fmt::internal::Arg;
|
||||
#ifndef FMT_THROW
|
||||
# if FMT_EXCEPTIONS
|
||||
# define FMT_THROW(x) throw x
|
||||
# define FMT_RETURN_AFTER_THROW(x)
|
||||
# else
|
||||
# define FMT_THROW(x) assert(false)
|
||||
# define FMT_RETURN_AFTER_THROW(x) return x
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@ -251,7 +253,7 @@ class WidthHandler : public fmt::internal::ArgVisitor<WidthHandler, unsigned> {
|
||||
|
||||
unsigned visit_unhandled_arg() {
|
||||
FMT_THROW(fmt::FormatError("width is not integer"));
|
||||
return 0;
|
||||
FMT_RETURN_AFTER_THROW(0);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@ -273,7 +275,7 @@ class PrecisionHandler :
|
||||
public:
|
||||
unsigned visit_unhandled_arg() {
|
||||
FMT_THROW(fmt::FormatError("precision is not integer"));
|
||||
return 0;
|
||||
FMT_RETURN_AFTER_THROW(0);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
Loading…
Reference in New Issue
Block a user