<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Feb 15, 2016 at 10:39 PM Richard via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">For reference, please see:<br>
<<a href="https://llvm.org/bugs/show_bug.cgi?id=26613" rel="noreferrer" target="_blank">https://llvm.org/bugs/show_bug.cgi?id=26613</a>><br>
recordDecl(unless(isDefinition())) is not the inverse of<br>
recordDecl(isDefinition())<br>
<br>
<<a href="https://llvm.org/bugs/show_bug.cgi?id=26614" rel="noreferrer" target="_blank">https://llvm.org/bugs/show_bug.cgi?id=26614</a>><br>
recordDecl() matches same declaration twice<br>
<br>
I'm working in trunk, but I checked against release_36 branch and saw<br>
the same results.<br>
<br>
Given this source:<br>
<br>
1 class Foo;<br>
2 class Foo;<br>
3<br>
4 class Bar {<br>
5 };<br>
6<br>
7 class Bar;<br>
<br>
Why does line 4 match recordDecl() twice?<br></blockquote><div><br></div><div>That's the injected class name. The injected class name is implicit, and is a declaration and not a definition. You'll basically want to exclude matches on Bar::Bar</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If I try to filter declarations from definitions using<br>
TagDecl::isThisDeclarationADefinition(), then one of the matches is<br>
rejected, but the fact that it matches twice means that:<br>
<br>
recordDecl(isDefinition()) matches line 4, but none of the others.<br>
recordDecl(unless(isDefinition())) matches line 4 as well as the others.<br>
<br>
What is going on here?<br>
--<br>
"The Direct3D Graphics Pipeline" free book <<a href="http://tinyurl.com/d3d-pipeline" rel="noreferrer" target="_blank">http://tinyurl.com/d3d-pipeline</a>><br>
The Computer Graphics Museum <<a href="http://ComputerGraphicsMuseum.org" rel="noreferrer" target="_blank">http://ComputerGraphicsMuseum.org</a>><br>
The Terminals Wiki <<a href="http://terminals.classiccmp.org" rel="noreferrer" target="_blank">http://terminals.classiccmp.org</a>><br>
Legalize Adulthood! (my blog) <<a href="http://LegalizeAdulthood.wordpress.com" rel="noreferrer" target="_blank">http://LegalizeAdulthood.wordpress.com</a>><br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div>