summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
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/clang-tidy/ClangTidyDiagnosticConsumer.cpp
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/clang-tidy/ClangTidyDiagnosticConsumer.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
index 2e007171677..940b0634936 100644
--- a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
@@ -77,7 +77,14 @@ protected:
assert(Range.getBegin().isFileID() && Range.getEnd().isFileID() &&
"Only file locations supported in fix-it hints.");
- Error.Fix.insert(tooling::Replacement(SM, Range, FixIt.CodeToInsert));
+ auto Err =
+ Error.Fix.add(tooling::Replacement(SM, Range, FixIt.CodeToInsert));
+ // FIXME: better error handling.
+ if (Err) {
+ llvm::errs() << "Fix conflicts with existing fix! "
+ << llvm::toString(std::move(Err)) << "\n";
+ }
+ assert(!Err && "Fix conflicts with existing fix!");
}
}
OpenPOWER on IntegriCloud