[cfe-dev] Attribute position in parsing class member function declarations

John Thompson john.thompson.jtsoftware at gmail.com
Tue Nov 24 07:42:18 PST 2009


Here's an updated version of my attempt to fix a problem with attributes
coming after a declaration, but before other stuff, plus the beginnings of
C++ test for it.  Sorry, I don't know attributes well, so I didn't try to
make it more exhaustive.

Could someone check this out for me, or do a more correct fix?

Thanks.

-John
On Thu, Nov 19, 2009 at 8:23 PM, John Thompson <
john.thompson.jtsoftware at gmail.com> wrote:

> Oh, I'm sorry, I forgot to hit save after editing the patch.  Here it is
> again with just the relevant changes.  I also beefed up the C test a little,
> but it just occured to me that there probably should be an additional test
> file in C++, nonetheless here's a start.
>
>
> On Thu, Nov 19, 2009 at 8:04 PM, Sean Hunt <rideau3 at gmail.com> wrote:
>
>>  John Thompson wrote:
>>
>>> I have a couple of cases where I'm getting an error from Clang from code
>>> that compiles with gcc.
>>>  The code reduces to something like (members in a class declaration):
>>>  virtual void Log(const char*, ...) __attribute__ ((
>>> __format__(__printf__,1,2) )) = 0;
>>> virtual void PushContextMessage(const char* , ...) __attribute__ ((
>>> __format__(__printf__,1,2) )) {};
>>> Both get "expected ';' at end of declaration list" errors.
>>>  The enclosed patch takes a stab at fixing it with some copy/paste
>>> programming, assuming it needs fixing, but you might have a better fix or
>>> feedback.
>>>  -John
>>>
>>
>> There's a lot of code in that patch that isn't directly related to the
>> problem - could you please post a patch of just the specific changes you
>> would make to address this issue?
>>
>> Sean
>>
>
>
>
>  --
> John Thompson
> John.Thompson.JTSoftware at gmail.com
>
>


-- 
John Thompson
John.Thompson.JTSoftware at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20091124/440a9fa9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: attr_pos1.patch
Type: application/octet-stream
Size: 1019 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20091124/440a9fa9/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cxx-attributes.cpp
Type: application/octet-stream
Size: 252 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20091124/440a9fa9/attachment-0001.obj>


More information about the cfe-dev mailing list