[LLVMbugs] [Bug 21706] New: -Wunsequenced should warn on v[i++] = i++

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Dec 1 21:52:07 PST 2014


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

            Bug ID: 21706
           Summary: -Wunsequenced should warn on v[i++] = i++
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: seth.cantrell at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

#include <iostream> 
#include <vector> 

int main() { 
    std::vector<int> v = { 0, 0 };
    int i = 0;
    v[i++] = i++;
    std::cout << v[0] << v[1] << '\n';
}

Compiling the above program with -Weverything does not output any diagnostic
pointing out the unsequenced operations.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141202/47cbf210/attachment.html>


More information about the llvm-bugs mailing list