<div dir="ltr">Manuel, do you have an idea what could be wrong here?<br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 16, 2016 at 7:22 PM, Piotr Padlewski <span dir="ltr"><<a href="mailto:piotr.padlewski@gmail.com" target="_blank">piotr.padlewski@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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><span class="HOEnZb"><font color="#888888"><div><br></div><div>Piotr</div></font></span></div>
</blockquote></div><br></div></div>