[LLVMbugs] [Bug 14191] New: Comma sub-expr in do-while loop conditional not evaluated

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Oct 26 15:44:48 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=14191

             Bug #: 14191
           Summary: Comma sub-expr in do-while loop conditional not
                    evaluated
           Product: clang
           Version: 3.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: timothy003 at msn.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


The first sub-expression of a comma operator in a do-while conditional is not
evaluated.

Compile the following C++ program:

#include <iostream>

int main()
{
    int i = 0;
    do
        ;
    while (i = 1, false);
    std::cout << i << std::endl;
}

The program output '0'.

The program should output '1'.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list