This is the mail archive of the
mailing list for the GCC project.
Re: Unreviewed C++ patches
Jakub Jelinek wrote:
On Mon, May 16, 2005 at 11:19:47PM -0700, Mark Mitchell wrote:
On the other hand, I have no idea what the current code is trying to do;
/* Avoid trying to get an operand off an identifier node. */
doesn't look like something I would have written, though you never know.
How about just replacing the entire contents of the "if (decl_context
== FIELD)" block with:
if (declarator && declarator->kind == cdk_id)
error ("invalid storage class specified for data member %qD",
error ("invalid storage class specified for data member");
This would report the name only for some fields, eventhough the name
is known. NAME is guaranteed to be non-NULL, so all the code is trying
to do is categorize what NAME actually is.
Oh, yes, now I see:
if (name == NULL)
name = decl_context == PARM ? "parameter" : "type name";
So error ("storage class specified for %qs", name); is certainly a good
Yes, just use this one. That's OK. Thanks!
(Talking about "fields" in C++ doesn't make sense; they're "members". I
think it's odd when G++ makes up its own terms. :-))