diff --git a/doc/changelog.dox b/doc/changelog.dox index 1f1a18e38..4e3c31611 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -311,6 +311,14 @@ See also: @subsection changelog-latest-bugfixes Bug fixes +- MSVC 15.8 (released on Aug 14, 2018) has a regression causing the compiler + to crash with an ICE (C1001) on @ref Math::Color4 constructors that have a + default alpha parameter. This is only only when the `/permissive-` flag is + specified (which is done by default for projects created directly using + Visual Studio but not for projects using CMake). This has been worked + around, but can't be guaranteed it was the only case. In case you're + experiencing a similar issue somewhere else, please try to disable the + `/permissive-` flag first. - An assert was firing during @ref Platform::GlfwApplication initialization due to a pointer not being properly initialized after the @ref Platform::GlfwApplication::GLConfiguration "GLConfiguration" rework in diff --git a/src/Magnum/Math/Color.h b/src/Magnum/Math/Color.h index ec48c51ed..e945c44f9 100644 --- a/src/Magnum/Math/Color.h +++ b/src/Magnum/Math/Color.h @@ -197,12 +197,26 @@ template inline Vector3::FloatingPointType> toXyz(ty } /* Value for full channel (1.0f for floats, 255 for unsigned byte) */ +#if !defined(CORRADE_MSVC2017_COMPATIBILITY) || defined(CORRADE_MSVC2015_COMPATIBILITY) +/* MSVC 2017 since 15.8 crashes with the following at a constructor line that + calls this function via a default parameter. This happens only when the + /permissive- (yes, there's a dash at the end) flag is specified, which is + projects created directly using VS (enabled by default since 15.5) but not + projects using CMake. Not using SFINAE in this case makes it work. Minimal + repro case here: https://twitter.com/czmosra/status/1038610648568147968 */ template constexpr typename std::enable_if::value, T>::type fullChannel() { return T(1); } template constexpr typename std::enable_if::value, T>::type fullChannel() { return Implementation::bitMax(); } +#else +template constexpr T fullChannel() { return bitMax(); } +/** @todo half */ +template<> constexpr float fullChannel() { return 1.0f; } +template<> constexpr double fullChannel() { return 1.0; } +template<> constexpr long double fullChannel() { return 1.0l; } +#endif }