[LLVMbugs] [Bug 15733] New: -Wunsequenced false positive for code involving lambdas

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 12 01:14:30 PDT 2013


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

            Bug ID: 15733
           Summary: -Wunsequenced false positive for code involving
                    lambdas
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: zeratul976 at hotmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

When compiling the following code with -Wall:


struct A
{
    A() {};

    template <typename T>
    int operator=(T) const;
};


struct B           
{
    B foo(int);
};

template <typename T>
void waldo()
{
    A a;
    B b;
    b.foo(a = []{}).foo(a = []{});
}


clang produces the following warning: 


test.cpp:20:13: warning: multiple unsequenced modifications to 'a'
[-Wunsequenced]
    b.foo(a = []{}).foo(a = []{});
            ^             ~


This is a false positive because the assignment operator that's supposedly
modifying 'a' is const, and thus does no such thing.

-- 
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/20130412/2b5c2582/attachment.html>


More information about the llvm-bugs mailing list