Skip to content

clang-tidy ignoring compilation database compiler options when single check specified. #169602

@IanCollins

Description

@IanCollins

I have a strange issue with clang-tidy. For one specific file, running with our default .clang-tidy picks up two warnings, one of which is performance-for-range-copy. If I re-run with the following command, a bunch of clang-diagnostic-format-security errors are flagged:

clang-tidy-21 --header-filter='-*' --checks='-*,performance-for-range-copy' -p=<path to compile commands directory> <target file>

The compile_commands.json entry for the files does include -no-format-security!

Is there a way to see the commands passed to clang under the hood?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions