This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] [PR2204] Check for parameters of abstract types (partial fix)
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: "Giovanni Bajo" <giovannibajo at libero dot it>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: 10 Feb 2004 03:09:16 +0100
- Subject: Re: [C++ PATCH] [PR2204] Check for parameters of abstract types (partial fix)
- Organization: Integrable Solutions
- References: <1c9c01c3ef6c$71c10f10$9cba2997@bagio>
"Giovanni Bajo" <giovannibajo@libero.it> writes:
| if (TREE_CODE (decl) == VAR_DECL)
| ! error ("%Jcannot declare variable `%D' to be of abstract type `%T'",
| ! decl, decl, type);
That is an abuse of %J. Use error_at instead. E.g.
error_at ("cannot declare variable `%+D' to be of abstract type `%T'",
decl, type);
| ! error ("%Jcannot declare parameter `%D' to be of abstract type `%T'",
| ! decl, decl, type);
Ditto.
| else if (TREE_CODE (decl) == FIELD_DECL)
| ! error ("%Jcannot declare field `%D' to be of abstract type `%T'",
| ! decl, decl, type);
Ditto.
| else if (TREE_CODE (decl) == FUNCTION_DECL
| && TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE)
| ! error ("%Jinvalid abstract return type for member function `%#D'",
| ! decl, decl);
Ditto.
| else if (TREE_CODE (decl) == FUNCTION_DECL)
| ! error ("%Jinvalid abstract return type for function `%#D'",
| ! decl, decl);
Ditto.
As a side comment, I don't understand why you went through that
change.
-- Gaby