Thanks to visit codestin.com
Credit goes to github.com

Skip to content

clang-tidy: modernize-use-using removes const and volatile qualifiers #158406

@e-kwsm

Description

@e-kwsm
typedef const int T;
typedef volatile int U;
$ clang-tidy '--checks=-*,modernize-use-using' --fix a.cpp
2 warnings generated.
/tmp/a.cpp:1:1: warning: use 'using' instead of 'typedef' [modernize-use-using]
    1 | typedef const int T;
      | ^~~~~~~~~~~~~~~~~~~
      | using T = int
/tmp/a.cpp:2:1: warning: use 'using' instead of 'typedef' [modernize-use-using]
    2 | typedef volatile int U;
      | ^~~~~~~~~~~~~~~~~~~~~~
      | using U = int

gives

using T = int;
using U = int:

viz. CV-qualifiers are removed.

https://godbolt.org/z/hWvPsG873

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