This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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; the comment:

/* 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");
 return error_mark_node;


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. :-))

Mark Mitchell
CodeSourcery, LLC
(916) 791-8304

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]