summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clang-tidy
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2016-08-01 10:16:39 +0000
committerEric Liu <ioeric@google.com>2016-08-01 10:16:39 +0000
commit267034ca9c6a4987efe83fbd24a1dbb2cd2bbbe4 (patch)
treee916dba031f40103de8169853e4468126edd576c /clang-tools-extra/unittests/clang-tidy
parent40ef2fb363bcd89cb4a88157f5fa97a38d795a1f (diff)
downloadbcm5719-llvm-267034ca9c6a4987efe83fbd24a1dbb2cd2bbbe4.tar.gz
bcm5719-llvm-267034ca9c6a4987efe83fbd24a1dbb2cd2bbbe4.zip
Changes related to new implementation of tooling::Replacements as class.
Summary: See http://reviews.llvm.org/D21748 for details. Reviewers: djasper, klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D21749 llvm-svn: 277336
Diffstat (limited to 'clang-tools-extra/unittests/clang-tidy')
-rw-r--r--clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h b/clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h
index b9725469199..0e278f8bd78 100644
--- a/clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h
+++ b/clang-tools-extra/unittests/clang-tidy/ClangTidyTest.h
@@ -119,7 +119,14 @@ runCheckOnCode(StringRef Code, std::vector<ClangTidyError> *Errors = nullptr,
DiagConsumer.finish();
tooling::Replacements Fixes;
for (const ClangTidyError &Error : Context.getErrors())
- Fixes.insert(Error.Fix.begin(), Error.Fix.end());
+ for (const auto &Fix : Error.Fix) {
+ auto Err = Fixes.add(Fix);
+ // FIXME: better error handling. Keep the behavior for now.
+ if (Err) {
+ llvm::errs() << llvm::toString(std::move(Err)) << "\n";
+ return "";
+ }
+ }
if (Errors)
*Errors = Context.getErrors();
auto Result = tooling::applyAllReplacements(Code, Fixes);
OpenPOWER on IntegriCloud