Skip to content

Clang-tidy asserts on Clang fixes, which were not enabled #33477

Closed as not planned
Closed as not planned
@EugeneZelenko

Description

@EugeneZelenko
Bugzilla Link 34130
Version unspecified
OS Linux

Extended Description

I experienced Clang-tidy crashes on my work code base:

Fix conflicts with existing fix! The new insertion has the same insert location as an existing replacement.
New replacement: ./../obj/linux-x86/debug/Hash.h: 4912:+0:"break; "
Existing replacement: ./../obj/linux-x86/debug/Hash.h: 4912:+0:"[[clang::fallthrough]]; "
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.

But I run only modernize checks, not Clang diagnostics:

-checks="-,modernize-deprecated-headers" -header-filter="."
-checks="-,modernize-use-default-member-init" -header-filter="."

Code in question was generated by gperf and contain next switch:

switch (hval)
{
default:
hval += asso_values[static_cast(str[6])];
/FALLTHROUGH/
case 6:
hval += asso_values[static_cast(str[5])];
/FALLTHROUGH/
case 5:
hval += asso_values[static_cast(str[4])];
/FALLTHROUGH/
case 4:
hval += asso_values[static_cast(str[3])];
/FALLTHROUGH/
case 3:
hval += asso_values[static_cast(str[2])];
/FALLTHROUGH/
case 2:
case 1:
hval += asso_values[static_cast(str[0])];
break;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang-tidycrashPrefer [crash-on-valid] or [crash-on-invalid]incompleteIssue not complete (e.g. missing a reproducer, build arguments, etc.)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions