summaryrefslogtreecommitdiff
path: root/gcc/cp/except.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/except.c')
-rw-r--r--gcc/cp/except.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 216ec103f52..52ba1cdeae5 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -972,16 +972,8 @@ is_admissible_throw_operand_or_catch_parameter (tree t, bool is_throw)
/* 10.4/3 An abstract class shall not be used as a parameter type,
as a function return type or as type of an explicit
conversion. */
- else if (ABSTRACT_CLASS_TYPE_P (type))
- {
- if (is_throw)
- error ("expression %qE of abstract class type %qT cannot "
- "be used in throw-expression", expr, type);
- else
- error ("cannot declare catch parameter to be of abstract "
- "class type %qT", type);
- return false;
- }
+ else if (abstract_virtuals_error (is_throw ? ACU_THROW : ACU_CATCH, type))
+ return false;
else if (!is_throw
&& TREE_CODE (type) == REFERENCE_TYPE
&& TYPE_REF_IS_RVALUE (type))