public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/60333] New: type_traits make_signed, make_unsigned missing support for long long enumerations
@ 2014-02-24 21:52 harald at gigawatt dot nl
  2014-09-19 11:14 ` [Bug libstdc++/60333] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: harald at gigawatt dot nl @ 2014-02-24 21:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60333
           Summary: type_traits make_signed, make_unsigned missing support
                    for long long enumerations
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: harald at gigawatt dot nl

#include <type_traits>
enum E { e = 0x100000000 };
static_assert(sizeof(std::make_signed<E>::type) == sizeof(E), "");
static_assert(sizeof(std::make_unsigned<E>::type) == sizeof(E), "");

This fails on x86, because make_signed and make_unsigned never return a larger
type than (un)signed long.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/60333] type_traits make_signed, make_unsigned missing support for long long enumerations
  2014-02-24 21:52 [Bug libstdc++/60333] New: type_traits make_signed, make_unsigned missing support for long long enumerations harald at gigawatt dot nl
@ 2014-09-19 11:14 ` redi at gcc dot gnu.org
  2015-04-08 16:01 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2014-09-19 11:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60333

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-09-19
     Ever confirmed|0                           |1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/60333] type_traits make_signed, make_unsigned missing support for long long enumerations
  2014-02-24 21:52 [Bug libstdc++/60333] New: type_traits make_signed, make_unsigned missing support for long long enumerations harald at gigawatt dot nl
  2014-09-19 11:14 ` [Bug libstdc++/60333] " redi at gcc dot gnu.org
@ 2015-04-08 16:01 ` redi at gcc dot gnu.org
  2015-04-28 13:22 ` redi at gcc dot gnu.org
  2015-04-28 13:28 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2015-04-08 16:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60333

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Created attachment 35262
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35262&action=edit
Fix make_signed / make_unsigned for enumeration types

This patch handles enumeration types larger than long and preserves
cv-qualifiers (which is currently not done).

I'll check this in after the 5.1 release.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/60333] type_traits make_signed, make_unsigned missing support for long long enumerations
  2014-02-24 21:52 [Bug libstdc++/60333] New: type_traits make_signed, make_unsigned missing support for long long enumerations harald at gigawatt dot nl
  2014-09-19 11:14 ` [Bug libstdc++/60333] " redi at gcc dot gnu.org
  2015-04-08 16:01 ` redi at gcc dot gnu.org
@ 2015-04-28 13:22 ` redi at gcc dot gnu.org
  2015-04-28 13:28 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2015-04-28 13:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60333

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Tue Apr 28 13:21:54 2015
New Revision: 222526

URL: https://gcc.gnu.org/viewcvs?rev=222526&root=gcc&view=rev
Log:
        PR libstdc++/60333
        * include/std/type_traits (__make_unsigned_selector<_Tp, false, true>):
        Handle enumeration types larger than sizeof(long).
        (__make_signed_selector<_Tp, false, true>): Find unsigned type then
        make it signed.
        * testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error.
        * testsuite/20_util/make_signed/requirements/typedefs_neg.cc:
        Likewise.
        * testsuite/20_util/make_signed/requirements/typedefs-3.cc: New.
        * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Adjust
        dg-error.
        * testsuite/20_util/make_unsigned/requirements/typedefs-3.cc: New.

Added:
    trunk/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-3.cc
   
trunk/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-3.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/std/type_traits
    trunk/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc
   
trunk/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
   
trunk/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/60333] type_traits make_signed, make_unsigned missing support for long long enumerations
  2014-02-24 21:52 [Bug libstdc++/60333] New: type_traits make_signed, make_unsigned missing support for long long enumerations harald at gigawatt dot nl
                   ` (2 preceding siblings ...)
  2015-04-28 13:22 ` redi at gcc dot gnu.org
@ 2015-04-28 13:28 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2015-04-28 13:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60333

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |6.0

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed on trunk


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-04-28 13:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-24 21:52 [Bug libstdc++/60333] New: type_traits make_signed, make_unsigned missing support for long long enumerations harald at gigawatt dot nl
2014-09-19 11:14 ` [Bug libstdc++/60333] " redi at gcc dot gnu.org
2015-04-08 16:01 ` redi at gcc dot gnu.org
2015-04-28 13:22 ` redi at gcc dot gnu.org
2015-04-28 13:28 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).