<div dir="ltr">Hi folks,<div>I was wondering what is the best way to get to the CXXCtroInitializer from child.</div><div><br></div><div>In code like this:</div><div><div>struct A {</div><div>    A() : a(false), c(false) {}</div><div>    unsigned a : 1;</div><div>    unsigned c : 3;</div><div>};</div><div><br></div></div><div>I am looking for implicit casts from bool.</div><div>I added CXXCtorInitializer into hasParent like this:</div><div><div><br></div><div>const internal::ArgumentAdaptingMatcherFunc<</div><div>    internal::HasParentMatcher,</div><div>    internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc, CXXCtorInitializer>,</div><div>    internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>></div><div>    LLVM_ATTRIBUTE_UNUSED hasParent = {};</div></div><div><br></div><div>so clang-query doesn't reject matcher:</div><div><div>implicitCastExpr(hasParent(cxxCtorInitializer()))</div></div><div>but it doesn't match with anything.</div><div><br></div><div>I also tried something like this:</div><div><br></div><div><div>  auto matcher = hasAncestor(cxxConstructorDecl(hasAnyConstructorInitializer(</div><div>    cxxCtorInitializer(forField(isOneBitBitField()),</div><div>                       withInitializer(implicitCastExpr(equalsBoundNode("cast")))</div><div>                       ))));</div></div><div><br></div><div>and then </div><div>implicitCastExpr(matcher).bind("cast")</div><div><br></div><div>but it doesn't seems to work either.</div><div>Any thoughts?</div><div><br></div><div>Piotr</div></div>