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 :) Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44602 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits