Skip to content

[clang-tidy][false-positive] misc-const-correctness incorrectly flags pointer passed to "pointer to pointer" #170033

@tearfur

Description

@tearfur

misc-const-correctness incorrectly flags pointer to non-const (e.g. int*) that are passed to pointer to pointer parameters (e.g. int**).

https://godbolt.org/z/8Mj4GGc5v:

<source>:7:5: warning: pointee of variable 'ip' of type 'int *' can be declared 'const' [misc-const-correctness]
    7 |     int* ip = &i;
      |     ^  
      |         const
1 warning generated.

Current trunk: b228256

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