diff options
author | Zhanyong Wan <wan@google.com> | 2010-07-08 21:01:29 +0000 |
---|---|---|
committer | Zhanyong Wan <wan@google.com> | 2010-07-08 21:01:29 +0000 |
commit | 9870460c8469cfd2afbd51367426d7a21eea1d6d (patch) | |
tree | 52ac32a3ae4a3adc904eadff6f927517ae31b4eb | |
parent | 55b037b9f3674671e3f984c146b71243d9e9d208 (diff) | |
download | bcm5719-llvm-9870460c8469cfd2afbd51367426d7a21eea1d6d.tar.gz bcm5719-llvm-9870460c8469cfd2afbd51367426d7a21eea1d6d.zip |
Makes RecursiveASTVisitor traverse the type of a temporary object
created via T() where T is a class type. Reviewed by chandlerc and
csilvers.
llvm-svn: 107911
-rw-r--r-- | clang/include/clang/AST/RecursiveASTVisitor.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/clang/include/clang/AST/RecursiveASTVisitor.h b/clang/include/clang/AST/RecursiveASTVisitor.h index f734c9af521..bc4ad2a0655 100644 --- a/clang/include/clang/AST/RecursiveASTVisitor.h +++ b/clang/include/clang/AST/RecursiveASTVisitor.h @@ -1546,9 +1546,8 @@ bool RecursiveASTVisitor<Derived>::TraverseInitListExpr(InitListExpr *S) { } DEF_TRAVERSE_STMT(CXXScalarValueInitExpr, { - // This is called for code like 'return MyClass()' where MyClass - // has no user-defined constructor. It's also called for 'return - // int()'. We recurse on type MyClass/int. + // This is called for code like 'return T()' where T is a built-in + // (i.e. non-class) type. if (!S->isImplicit()) TRY_TO(TraverseType(S->getType())); }) @@ -1603,7 +1602,12 @@ DEF_TRAVERSE_STMT(UnresolvedLookupExpr, { }) DEF_TRAVERSE_STMT(UnresolvedMemberExpr, { }) DEF_TRAVERSE_STMT(VAArgExpr, { }) DEF_TRAVERSE_STMT(CXXConstructExpr, { }) -DEF_TRAVERSE_STMT(CXXTemporaryObjectExpr, { }) + +DEF_TRAVERSE_STMT(CXXTemporaryObjectExpr, { + // This is called for code like 'return T()' where T is a class type. + TRY_TO(TraverseType(S->getType())); + }) + DEF_TRAVERSE_STMT(CallExpr, { }) DEF_TRAVERSE_STMT(CXXMemberCallExpr, { }) DEF_TRAVERSE_STMT(CXXOperatorCallExpr, { }) |