Clang-Tidy seems not working CLion 2017.2

已回答

Hi,

My Clang-Tidy configuration:

I use the default clang-tidy checks :

*,-cert-env33-c,-cppcoreguidelines-no-malloc,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-const-cast,-cppcoreguidelines-pro-type-cstyle-cast,-cppcoreguidelines-pro-type-union-access,-google-*,google-default-arguments,google-explicit-constructor,google-runtime-member-string-references,google-runtime-memset,google-runtime-operator,-llvm-*,-readability-simplify-boolean-expr,-readability-braces-around-statements,-readability-identifier-naming,-readability-function-size,-misc-bool-pointer-implicit-conversion,-misc-unused-parameters,-modernize-use-using,-safety-no-assembler,-clang-diagnostic-*,-clang-analyzer-*

But I have 0 notification about the clang-tidy, even if I use some pieces of code which should throw it.

For example:

for (auto it = vec.begin(); it != vec.end(); ++it) {} //should notify something like this : "use range-based for loop"

I use CLion linux.

 

What is wrong ?

1

Hello, Pierre.

It seems that clang-tidy doesn't emit this inspection when the loop variable is not used inside the loop. This behaviour is unclear to me, but it is our of our control, unfortunately.

0

请先登录再写评论。