Hi!<br><br>With "_Bool" it works flawlessly thanks. I wonder if isBoolean is an user friendly solution, as one might except to use asString with any type. However I admint, making asString matcher able to match everything might add unnecessary complexity.<br>
<br>Thanks,<br>Gábor<br><br><div class="gmail_quote">On 7 October 2012 22:21, Daniel Jasper <span dir="ltr"><<a href="mailto:djasper@google.com" target="_blank">djasper@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+cfe-dev<br>
<br>
Hi Gábor,<br>
<br>
I think the AST-internal-name of the type bool is '_Bool'. Can you try<br>
that with the asString-matcher? However, I think the right solution<br>
would be to write a matcher like:<br>
<br>
AST_MATCHER(QualType, isBoolean) {<br>
return Node->isBooleanType();<br>
}<br>
<br>
Cheers,<br>
Daniel<br>
<div class="HOEnZb"><div class="h5"><br>
On Sun, Oct 7, 2012 at 10:06 PM, Gábor Horváth <<a href="mailto:xazax.hun@gmail.com">xazax.hun@gmail.com</a>> wrote:<br>
> Hi!<br>
><br>
> I can't figure out how can I match bool types.<br>
><br>
> First of all, I had a matcher like this:<br>
> classTemplateSpecializationDecl(hasAnyTemplateArgument(refersToType(asString("bool"))))<br>
><br>
> but asString("bool") did not give me any match, however using any other<br>
> types would. First of all, I thought, maybe bool is a typedef, and that can<br>
> cause the problem, so I alstered the asString matcher, to also check the<br>
> name of the cannonical type.<br>
><br>
> It looks now like this one:<br>
> AST_MATCHER_P(QualType, asString, std::string, Name) {<br>
> return Name == Node.getAsString() || Name ==<br>
> Node.getCanonicalType().getAsString();<br>
> }<br>
><br>
> However I still has no success.<br>
><br>
> Thanks for your answer in advance,<br>
> Gábor<br>
</div></div></blockquote></div><br>