Skip to content

[clang-tidy] misc-include-cleaner: redundant insertion on different symbols from same header #65285

@danix800

Description

@danix800

Testcase:

// baz.h

#pragma once
int baz();
#define BAZ 10

// test.c
#include "bar.h"
int BazResult = baz();
int BazResult1 = BAZ;

command:

clang-tidy -fix -checks=-*,misc-include-cleaner test.c

fixed test.c

#include "baz.h"
#include "baz.h"
int BazResult = baz();
int BazResult1 = BAZ;

baz.h is redundant.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions