aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-15 18:05:39 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-15 18:05:39 +0000
commitbf422f9d7e2e3454b2296b02202f4d5ae12644f6 (patch)
tree2cd1762596b815beb061c4e9b631ea090278e9ce /lib
parent1b49d762e9658b6b6d1b677dca005324a7b1126d (diff)
Diagnose attempts to throw an abstract class type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101381 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaExprCXX.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 04b3d83f3e..be3ef83d99 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -411,6 +411,11 @@ bool Sema::CheckCXXThrowOperand(SourceLocation ThrowLoc, Expr *&E) {
<< E->getSourceRange()))
return true;
+ if (RequireNonAbstractType(ThrowLoc, E->getType(),
+ PDiag(diag::err_throw_abstract_type)
+ << E->getSourceRange()))
+ return true;
+
// FIXME: This is just a hack to mark the copy constructor referenced.
// This should go away when the next FIXME is fixed.
const RecordType *RT = Ty->getAs<RecordType>();