[Bug c++/70792] Incorrect sequence point warning with uniform initializer syntax

lefticus at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Apr 25 23:34:00 GMT 2016


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

--- Comment #2 from Jason Turner <lefticus at gmail dot com> ---
Follow up, this is a better test case that does not pass by &&


struct MyType {
  MyType(int i, int j, int k, int l)
    : sum(i + j + k + l)
  {

  }

  int sum;
};

int main()
{
  int i = 0;
  std::cout << MyType{ ++i, ++i, ++i, ++i }.sum << '\n';
}


More information about the Gcc-bugs mailing list