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

            Bug ID: 61302
           Summary: When returning nullptr in a comma operator, side
                    effects are lost.
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fox at ucw dot cz

Consider the following code:

  #include <stdio.h>

  void* test(void) {
    return printf("Hello world.\n"), nullptr;
  }

  int main(void) {
    return test() ? 0 : 1;
  }

When compiled with g++-4.7.3, no "Hello world.\n" is printed.
The g++-4.8.1 works fine.

I though this would be connected to #52988, but it is not,
the attachment 27157 of #52988 works fine in g++-4.7.3.

Reply via email to