[cfe-dev] Using declarations

AlisdairM(public) public at alisdairm.net
Thu Jun 11 05:02:20 PDT 2009


> -----Original Message-----
> From: cfe-dev-bounces at cs.uiuc.edu [mailto:cfe-dev-bounces at cs.uiuc.edu]
> On Behalf Of David Chisnall
> Sent: 11 June 2009 11:57
> To: Camille Troillard
> Cc: Anis Ahmad; cfe-dev at cs.uiuc.edu
> Subject: Re: [cfe-dev] New to clang

> It's not very well updated though, for example -ftrapv was implemented
> a while ago but is still there.  Using declarations is top of the C++
> list, but I've seen a lot of patches related to that hitting the list
> recently, so it's not a good idea for someone to start working on
> independently.  It also tells you to use the old ccc driver instead of
> clang for testing...

(note change of subject)

I would be interested in any work on using declarations, as I have been
scoping that out for my next project after the Unicode work.

Again, I was looking for a simple idea (C++0x type alias - should be able to
hook directly into typedef code) and discovered a much deeper hole.  So my
concern is that any work here looks ahead to all the possible directions
that C++0x will go.

In short, if we see the keyword 'using' we may be about to parse:

i/ a using directive for namespaces
ii/ a C++98 using declaration
iii/ a C++0x inheriting constructor declaration -> declares *a set* of
constructors
iv/ a C++0x alias declaration => this declares a C++98 typedef name
v/ a C++0x template alias, if using preceded by a template declaration
vi/ a number of concept-related variants that I don't quite grok yet.

The current code is only annotated with the grammar for (i) and (ii)

Personally, I would rather see a broad set of test-cases before starting an
implementation, as there are some nasty cases to catch such as different
rules for duplicate identifiers at namespace or class scope etc.

[Note I have only been looking at problems and scratching my head on where
to start, no real thoughts on implementation yet!]

AlisdairM






More information about the cfe-dev mailing list