public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/52957] New: Missing suggestions on '=' and '==' confusion
@ 2012-04-12 22:03 xinliangli at gmail dot com
  2012-04-12 22:54 ` [Bug c++/52957] " pinskia at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: xinliangli at gmail dot com @ 2012-04-12 22:03 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52957
           Summary: Missing suggestions on '=' and '==' confusion
    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


void foo();
 void bar();
 void test(int i) {
  // ...
 if (i = 42) foo();
  else bar();
 }

 /*

 parentheses1.cpp:5:9: warning: using the result of an assignment as a
condition without parentheses [-Wparentheses]
 if (i = 42) foo();
     ~~^~~~
parentheses1.cpp:5:9: note: place parentheses around the assignment to
silence this warning
 if (i = 42) foo();
       ^
     (     )
parentheses1.cpp:5:9: note: use '==' to turn this assignment into an
equality comparison
 if (i = 42) foo();
       ^
       ==
1 warning generated.

*/


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

end of thread, other threads:[~2012-04-15  4:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-12 22:03 [Bug c++/52957] New: Missing suggestions on '=' and '==' confusion xinliangli at gmail dot com
2012-04-12 22:54 ` [Bug c++/52957] " pinskia at gcc dot gnu.org
2012-04-12 23:00 ` pinskia at gcc dot gnu.org
2012-04-12 23:08 ` manu at gcc dot gnu.org
2012-04-12 23:29 ` xinliangli at gmail dot com
2012-04-13  1:03 ` manu at gcc dot gnu.org
2012-04-13  5:02 ` xinliangli at gmail dot com
2012-04-14 12:10 ` manu at gcc dot gnu.org
2012-04-14 12:25 ` redi at gcc dot gnu.org
2012-04-14 12:43 ` manu at gcc dot gnu.org
2012-04-14 13:16 ` redi at gcc dot gnu.org
2012-04-15  4:10 ` xinliangli at gmail 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).