On Mon, Mar 02, 2020 at 08:57:46AM -0500, Tom Callaway wrote:
Wait, I know that $TOPIC is scary, come back.
Chromium has this chunk of code (in
third_party/angle/src/common/PackedEnums.h):
// 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;
This code built with gcc9, but with gcc10 it no longer works.
Is it now rejected with some error (which)?
Generally, such code snippets aren't really very useful because they lack
context, so what we really need is full preprocessed sources + g++ command
line options used to reproduce it, if gcc9 built and gcc10 doesn't, best
preprocessed sources from both gcc 9 and gcc 10, so that we can find out if
it is a header change or compiler change that matters.
Jakub