Skip to content

[clang-tidy] Fix unit test readability/identifier-naming-anon-record-fields.cpp #131378

Closed
@carlosgalvezp

Description

@carlosgalvezp

After making clang-tidy skip processing system headers by default, the following test case no longer works:

https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-anon-record-fields.cpp#L36

This is because the CXXRecordDecl corresponding to the global anonymous union is not picked up by the ASTConsumer::handleTopLevelDecl function, i.e. it is not considered a top-level declaration. Most likely because it's anonymous i.e. it does not have a name. Due to this, the AST traversal does not find it and so the check cannot process this case.

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