Skip to content

[clang-tidy] bugprone-reserved-identifier fix produces uncompilable code #52895

@renanmoreira17

Description

@renanmoreira17

This line of code was written in a header file:

#define _5_kmph_rpm     459

The check “bugprone-reserved-identifier” suggested the following fix:

warning: declaration uses identifier '_5_kmph_rpm', which is reserved in the global namespace [bugprone-reserved-identifier,cert-dcl37-c,cert-dcl51-cpp]
#define _5_kmph_rpm     459
        ^~~~~~~~~~~
        5_kmph_rpm

However, this fix breaks compilation since the suggested #define identifier starts with a number.

Here’s my clang-tidy info:

Homebrew LLVM version 13.0.0
Optimized build.
Default target: x86_64-apple-darwin20.6.0
Host CPU: broadwell

I’m on macOS 11.6.1 Big Sur.

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