[LLVMbugs] [Bug 7189] New: Miscompilation of Qt foreach macro

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 21 08:59:15 PDT 2010


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

           Summary: Miscompilation of Qt foreach macro
           Product: clang
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ogoffart at kde.org
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=4921)
 --> (http://llvm.org/bugs/attachment.cgi?id=4921)
preprocessed

clang miscompile the qt foreach macro.
Only the first iteration is executed.

#include <QtCore/qglobal.h>
#include <iostream>
#include <vector>

int main()
{
    std::vector<int> v(3);
    v[0] = 0; v[1] = 1; v[2] = 2;

    foreach(int i, v)
        std::cout << i << std::endl;
}


Maybe because of the use of the statements in expressions extension of gcc.

This is the reason why uic produces bad result when compiling Qt.

-- 
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