Commit f031f7c8 by Pierre-Marc Berube Committed by Commit Bot

Fix a GCC 10 build failure.

Build failed on GCC10 with C++17. An #ifdef was added to support both C++17 and C++14 Bug: angleproject:4390 Change-Id: I397513a8ebad4a55635ba863c47edc658e405729 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2063545 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 46cb0f62
......@@ -83,10 +83,14 @@ class PackedEnumMap
// We use a for loop instead of range-for to work around a limitation in MSVC.
for (const InitPair *it = init.begin(); it != init.end(); ++it)
{
#if (__cplusplus < 201703L)
// This horrible const_cast pattern is necessary to work around a constexpr limitation.
// See https://stackoverflow.com/q/34199774/ . Note that it should be fixed with C++17.
const_cast<T &>(const_cast<const Storage &>(
mPrivateData)[static_cast<UnderlyingType>(it->first)]) = it->second;
#else
mPrivateData[static_cast<UnderlyingType>(it->first)] = it->second;
#endif
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment