diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2012-05-07 00:02:00 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2012-05-07 00:02:00 +0000 |
commit | 21eb6d4961abf710de3864a537655e9c57903803 (patch) | |
tree | df8ef86933185229c7b1b36be92218fba30f1b34 /lib/Sema/SemaCast.cpp | |
parent | c838fd2ab889ffbb82c90da0cd634ef75b614b2c (diff) |
Detecting illegal instantiations of abstract types when using a function-style cast. Fixed PR12658.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156271 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCast.cpp')
-rw-r--r-- | lib/Sema/SemaCast.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaCast.cpp b/lib/Sema/SemaCast.cpp index c11c30aa17..dd5de02d15 100644 --- a/lib/Sema/SemaCast.cpp +++ b/lib/Sema/SemaCast.cpp @@ -1302,7 +1302,9 @@ TryStaticImplicitCast(Sema &Self, ExprResult &SrcExpr, QualType DestType, CastKind &Kind, bool ListInitialization) { if (DestType->isRecordType()) { if (Self.RequireCompleteType(OpRange.getBegin(), DestType, - diag::err_bad_dynamic_cast_incomplete)) { + diag::err_bad_dynamic_cast_incomplete) || + Self.RequireNonAbstractType(OpRange.getBegin(), DestType,
+ diag::err_allocation_of_abstract_type)) { msg = 0; return TC_Failed; } |