Description
Bugzilla Link | 35408 |
Version | unspecified |
OS | Linux |
Attachments | reproducer |
CC | @henrickarlsson |
Extended Description
clang-tidy foo.c --
on foo.c only containing
a = a && 3;
gives a failed assertion:
Fix conflicts with existing fix! The new replacement overlaps with an existing replacement.
New replacement: /data/repo/llvm-dev2/foo.c: 5:+5:""
Existing replacement: /data/repo/llvm-dev2/foo.c: 6:+2:"&"
clang-tidy: ../tools/clang/tools/extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp:86: virtual void (anonymous namespace)::ClangTidyDiagnosticRenderer::emitCodeContext(clang::FullSourceLoc, DiagnosticsEngine::Level, SmallVectorImplclang::CharSourceRange &, ArrayRefclang::FixItHint): Assertion `false && "Fix conflicts with existing fix!"' failed.
Abort
Changing the input to:
a = a && 1;
avoids the crash and instead we get a bunch of (seemingly correct) warnings.
The crash started appearing with clang-tools-extra commit r284399 2016-10-17:
[clang-tidy] Clean up code after applying replacements.
Summary:
Remove empty namespaces and initializer list commas / colons in
affected ranges. Initial patch: proper options for enabling the cleanup and
specifying the format style are needed.
Reviewers: hokein, ioeric
Subscribers: beanz, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D24572
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@284399 91177308-0d34-0410-b5e6-96231b3b80d8