[Bug c++/51242] [C++11] Unable to use strongly typed enums as bit fields

paolo.carlini at oracle dot com gcc-bugzilla@gcc.gnu.org
Mon Nov 26 11:37:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51242

--- Comment #10 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-11-26 11:36:56 UTC ---
For example, consider this variant of the PR53661 situation:

enum class Code {
  SUCCESS = 0
};

Code a;

short r[] = {a};

we currently produce a -Wnarrowing warning, which seems bogus to me, exactly
because we don't realize that actually the only enumerator has value zero.



More information about the Gcc-bugs mailing list