From: Craig Silverstein Date: Fri, 16 Jul 2010 21:15:34 +0000 (+0000) Subject: Fix typeid the same way I fixed sizeof. Sad I had missed it before. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=27de0f2cb3e8c26c37f31e61929b0e442c809ca5;p=clang Fix typeid the same way I fixed sizeof. Sad I had missed it before. Reviewed by chandlerc git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108557 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h index 1c3d04b461..fc62197794 100644 --- a/include/clang/AST/RecursiveASTVisitor.h +++ b/include/clang/AST/RecursiveASTVisitor.h @@ -1621,6 +1621,13 @@ DEF_TRAVERSE_STMT(SizeOfAlignOfExpr, { TRY_TO(TraverseTypeLoc(S->getArgumentTypeInfo()->getTypeLoc())); }) +DEF_TRAVERSE_STMT(CXXTypeidExpr, { + // The child-iterator will pick up the arg if it's an expression, + // but not if it's a type. + if (S->isTypeOperand()) + TRY_TO(TraverseTypeLoc(S->getTypeOperandSourceInfo()->getTypeLoc())); + }) + DEF_TRAVERSE_STMT(TypesCompatibleExpr, { TRY_TO(TraverseType(S->getArgType1())); TRY_TO(TraverseType(S->getArgType2())); @@ -1648,7 +1655,6 @@ DEF_TRAVERSE_STMT(CXXNullPtrLiteralExpr, { }) DEF_TRAVERSE_STMT(CXXPseudoDestructorExpr, { }) DEF_TRAVERSE_STMT(CXXThisExpr, { }) DEF_TRAVERSE_STMT(CXXThrowExpr, { }) -DEF_TRAVERSE_STMT(CXXTypeidExpr, { }) DEF_TRAVERSE_STMT(CXXUnresolvedConstructExpr, { }) DEF_TRAVERSE_STMT(DesignatedInitExpr, { }) DEF_TRAVERSE_STMT(ExtVectorElementExpr, { })