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

John Thompson john.thompson.jtsoftware at gmail.com
Fri Dec 4 11:55:34 PST 2009


Doug,

Sorry, I missed noticing your response.

I'm not sure what to do here.  The Clang docs (
http://clang-analyzer.llvm.org/annotations.html#attr_cf_returns_retained)
note that as a Clang-specific attribute.  Do you mean that we should put out
a warning if some more strict standard mode is used, or that there should be
a warning unless clang-specific attributes are explicitly enabled by some
new option?  Or should the test use some sort of "#if
__has_feature(attribute_cf_returns_retained)" conditional?  Or is the
attribute not allowed after the function declation?   Please instruct.
-John
On Wed, Nov 25, 2009 at 4:09 PM, Douglas Gregor <dgregor at apple.com> wrote:

>
>  On Nov 25, 2009, at 3:56 PM, John Thompson wrote:
>
>  I'm not sure this is optimal, but it seems to fix Bug 5605.
>
>
> The parsing is fine, but this is missing some kind of diagnostic, because
> GCC rejects the test case:
>
>  blackthorn:~ dgregor$ gcc t.c
> t.c:3: warning: ‘cf_returns_retained’ attribute directive ignored
> t.c:3: error: expected ‘,’ or ‘;’ before ‘{’ token
> blackthorn:~ dgregor$ g++ t.c
> t.c:2: error: attributes are not allowed on a function-definition
>
> - Doug
>
>
>  -John
>
> On Wed, Nov 25, 2009 at 3:13 PM, John Thompson <
> john.thompson.jtsoftware at gmail.com> wrote:
>
>> Thanks.
>>
>> >Any chance you're also interested in tackling the related PR here?
>>
>> Sure.  I thought it was the same issue, but I guess it's a different code
>> path.  I'm working on it.
>>
>> -John
>> --
>> John Thompson
>> John.Thompson.JTSoftware at gmail.com
>>
>> <attr_pos2.patch>_______________________________________________
>
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
>


-- 
John Thompson
John.Thompson.JTSoftware at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20091204/471e8b67/attachment.html>


More information about the cfe-dev mailing list