Remove unreachable code below FMT_THROW

(cherry picked from commit c8c9973669)
This commit is contained in:
Nils Moehrle
2016-07-19 20:33:55 +02:00
committed by Jonathan Müller
parent 6f27f98103
commit e3de93298b

View File

@ -237,7 +237,7 @@ typedef __int64 intmax_t;
# define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n) # define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n)
#endif #endif
// Some compilers masquerade as both MSVC and GCC-likes or // Some compilers masquerade as both MSVC and GCC-likes or
// otherwise support __builtin_clz and __builtin_clzll, so // otherwise support __builtin_clz and __builtin_clzll, so
// only define FMT_BUILTIN_CLZ using the MSVC intrinsics // only define FMT_BUILTIN_CLZ using the MSVC intrinsics
// if the clz and clzll builtins are not available. // if the clz and clzll builtins are not available.
@ -253,7 +253,7 @@ inline uint32_t clz(uint32_t x) {
assert(x != 0); assert(x != 0);
// Static analysis complains about using uninitialized data // Static analysis complains about using uninitialized data
// "r", but the only way that can happen is if "x" is 0, // "r", but the only way that can happen is if "x" is 0,
// which the callers guarantee to not happen. // which the callers guarantee to not happen.
# pragma warning(suppress: 6102) # pragma warning(suppress: 6102)
return 31 - r; return 31 - r;
@ -279,7 +279,7 @@ inline uint32_t clzll(uint64_t x) {
assert(x != 0); assert(x != 0);
// Static analysis complains about using uninitialized data // Static analysis complains about using uninitialized data
// "r", but the only way that can happen is if "x" is 0, // "r", but the only way that can happen is if "x" is 0,
// which the callers guarantee to not happen. // which the callers guarantee to not happen.
# pragma warning(suppress: 6102) # pragma warning(suppress: 6102)
return 63 - r; return 63 - r;
@ -1299,7 +1299,7 @@ public:
MakeArg() { MakeArg() {
type = Arg::NONE; type = Arg::NONE;
} }
template <typename T> template <typename T>
MakeArg(const T &value) MakeArg(const T &value)
: Arg(MakeValue<Formatter>(value)) { : Arg(MakeValue<Formatter>(value)) {
@ -2097,7 +2097,7 @@ struct ArgArray;
template <unsigned N> template <unsigned N>
struct ArgArray<N, true/*IsPacked*/> { struct ArgArray<N, true/*IsPacked*/> {
typedef Value Type[N > 0 ? N : 1]; typedef Value Type[N > 0 ? N : 1];
template <typename Formatter, typename T> template <typename Formatter, typename T>
static Value make(const T &value) { static Value make(const T &value) {
#ifdef __clang__ #ifdef __clang__
@ -2624,7 +2624,6 @@ void BasicWriter<Char>::write_str(
if (str_size == 0) { if (str_size == 0) {
if (!str_value) { if (!str_value) {
FMT_THROW(FormatError("string pointer is null")); FMT_THROW(FormatError("string pointer is null"));
return;
} }
} }
std::size_t precision = static_cast<std::size_t>(spec.precision_); std::size_t precision = static_cast<std::size_t>(spec.precision_);