diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2008-11-21 19:14:01 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2008-11-21 19:14:01 +0000 |
commit | 4c5d320a7581f4b80b151630c91cea5727fa9923 (patch) | |
tree | 2ebb368fb49a811cb48d60dbda245007efb6d8b5 /lib/AST/Expr.cpp | |
parent | 730e0fdbbf9b315ef834074054ac55af3a4fcc0c (diff) |
Implementation of new and delete parsing and sema.
This version uses VLAs to represent arrays. I'll try an alternative way next, but I want this safe first.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59835 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Expr.cpp')
-rw-r--r-- | lib/AST/Expr.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index 2e13352a5a..e6a7b4114a 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -329,7 +329,13 @@ bool Expr::hasLocalSideEffect() const { case CXXDefaultArgExprClass: return cast<CXXDefaultArgExpr>(this)->getExpr()->hasLocalSideEffect(); - } + + case CXXNewExprClass: + // FIXME: In theory, there might be new expressions that don't have side + // effects (e.g. a placement new with an uninitialized POD). + case CXXDeleteExprClass: + return true; + } } /// DeclCanBeLvalue - Determine whether the given declaration can be @@ -481,8 +487,6 @@ Expr::isLvalueResult Expr::isLvalue(ASTContext &Ctx) const { case CXXTypeidExprClass: // C++ 5.2.8p1: The result of a typeid expression is an lvalue of ... return LV_Valid; - case CXXThisExprClass: - return LV_InvalidExpression; default: break; } |