[cfe-commits] Typo in RecursiveASTVisitor.h?

Douglas Gregor dgregor at apple.com
Wed Dec 8 09:18:17 PST 2010


On Dec 7, 2010, at 1:33 AM, Benoit Perrot wrote:

> Hello,
> 
> When playing with (inheriting from) "RecursiveASTVisitor", I observed
> that "::TraverseBinAssign" (and other traversers of binary operators)
> were never called. Except "::TraverseBinPtrMemD".
> 
> My investigations led me to the implementation of
> "RecursiveASTVisitor<Derived>::TraverseStmt" (line 386 of
> RecursiveASTVisitor.h), which says (line 393):
> 
>       if (BinaryOperator *BinOp = dyn_cast<BinaryOperator>(S)) {
>         switch (BinOp->getOpcode()) {
>     #define OPERATOR(NAME) \
>         case BO_##NAME: DISPATCH(Bin##PtrMemD, BinaryOperator, S);
> 
> (See how every case of the switch actually dispatch to BinPtrMemD only)
> 
> Shouldn't it be the following:
> 
>     #define OPERATOR(NAME) \
>         case BO_##NAME: DISPATCH(Bin##NAME, BinaryOperator, S);
> 
> ?

Fixed in r121266, thanks!

	- Doug



More information about the cfe-commits mailing list