Discussion:
[Bug build/23099] New: remove "class integer_for_size" from common/enum-flags.h
tromey at sourceware dot org
2018-04-20 15:12:57 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23099

Bug ID: 23099
Summary: remove "class integer_for_size" from
common/enum-flags.h
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: build
Assignee: unassigned at sourceware dot org
Reporter: tromey at sourceware dot org
Target Milestone: ---

common/enum-flags.h says:

/* Until we can rely on std::underlying type being universally
available (C++11), roll our own for enums. */
template<int size, bool sign> class integer_for_size { typedef void type; };


I think this time has come now.
--
You are receiving this mail because:
You are on the CC list for the bug.
palves at redhat dot com
2018-04-23 09:58:15 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=23099

Pedro Alves <palves at redhat dot com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |palves at redhat dot com

--- Comment #1 from Pedro Alves <palves at redhat dot com> ---
I've tried that, and even included it as a patch in this series:

https://sourceware.org/ml/gdb-patches/2016-11/msg00079.html

but after posting that I found a few problems more and realized that
std::underlying_type isn't exactly correct here.

The current state of that series is here:

https://github.com/palves/gdb/tree/palves/cxx11-enum-flags

unfortunately, this comment isn't helping me remember exactly what it was:

https://github.com/palves/gdb/commit/6d4551746c118517acb09468e9771f744a4624c4#diff-5711dbecc4755695c17cf0b199c9df7bR76

but I'm under the impression that the new unit tests exposed it. ISTR that
it's something around sign, where the underlying type can be unsigned, while
native enums decay to signed. Or something like that.
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...