r288923 - [RecursiveASTVisitor] Fix post-order traversal of UnaryOperator

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 7 11:55:04 PST 2016


On 7 December 2016 at 10:11, Malcolm Parsons <malcolm.parsons at gmail.com>
wrote:

> On 7 December 2016 at 17:56, Richard Smith <richard at metafoo.co.uk> wrote:
> > On 7 Dec 2016 9:49 am, "Malcolm Parsons via cfe-commits"
> > <cfe-commits at lists.llvm.org> wrote:
> >
> > Author: malcolm.parsons
> > Date: Wed Dec  7 11:39:04 2016
> > New Revision: 288923
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=288923&view=rev
> > Log:
> > [RecursiveASTVisitor] Fix post-order traversal of UnaryOperator
> >
> > Reviewers: aaron.ballman, klimek, doug.gregor, teemperor, rsmith
> >
> > Subscribers: cfe-commits
> >
> > Differential Revision: https://reviews.llvm.org/D26742
> >
> > @@ -87,7 +92,7 @@ TEST(RecursiveASTVisitor, PostOrderTrave
> >    Visitor.TraverseTranslationUnitDecl(TU);
> >
> >    std::vector<std::string> expected = {
> > -    "4", "9", "i", "1", "3", "+", "2", "+", "return", "A::B::foo",
> "A::B",
> > "A"
> > +    "4", "9", "i", "-",
>
> > Why does "i" not show up here twice? Do we not include DeclRefExprs in
> this
> > list? It looks like we're not testing the relative order of the unary
> > operator and its operand here.
>
> The test doesn't define VisitDeclRefExpr.
>
> I can add it if you like.


Perhaps a better approach would be to change the "-i" to "-5", so there's
no ambiguity as to what "i" means in the expected output.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161207/864e86c5/attachment.html>


More information about the cfe-commits mailing list