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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to