<html><body><div>On 30 Sep, 2011,at 07:34 AM, Douglas Gregor <dgregor@apple.com> wrote:<br><br></div><div><blockquote type="cite"><div class="msg-quote"><div class="_stretch">Let's use the existing "annotate" attribute, which is a bit like the "user" attribute mentioned in (2) above, but already implemented in Clang. That way, Qt can have definitions such as:<br>
<br>
        #define Q_OBJECT __attribute__((annotate("qt_object")))<br>
<br>
Then, you patch need only:<br>
  <br>
  (a) add support for parsing attributes on access specifiers, and<br>
  (b) update libclang to expose the "annotate" attribute <br>
<br>
That should be sufficient, requires much less effort (and risk) than most of the other solutions, and won't require us to bring anything related to Qt into Clang itself.</div></div></blockquote><span> </span></div><div>Attached is a new patch, which adds parsing of attributes after a C++ access specifier. These attributes get propagated in the same manner as the access specifier. Then in c-index-test I changed the spelling of the annotate attribute to return the quoted string.</div><div><br></div><div>Question: should I add a check to disallow attributes other than the annotate attribute after an access specifier?</div><div><br></div><div>-- Erik.</div></body></html>