From 9c8798b592270b2000cb5832d2e1de4a50fb2190 Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Thu, 22 Jan 2015 20:27:34 +0000 Subject: [PATCH] cppformat: Remove support for CUSTOM types. These cause a lot of type-safety trouble - unsupported types passed into fmt::sprintf (like CStr or enums) will be accepted at compile time, but trigger an exception at runtime. Remove them, so we'll get either an implicit conversion to a supported type, or a compile-time error. This was SVN commit r16179. --- source/third_party/cppformat/format.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/third_party/cppformat/format.h b/source/third_party/cppformat/format.h index 5a139acc48..5e9fa96627 100644 --- a/source/third_party/cppformat/format.h +++ b/source/third_party/cppformat/format.h @@ -706,12 +706,17 @@ public: MakeArg(void *value) { type = POINTER; pointer_value = value; } MakeArg(const void *value) { type = POINTER; pointer_value = value; } +#if 0 + // WFG: Removed this because otherwise you can pass a CStr8 or an enum etc + // into fmt::sprintf, and it will be interpreted as a CUSTOM type and then + // will throw an exception at runtime, which is terrible behaviour. template MakeArg(const T &value) { type = CUSTOM; custom.value = &value; custom.format = &format_custom_arg; } +#endif }; #define FMT_DISPATCH(call) static_cast(this)->call