summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index b3d94c372dc..ac36a1f22df 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -238,6 +238,10 @@ Sema::ActOnCXXNew(SourceLocation StartLoc, bool UseGlobal,
if (CheckAllocatedType(AllocType, D))
return ExprError();
+ if (RequireNonAbstractType(D.getSourceRange().getBegin(), AllocType,
+ diag::err_allocation_of_abstract_type, 0))
+ return ExprError();
+
QualType ResultType = AllocType->isDependentType()
? Context.DependentTy
: Context.getPointerType(AllocType);
OpenPOWER on IntegriCloud