[cfe-dev] [PATCH] C++ nested-names (Parser) and annotation tokens

Doug Gregor doug.gregor at gmail.com
Mon Nov 3 09:44:21 PST 2008


On Mon, Nov 3, 2008 at 6:55 AM, Argiris Kirtzidis <akyrtzi at gmail.com> wrote:
> If I understand correctly, you mean when instantiating a template that
> contains
>  SomeClass<T>::x    // 'T' is a template parameter
> the DeclContext for "SomeClass<T>::" will be resolved at instatiation time,
> not parsing time, so we need to have the 'CurContext' around.
> Is this correct ?

Yes, that's the idea.

> No, ActOnCXXEnterDeclaratorScope will just set 'CurContext' to the context
> of the nested-name defined in the declarator.
> The difference is in how contexts are 'popped' in Sema. Currently, when
> 'CurContext' is popped we switch to its parent, but this won't work for
> contexts caused by nested names (when they are popped, 'CurContext' should
> switch to the declaration context before the nested-name was introduced).

Okay, I like this approach. Thanks!

  - Doug



More information about the cfe-dev mailing list