Re: Attribute position in parsing class member function declarations

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Attribute position in parsing class member function declarations

John Thompson
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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]

<attr_pos2.patch>_______________________________________________




--
John Thompson
[hidden email]


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Loading...