[cfe-dev] recordDecl() matching weirdness

Richard via cfe-dev cfe-dev at lists.llvm.org
Mon Feb 15 13:39:45 PST 2016


For reference, please see:
<https://llvm.org/bugs/show_bug.cgi?id=26613>
    recordDecl(unless(isDefinition())) is not the inverse of
    recordDecl(isDefinition())

<https://llvm.org/bugs/show_bug.cgi?id=26614>
    recordDecl() matches same declaration twice

I'm working in trunk, but I checked against release_36 branch and saw
the same results.

Given this source:

 1	class Foo;
 2	class Foo;
 3	
 4	class Bar {
 5	};
 6	
 7	class Bar;

Why does line 4 match recordDecl() twice?

If I try to filter declarations from definitions using
TagDecl::isThisDeclarationADefinition(), then one of the matches is
rejected, but the fact that it matches twice means that:

recordDecl(isDefinition()) matches line 4, but none of the others.
recordDecl(unless(isDefinition())) matches line 4 as well as the others.

What is going on here?
-- 
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
     The Computer Graphics Museum <http://ComputerGraphicsMuseum.org>
         The Terminals Wiki <http://terminals.classiccmp.org>
  Legalize Adulthood! (my blog) <http://LegalizeAdulthood.wordpress.com>



More information about the cfe-dev mailing list