Skip to content

clang-tidy: modernize-concat-nested-namespaces has false positives and deletes macros with fixits #60035

@Skylion007

Description

@Skylion007

I tried running modernize-concat-nested-namespaces on the entire PyTorch repo and found some edge cases.

Specifically,

namespace a {
namespace b {
}
/* IMPORTANT IFDEF AND MACROS HERE */
}

Where any important ifdef logic or macros are deleted in the fixit (which breaks compilation later), which is definitely not ideal. It would be great if the check didn't apply the fixit where important non-namespace comments, macros, or other code is not deleted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions