aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Silverstein <csilvers2000@yahoo.com>2010-07-16 21:15:34 +0000
committerCraig Silverstein <csilvers2000@yahoo.com>2010-07-16 21:15:34 +0000
commit27de0f2cb3e8c26c37f31e61929b0e442c809ca5 (patch)
treeb67af8a02607a034eacd64256f730bb7f04a7d08
parentbb09d1e7b2ce1d59e571397e8300d9e18cba8456 (diff)
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
-rw-r--r--include/clang/AST/RecursiveASTVisitor.h8
1 files changed, 7 insertions, 1 deletions
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, { })