[cfe-dev] [PATCH]: Sema support for C++ classes

Argiris Kirtzidis akyrtzi at gmail.com
Fri Jun 27 18:56:29 PDT 2008

Hi Eli,

Eli Friedman wrote:
> On Fri, Jun 27, 2008 at 5:23 PM, Argiris Kirtzidis <akyrtzi at gmail.com> wrote:
>>> +  assert(II && "No identifier ?");
>>> does this abort on unnamed bitfields like "int : 4;" ?
>> This requires changes to the parser too. Can we fix it after the patch
>> goes in so I can make one "unified" Parser+Sema+test commit, specific to
>> this case ?
> I'd suggest figuring out whatever parser changes are needed, commit
> that fix, then integrate the Sema changes into the next revision of
> this patch; the parser fix looks mostly independent.

Sounds reasonable.

> On a somewhat related note, the comment "// Attributes are only
> allowed on the second declarator." in ParseCXXClassMemberDeclaration
> is wrong, I think; g++ accepts "class C {int a
> __attribute((mode(HI)));};".

I copied the attribute parsing from ParseStructDeclaration.
The attribute you mention is parsed some lines before with:

>     // If attributes exist after the declarator, parse them.
>     if (Tok.is(tok::kw___attribute))
>       DeclaratorInfo.AddAttributes(ParseAttributes());

Nevertheless, that comment seems a bit misleading to me too..


More information about the cfe-dev mailing list