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 | bd150f431e8288778013492c0ec095b1b4848564 (patch) | |
| tree | da0e3264b09159011f4cebc8aa135d3e7edb5001 /clang/lib/AST/Expr.cpp | |
| parent | 8dfa51c5efe2e0b7da9f66e7d5d1d29931430630 (diff) | |
| download | bcm5719-llvm-bd150f431e8288778013492c0ec095b1b4848564.tar.gz bcm5719-llvm-bd150f431e8288778013492c0ec095b1b4848564.zip | |
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.
llvm-svn: 59835
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
| -rw-r--r-- | clang/lib/AST/Expr.cpp | 10 | 
1 files changed, 7 insertions, 3 deletions
| diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 2e13352a5ad..e6a7b4114a1 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/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;    } | 

