diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2012-02-16 10:58:10 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2012-02-16 10:58:10 +0000 |
commit | 86fab844bbf3bd922cecca027a4d367ec82664bd (patch) | |
tree | ebf4dbabfe2294ee5439b8568ed8096366bc65ff /clang/lib/AST/Expr.cpp | |
parent | 89cc16637d8e2d6c3b0ecb7dea63b0b2a0102167 (diff) | |
download | bcm5719-llvm-86fab844bbf3bd922cecca027a4d367ec82664bd.tar.gz bcm5719-llvm-86fab844bbf3bd922cecca027a4d367ec82664bd.zip |
Make CXXNewExpr contain only a single initialier, and not hold the used constructor itself.
Holding the constructor directly makes no sense when list-initialized arrays come into play. The constructor is now held in a CXXConstructExpr, if construction is what is done. The new design can also distinguish properly between list-initialization and direct-initialization, as well as implicit default-initialization constructors and explicit value-initialization constructors. Finally, doing it this way removes redundance from the AST because CXXNewExpr doesn't try to handle both the allocation and the initialization responsibilities.
This breaks the static analysis of new expressions. I've filed PR12014 to track this.
llvm-svn: 150682
Diffstat (limited to 'clang/lib/AST/Expr.cpp')
-rw-r--r-- | clang/lib/AST/Expr.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index f9f7ba542cd..4b19031852c 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -2041,10 +2041,7 @@ Expr::CanThrowResult Expr::CanThrow(ASTContext &C) const { if (isTypeDependent()) CT = CT_Dependent; else - CT = MergeCanThrow( - CanCalleeThrow(C, this, cast<CXXNewExpr>(this)->getOperatorNew()), - CanCalleeThrow(C, this, cast<CXXNewExpr>(this)->getConstructor(), - /*NullThrows*/false)); + CT = CanCalleeThrow(C, this, cast<CXXNewExpr>(this)->getOperatorNew()); if (CT == CT_Can) return CT; return MergeCanThrow(CT, CanSubExprsThrow(C, this)); |