From d28993f14ee1bfc66b41dddc3613d2c054201545 Mon Sep 17 00:00:00 2001 From: jason Date: Sun, 17 Mar 2013 02:36:55 +0000 Subject: * cp-tree.h (abstract_class_use): New enum. * typeck2.c (pending_abstract_type): Add use field. (abstract_virtuals_error_sfinae): Add overloads taking abstract_class_use instead of tree. * typeck.c (build_static_cast_1): Call it. * except.c (is_admissible_throw_operand_or_catch_parameter): Call it. * pt.c: Adjust calls. * decl.c (cp_finish_decl): Don't handle functions specially. (grokdeclarator): Always check return type. * init.c (build_new_1): Adjust call. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196735 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/except.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'gcc/cp/except.c') 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)) -- cgit v1.2.1