aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/clang/AST/ExprCXX.h8
-rw-r--r--include/clang/AST/RecursiveASTVisitor.h3
-rw-r--r--include/clang/Sema/Sema.h3
3 files changed, 11 insertions, 3 deletions
diff --git a/include/clang/AST/ExprCXX.h b/include/clang/AST/ExprCXX.h
index 0a9435479d..b3012bf5d8 100644
--- a/include/clang/AST/ExprCXX.h
+++ b/include/clang/AST/ExprCXX.h
@@ -900,6 +900,9 @@ class CXXNewExpr : public Expr {
// Must be null for all other types.
CXXConstructorDecl *Constructor;
+ /// \brief The allocated type-source information, as written in the source.
+ TypeSourceInfo *AllocatedTypeInfo;
+
/// \brief If the allocated type was expressed as a parenthesized type-id,
/// the source range covering the parenthesized type-id.
SourceRange TypeIdParens;
@@ -915,6 +918,7 @@ public:
Expr *arraySize, CXXConstructorDecl *constructor, bool initializer,
Expr **constructorArgs, unsigned numConsArgs,
FunctionDecl *operatorDelete, QualType ty,
+ TypeSourceInfo *AllocatedTypeInfo,
SourceLocation startLoc, SourceLocation endLoc);
explicit CXXNewExpr(EmptyShell Shell)
: Expr(CXXNewExprClass, Shell), SubExprs(0) { }
@@ -927,6 +931,10 @@ public:
return getType()->getAs<PointerType>()->getPointeeType();
}
+ TypeSourceInfo *getAllocatedTypeSourceInfo() const {
+ return AllocatedTypeInfo;
+ }
+
FunctionDecl *getOperatorNew() const { return OperatorNew; }
void setOperatorNew(FunctionDecl *D) { OperatorNew = D; }
FunctionDecl *getOperatorDelete() const { return OperatorDelete; }
diff --git a/include/clang/AST/RecursiveASTVisitor.h b/include/clang/AST/RecursiveASTVisitor.h
index 232e47b03a..0a2adba58f 100644
--- a/include/clang/AST/RecursiveASTVisitor.h
+++ b/include/clang/AST/RecursiveASTVisitor.h
@@ -1744,7 +1744,8 @@ DEF_TRAVERSE_STMT(CXXScalarValueInitExpr, {
})
DEF_TRAVERSE_STMT(CXXNewExpr, {
- TRY_TO(TraverseType(S->getAllocatedType()));
+ // The child-iterator will pick up the other arguments.
+ TRY_TO(TraverseTypeLoc(S->getAllocatedTypeSourceInfo()->getTypeLoc()));
})
DEF_TRAVERSE_STMT(OffsetOfExpr, {
diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h
index 4741028cb0..99228dc701 100644
--- a/include/clang/Sema/Sema.h
+++ b/include/clang/Sema/Sema.h
@@ -2195,8 +2195,7 @@ public:
SourceLocation PlacementRParen,
SourceRange TypeIdParens,
QualType AllocType,
- SourceLocation TypeLoc,
- SourceRange TypeRange,
+ TypeSourceInfo *AllocTypeInfo,
Expr *ArraySize,
SourceLocation ConstructorLParen,
MultiExprArg ConstructorArgs,