Skip to content

'clang-diagnostic-' checks not considered as enabled #34763

@llvmbot

Description

@llvmbot
Bugzilla Link 35415
Version unspecified
OS Linux
Attachments sample project to recreate the undesired behavior
Reporter LLVM Bugzilla Contributor
CC @dawagner

Extended Description

'clang-diagnostic-' checks family cannot be the only one enabled for running clang-tidy due to 'no checks enabled' error:
$ clang-tidy -checks='-*,clang-diagnostic-unused-variable' main.cpp
Error: no checks enabled.

Extending check list by any other works fine for 'clang-diagnostic-' also:
$ clang-tidy -checks='-*,cert-err34-c,clang-diagnostic-unused-variable'
main.cpp
1 error generated.

What's worse, 'clang-diagnostic-' checks are not printed by listing all available checks:
$ clang-tidy -checks='*' -list-checks | grep clang-diagnostic | wc -l
0

This is really counter-intuitive and makes the user doubt, whether 'clang-diagnostic' checks does still exist.

I've tested that on clang-tidy-5.0.
There is a sample project attached to easily recreate the issue, with clang-tidy calls prepared.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions