mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-11 18:00:04 +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
|
#ifndef FMT_THROW
|
||||||
# if FMT_EXCEPTIONS
|
# if FMT_EXCEPTIONS
|
||||||
# define FMT_THROW(x) throw x
|
# define FMT_THROW(x) throw x
|
||||||
|
# define FMT_RETURN_AFTER_THROW(x)
|
||||||
# else
|
# else
|
||||||
# define FMT_THROW(x) assert(false)
|
# define FMT_THROW(x) assert(false)
|
||||||
|
# define FMT_RETURN_AFTER_THROW(x) return x
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -251,7 +253,7 @@ class WidthHandler : public fmt::internal::ArgVisitor<WidthHandler, unsigned> {
|
|||||||
|
|
||||||
unsigned visit_unhandled_arg() {
|
unsigned visit_unhandled_arg() {
|
||||||
FMT_THROW(fmt::FormatError("width is not integer"));
|
FMT_THROW(fmt::FormatError("width is not integer"));
|
||||||
return 0;
|
FMT_RETURN_AFTER_THROW(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
@ -273,7 +275,7 @@ class PrecisionHandler :
|
|||||||
public:
|
public:
|
||||||
unsigned visit_unhandled_arg() {
|
unsigned visit_unhandled_arg() {
|
||||||
FMT_THROW(fmt::FormatError("precision is not integer"));
|
FMT_THROW(fmt::FormatError("precision is not integer"));
|
||||||
return 0;
|
FMT_RETURN_AFTER_THROW(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
Loading…
Reference in New Issue
Block a user