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

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