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

            Bug ID: 65866
           Summary: Wrong warning when using list-initialization:
                    operation on 'b' may be undefined [-Wsequence-point]
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: o_kniemeyer at maxon dot net

This is related to Bug 51253: While that bug was about wrong compiled code and
is reported to be fixed, GCC 5.1.0 still produces a warning in code like

struct X
{
  template <typename... ARGS> X(ARGS&&...);
};

void test()
{
  bool b = false;
  X{b = true, b = true};
}

warning: operation on 'b' may be undefined [-Wsequence-point]

Because list-initialization has to be done from left to right, the warning is
wrong.

Reply via email to