From: Stephen Hines <srhines@google.com>
Date: Tue, 15 Aug 2017 21:20:41 +0000 (+0000)
Subject: Switch to consumeError(), since this can crash otherwise.
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=855f79aa6daf4b31d8ed45f523ec29301e22fe28;p=clang

Switch to consumeError(), since this can crash otherwise.

Summary:
If assertions are disabled, but LLVM_ABI_BREAKING_CHANGES is enabled,
this will cause an issue with an unchecked Success. Switching to
consumeError() is the correct way to bypass the check.

Reviewers: llvm-commits, cfe-commits, arphaman

Reviewed By: arphaman

Subscribers: arphaman, klimek, pirama

Differential Revision: https://reviews.llvm.org/D36728

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310958 91177308-0d34-0410-b5e6-96231b3b80d8
---

diff --git a/lib/Tooling/Core/Replacement.cpp b/lib/Tooling/Core/Replacement.cpp
index e194b59a6e..6d4f3a3401 100644
--- a/lib/Tooling/Core/Replacement.cpp
+++ b/lib/Tooling/Core/Replacement.cpp
@@ -503,7 +503,7 @@ calculateRangesAfterReplacements(const Replacements &Replaces,
                                             std::string(R.getLength(), ' ')));
     assert(!Err &&
            "Replacements must not conflict since ranges have been merged.");
-    (void)Err;
+    llvm::consumeError(std::move(Err));
   }
   return FakeReplaces.merge(Replaces).getAffectedRanges();
 }