diff options
Diffstat (limited to 'clang/AST/ExprCXX.cpp')
-rw-r--r-- | clang/AST/ExprCXX.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/AST/ExprCXX.cpp b/clang/AST/ExprCXX.cpp index 0646823af9c..3bc32e75d87 100644 --- a/clang/AST/ExprCXX.cpp +++ b/clang/AST/ExprCXX.cpp @@ -23,7 +23,6 @@ using namespace clang; Stmt::child_iterator CXXCastExpr::child_begin() { return reinterpret_cast<Stmt**>(&Op); } - Stmt::child_iterator CXXCastExpr::child_end() { return reinterpret_cast<Stmt**>(&Op)+1; } @@ -35,3 +34,14 @@ Stmt::child_iterator CXXBoolLiteralExpr::child_begin() { Stmt::child_iterator CXXBoolLiteralExpr::child_end() { return child_iterator(); } + +// CXXThrowExpr +Stmt::child_iterator CXXThrowExpr::child_begin() { + return reinterpret_cast<Stmt**>(&Op); +} +Stmt::child_iterator CXXThrowExpr::child_end() { + // If Op is 0, we are processing throw; which has no children. + if (Op == 0) + return reinterpret_cast<Stmt**>(&Op)+0; + return reinterpret_cast<Stmt**>(&Op)+1; +} |