[cfe-commits] [PATCH] Allow typedef with unnecessary "typename" when ms-extensions are enabled.

Richard Smith richard at metafoo.co.uk
Wed May 2 15:11:41 PDT 2012


On Wed, May 2, 2012 at 2:57 PM, William Wilson <will at indefiant.com> wrote:

> > Newbie question: I'll also have a go at this, but as the token is
> > effectively ignored do I use tok::unknown for it's kind or
> > tok::annot_typename? Or alternatively, am I barking up the wrong tree
> > entirely?
>

You should consume the 'typename' token, and try to recover as if the
'typename' keyword were not present, following the logic present later on
in that function. As a special case, if that later logic were to find that
the tokens after the 'typename' keyword can't be annotated as a type name,
you should produce a hard error (even with MS extensions enabled).

(In particular, for 'typename identifier', it will be the identifier you
annotate, not the 'typename' keyword.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120502/4ea25b05/attachment.html>


More information about the cfe-commits mailing list