From 27de0f2cb3e8c26c37f31e61929b0e442c809ca5 Mon Sep 17 00:00:00 2001 From: Craig Silverstein Date: Fri, 16 Jul 2010 21:15:34 +0000 Subject: [PATCH] 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 --- include/clang/AST/RecursiveASTVisitor.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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, { }) -- 2.40.0