Skip to content

[clang-tidy] misc-const-correctness false positive #133562

Open
@tearfur

Description

@tearfur

https://godbolt.org/z/dbKn7dWYz

<source>:8:5: warning: variable 'vz' of type 'size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
    8 |     size_t vz = static_cast<size_t>(v);
      |     ^
      |            const

If I change the problematic line to auto vz = static_cast<size_t>(v);, the warning goes away.

Current trunk: 1ff7491

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