<html dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body style="text-align:left; direction:ltr;"><div>On Thu, 2021-02-04 at 21:34 +0000, Hartogs Siegfried via cfe-dev wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><div>Hello everyone, </div><div><br></div><div>How would one write a matcher that looks for ParmVarDecls that don't occur in constructor decls?</div><div>I'd figure</div><div> parmVarDecl(unless(hasParent(cxxConstructorDecl()))),</div><div>but that doesn't work.</div><div>Replacing hasParent with hasAncestor seems to work, but looks weird considering ParmVarDecls look like direct children of FunctionDecls in the AST. Is there something special about ParmVarDecls, also since there is the hasAnyParameter matcher?</div><div><br></div><div>Thanks!</div><div>Sigi</div><div>_______________________________________________</div><div>cfe-dev mailing list</div><div><a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a></div><div><a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a></div></blockquote><div><br></div><div>Hi Sigi,</div><div><br></div><div>I'm not sure if this is intended behaviour, but it seems the parent of a `ParmVarDecl` is a `TypeLoc`.</div><div>For now this should serve your purpose, but I think this may need looking into.</div><div>`parmVarDecl(hasParent(typeLoc(unless(hasParent(cxxConstructorDecl())))))`</div><div><br></div><div>~Nathan</div></body></html>