[LLVMbugs] [Bug 21389] New: detect non-strick-weak-order where one is required
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sun Oct 26 22:17:20 PDT 2014
http://llvm.org/bugs/show_bug.cgi?id=21389
Bug ID: 21389
Summary: detect non-strick-weak-order where one is required
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Static Analyzer
Assignee: kremenek at apple.com
Reporter: nlewycky at google.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
The static analyzer should flag this sort of code:
std::nth_element(
id_map.begin(),
id_map.begin() + num_ids,
id_map.end(), [](const pair<Id, float> &lhs,
const pair<Id, float> &rhs) {
return lhs.second <= rhs.second;
});
because the lambda function may return true for a given pair of inputs, and
return true again if you switch lhs and rhs.
--
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/20141027/dfe88a63/attachment.html>
More information about the llvm-bugs
mailing list