<div dir="ltr">Hey Ben - if you're still involved with this part of the project - could you check that this change (to code you committed back in 2014, r215810) is correct & add a test case if possible?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 7, 2019 at 10:39 AM Reid Kleckner via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Reid Kleckner<br>
Date: 2019-11-07T10:39:29-08:00<br>
New Revision: dd870f6929ee0b1dfb5fd000c7b826a1bd2d2571<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/dd870f6929ee0b1dfb5fd000c7b826a1bd2d2571" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/dd870f6929ee0b1dfb5fd000c7b826a1bd2d2571</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/dd870f6929ee0b1dfb5fd000c7b826a1bd2d2571.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/dd870f6929ee0b1dfb5fd000c7b826a1bd2d2571.diff</a><br>
<br>
LOG: Fix warning about unused std::unique result, erase shifted elements<br>
<br>
This is actually a functional change. I haven't added any new test<br>
coverage. I'm just trying to fix the warning and hoping for the best.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    clang/include/clang/Serialization/ContinuousRangeMap.h<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/clang/include/clang/Serialization/ContinuousRangeMap.h b/clang/include/clang/Serialization/ContinuousRangeMap.h<br>
index 0c05537dd108..c2665c097416 100644<br>
--- a/clang/include/clang/Serialization/ContinuousRangeMap.h<br>
+++ b/clang/include/clang/Serialization/ContinuousRangeMap.h<br>
@@ -118,14 +118,17 @@ class ContinuousRangeMap {<br>
<br>
     ~Builder() {<br>
       llvm::sort(Self.Rep, Compare());<br>
-      std::unique(Self.Rep.begin(), Self.Rep.end(),<br>
-                  [](const_reference A, const_reference B) {<br>
-        // FIXME: we should not allow any duplicate keys, but there are a lot of<br>
-        // duplicate 0 -> 0 mappings to remove first.<br>
-        assert((A == B || A.first != B.first) &&<br>
-               "ContinuousRangeMap::Builder given non-unique keys");<br>
-        return A == B;<br>
-      });<br>
+      Self.Rep.erase(<br>
+          std::unique(<br>
+              Self.Rep.begin(), Self.Rep.end(),<br>
+              [](const_reference A, const_reference B) {<br>
+                // FIXME: we should not allow any duplicate keys, but there are<br>
+                // a lot of duplicate 0 -> 0 mappings to remove first.<br>
+                assert((A == B || A.first != B.first) &&<br>
+                       "ContinuousRangeMap::Builder given non-unique keys");<br>
+                return A == B;<br>
+              }),<br>
+          Self.Rep.end());<br>
     }<br>
<br>
     void insert(const value_type &Val) {<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>