public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95344] New: Wparentheses (assignment used as truth value) on parenthesized ternary conditional E2
@ 2020-05-26 19:33 ed at catmur dot uk
  2020-05-26 22:06 ` [Bug c++/95344] " mpolacek at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: ed at catmur dot uk @ 2020-05-26 19:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95344
           Summary: Wparentheses (assignment used as truth value) on
                    parenthesized ternary conditional E2
           Product: gcc
           Version: 9.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ed at catmur dot uk
  Target Milestone: ---

void f(int i) {
    bool b = false;
    if (i == 99 ? (b = true) : false)
        ;
}

warning: suggest parentheses around assignment used as truth value
[-Wparentheses]
    3 |     if (i == 99 ? (b = true) : false)
      |                  ~~~^~~~~~~

Per Godbolt, issue exists from 9.1 through current trunk (11.0).

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

end of thread, other threads:[~2020-06-11 22:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-26 19:33 [Bug c++/95344] New: Wparentheses (assignment used as truth value) on parenthesized ternary conditional E2 ed at catmur dot uk
2020-05-26 22:06 ` [Bug c++/95344] " mpolacek at gcc dot gnu.org
2020-05-26 23:09 ` mpolacek at gcc dot gnu.org
2020-05-26 23:10 ` [Bug c++/95344] [9/10/11 Regression] " mpolacek at gcc dot gnu.org
2020-05-27  1:19 ` mpolacek at gcc dot gnu.org
2020-05-27  7:39 ` rguenth at gcc dot gnu.org
2020-05-29 16:32 ` cvs-commit at gcc dot gnu.org
2020-05-29 16:32 ` [Bug c++/95344] [9/10 " mpolacek at gcc dot gnu.org
2020-06-11 20:28 ` cvs-commit at gcc dot gnu.org
2020-06-11 22:38 ` [Bug c++/95344] [9 " cvs-commit at gcc dot gnu.org
2020-06-11 22:39 ` mpolacek 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).