public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55986] New: RHS of logical operators may render LHS unevaluated in constant-expression
@ 2013-01-15  4:41 potswa at mac dot com
  2013-01-15  4:48 ` [Bug c++/55986] " potswa at mac dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: potswa at mac dot com @ 2013-01-15  4:41 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55986
           Summary: RHS of logical operators may render LHS unevaluated in
                    constant-expression
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: potswa@mac.com


This compiles without incident, despite using a non-constant object in a
constant-expression:

int i;
static_assert( i || true, "" );
static_assert( ! ( i && false ), "" );

It appears to be assuming that || and && are commutative, but short-circuiting
only works in one direction.


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

end of thread, other threads:[~2021-07-28  4:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-15  4:41 [Bug c++/55986] New: RHS of logical operators may render LHS unevaluated in constant-expression potswa at mac dot com
2013-01-15  4:48 ` [Bug c++/55986] " potswa at mac dot com
2013-01-15  4:49 ` potswa at mac dot com
2013-01-15  8:03 ` potswa at mac dot com
2015-07-29 18:57 ` yaghmour.shafik at gmail dot com
2015-10-21 15:28 ` yaghmour.shafik at gmail dot com
2021-07-28  4:07 ` pinskia 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).