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