id summary reporter owner description type status milestone component version severity resolution keywords cc 11673 locale: Invalid static_cast Ben Wiederhake Artyom Beilis "When trying to compile certain versions of boost (see below which versions), I see the following compilation error when using gcc-5.2: `libs/locale/src/shared/message.cpp:438:64: error: invalid static_cast from type 'const wchar_t*' to type 'const char*'` This is the relevant code: {{{ template ... CharType const *p = ...; CharType const *e = ...; ... state = pj_winberger_hash::update_state(state, static_cast(p), static_cast(e)); }}} In essence, the code tries to *re-interpret* the argument as a sequence of chars and feeds it into the `update_state` function of some kind of hash. I don't understand all the details, but I'm pretty sure this is not a `static_cast` anymore and the compilation error is valid. I can see the following options to resolve the issue: - Declare any template instantiations with non-char `CharType` as illegal. I view this as a very bad if not insane idea. - Change it from `static_cast` to `reinterpret_cast` because that's precisely what is needed here. I view this as a good idea. This issue is visible in branch master of boostorg/boost. This issue seems to have been visible since the commit 8f94dbbf3563381ebf1f8db96e16692f8e351db9 (""Inline namespace test version."") in boostorg/type_traits, introduced by commit 9eae98d8714f8cb4114e799bbb4e10f45919dda4 (""Update type_traits from master"") in boostorg/boost. " Bugs closed Boost 1.60.0 locale Boost 1.59.0 Problem fixed