[PATCH] D44602: [clang-tidy] readability-function-size: add VariableThreshold param.
Jonas Toth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 18 05:04:20 PDT 2018
JonasToth added a comment.
> The comment i added is actually wrong.
> The range-based for just works anyway.
> The VisitBindingDecl() is needed to get all the 'variables' declared in structured binding.
> But as you can see in https://godbolt.org/g/be6Juf, the BindingDecl's are wrapped into DecompositionDecl.
> And DecompositionDecl is actually inherited from VarDecl, https://github.com/llvm-mirror/clang/blob/b031fdc9b7dbd9c7f942d8060a4f00d63f3c9af2/include/clang/AST/DeclCXX.h#L3824-L3825,
> so we count the DecompositionDecl in VisitVarDecl(), thus we need a VisitDecompositionDecl() that subtracts it.
Thanks for clarification. It feels very NOT obvious how to handle this case :)
rCTE Clang Tools Extra
More information about the cfe-commits