forked from OSchip/llvm-project
Make compare function in r342648 have strict weak ordering.
Comparison functions used in sorting algorithms need to have strict weak ordering. Remove the assert and allow comparisons on all lists. llvm-svn: 342774
This commit is contained in:
parent
eabc582b62
commit
5061e83295
|
@ -7607,8 +7607,15 @@ public:
|
|||
SI->getAssociatedDeclaration())
|
||||
break;
|
||||
}
|
||||
assert(CI != CE && SI != SE &&
|
||||
"Unexpected end of the map components.");
|
||||
|
||||
// Lists contain the same elements.
|
||||
if (CI == CE && SI == SE)
|
||||
return false;
|
||||
|
||||
// List with less elements is less than list with more elements.
|
||||
if (CI == CE || SI == SE)
|
||||
return CI == CE;
|
||||
|
||||
const auto *FD1 = cast<FieldDecl>(CI->getAssociatedDeclaration());
|
||||
const auto *FD2 = cast<FieldDecl>(SI->getAssociatedDeclaration());
|
||||
if (FD1->getParent() == FD2->getParent())
|
||||
|
|
Loading…
Reference in New Issue