public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67980] New: left shift count is negative [-Wshift-count-negative] generated for unreachable code
@ 2015-10-15 20:25 nacitar at ubercpp dot com
  2015-10-15 20:26 ` [Bug c++/67980] " nacitar at ubercpp dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: nacitar at ubercpp dot com @ 2015-10-15 20:25 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67980
           Summary: left shift count is negative [-Wshift-count-negative]
                    generated for unreachable code
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nacitar at ubercpp dot com
  Target Milestone: ---

Created attachment 36519
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36519&action=edit
test driver

With -Wall, unreachable code in a constexpr function generates a warning if
written using c++14's expanded constexpr and using actual if statements,
however does not in the case of a ternary-styled c++11 constexpr function.

This can be worked around using template specializations, but certainly this
error shouldn't happen given that these values are all known at compilation
time and it's impossible for that count to ever actually be negative.

This is a simplification of the problem from a larger issue.


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

* [Bug c++/67980] left shift count is negative [-Wshift-count-negative] generated for unreachable code
  2015-10-15 20:25 [Bug c++/67980] New: left shift count is negative [-Wshift-count-negative] generated for unreachable code nacitar at ubercpp dot com
@ 2015-10-15 20:26 ` nacitar at ubercpp dot com
  2015-10-15 20:32 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: nacitar at ubercpp dot com @ 2015-10-15 20:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jacob McIntosh <nacitar at ubercpp dot com> ---
> but certainly this error shouldn't happen

By error, I meant "warning".


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

* [Bug c++/67980] left shift count is negative [-Wshift-count-negative] generated for unreachable code
  2015-10-15 20:25 [Bug c++/67980] New: left shift count is negative [-Wshift-count-negative] generated for unreachable code nacitar at ubercpp dot com
  2015-10-15 20:26 ` [Bug c++/67980] " nacitar at ubercpp dot com
@ 2015-10-15 20:32 ` pinskia at gcc dot gnu.org
  2015-10-15 20:43 ` nacitar at ubercpp dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-10-15 20:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
There is another bug about this specific issue.


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

* [Bug c++/67980] left shift count is negative [-Wshift-count-negative] generated for unreachable code
  2015-10-15 20:25 [Bug c++/67980] New: left shift count is negative [-Wshift-count-negative] generated for unreachable code nacitar at ubercpp dot com
  2015-10-15 20:26 ` [Bug c++/67980] " nacitar at ubercpp dot com
  2015-10-15 20:32 ` pinskia at gcc dot gnu.org
@ 2015-10-15 20:43 ` nacitar at ubercpp dot com
  2015-10-16  7:40 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: nacitar at ubercpp dot com @ 2015-10-15 20:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jacob McIntosh <nacitar at ubercpp dot com> ---
(In reply to Andrew Pinski from comment #2)
> There is another bug about this specific issue.

Which?


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

* [Bug c++/67980] left shift count is negative [-Wshift-count-negative] generated for unreachable code
  2015-10-15 20:25 [Bug c++/67980] New: left shift count is negative [-Wshift-count-negative] generated for unreachable code nacitar at ubercpp dot com
                   ` (2 preceding siblings ...)
  2015-10-15 20:43 ` nacitar at ubercpp dot com
@ 2015-10-16  7:40 ` rguenth at gcc dot gnu.org
  2015-10-20 15:58 ` paolo.carlini at oracle dot com
  2015-10-20 17:01 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-10-16  7:40 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-10-16
     Ever confirmed|0                           |1

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.


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

* [Bug c++/67980] left shift count is negative [-Wshift-count-negative] generated for unreachable code
  2015-10-15 20:25 [Bug c++/67980] New: left shift count is negative [-Wshift-count-negative] generated for unreachable code nacitar at ubercpp dot com
                   ` (3 preceding siblings ...)
  2015-10-16  7:40 ` rguenth at gcc dot gnu.org
@ 2015-10-20 15:58 ` paolo.carlini at oracle dot com
  2015-10-20 17:01 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-10-20 15:58 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |paolo.carlini at oracle dot com


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

* [Bug c++/67980] left shift count is negative [-Wshift-count-negative] generated for unreachable code
  2015-10-15 20:25 [Bug c++/67980] New: left shift count is negative [-Wshift-count-negative] generated for unreachable code nacitar at ubercpp dot com
                   ` (4 preceding siblings ...)
  2015-10-20 15:58 ` paolo.carlini at oracle dot com
@ 2015-10-20 17:01 ` paolo.carlini at oracle dot com
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-10-20 17:01 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
           Assignee|paolo.carlini at oracle dot com    |unassigned at gcc dot gnu.org


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

end of thread, other threads:[~2015-10-20 17:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-15 20:25 [Bug c++/67980] New: left shift count is negative [-Wshift-count-negative] generated for unreachable code nacitar at ubercpp dot com
2015-10-15 20:26 ` [Bug c++/67980] " nacitar at ubercpp dot com
2015-10-15 20:32 ` pinskia at gcc dot gnu.org
2015-10-15 20:43 ` nacitar at ubercpp dot com
2015-10-16  7:40 ` rguenth at gcc dot gnu.org
2015-10-20 15:58 ` paolo.carlini at oracle dot com
2015-10-20 17:01 ` paolo.carlini at oracle dot com

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).