public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/52958] New: Missing warning on missed parehthesis
@ 2012-04-12 22:05 xinliangli at gmail dot com
  2012-04-12 23:17 ` [Bug c/52958] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: xinliangli at gmail dot com @ 2012-04-12 22:05 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52958
           Summary: Missing warning on missed parehthesis
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: xinliangli@gmail.com


int test(bool b, int x, int y) {
  return 42 + b ? x : y;
 }

/*

parentheses4.cpp:2:17: warning: operator '?:' has lower precedence than
'+'; '+' will be evaluated first [-Wparentheses]
 return 42 + b ? x : y;
        ~~~~~~ ^
parentheses4.cpp:2:17: note: place parentheses around the '+' expression
to silence this warning
 return 42 + b ? x : y;
               ^
        (     )
parentheses4.cpp:2:17: note: place parentheses around the '?:' expression
to evaluate it first
 return 42 + b ? x : y;
               ^
             (        )
1 warning generated.

*/


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

* [Bug c/52958] Missing warning on missed parehthesis
  2012-04-12 22:05 [Bug c++/52958] New: Missing warning on missed parehthesis xinliangli at gmail dot com
@ 2012-04-12 23:17 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-04-12 23:17 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |diagnostic
   Last reconfirmed|                            |2012-04-12
          Component|c++                         |c
     Ever Confirmed|0                           |1
           Severity|normal                      |enhancement

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-04-12 23:16:51 UTC ---
Confirmed, I thought I saw a bug about this before but I cannot find it.


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

end of thread, other threads:[~2012-04-12 23:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-12 22:05 [Bug c++/52958] New: Missing warning on missed parehthesis xinliangli at gmail dot com
2012-04-12 23:17 ` [Bug c/52958] " 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).