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

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
A testcase:

#define SWAP(x, y) \
  tmp = x; \
  x = y; \
  y = tmp

int x, y, tmp;

void
fn1 (void)
{
  if (x)
    SWAP(x, y); // warn
}

void
fn2 (void)
{
  SWAP(x, y);
}

void
fn3 (void)
{
  if (x)
    {
      SWAP(x, y);
    }
}

void
fn4 (void)
{
  if (x)
    x = 10;
  else
    SWAP(x, y); // warn
}

Reply via email to