[cfe-dev] [RFC] Preliminary patch to support MSVC __declspec(property)

Francois Pichet pichet2000 at gmail.com
Wed Dec 26 13:46:56 PST 2012


On Sat, Dec 22, 2012 at 10:11 AM, endlessroad1991 at gmail.com <
endlessroad1991 at gmail.com> wrote:

> Some guy from PathScale told me that AMP headers doesn't contain
> subscriptable property. And I looked at ATL headers, neither do they. So
> for these purposed, subscriptable property is not necessary.
> And I still think that subscriptable property is kind of messy...
> So I only implement non-subscriptable property.
>
> Brief:
> - Add a MSPropertyDecl, parallel to FieldDecl. Now property is separated
> from Field.
> - Add a MSPropertyRefExpr. It seems to be necessary, because we can't just
> create a PseudoObjectExpr.
>
> Current status:
> - Non-subscriptable property only.
> - Property can be inherited.
> - Get, Set, =, +=/-=/..., ++/-- works correctly.
> - Property type can be incomplete type, as function return type.
>
> Patch, and a "difficult" testcase attached.
> I'm quite happy with this version, because it's much simpler and cleaner.
> John - Thank you very much, for the MSPropertyDecl and PseudoObjectExpr
> tips. They are really crucial to this patch.
>
> --
> Best Regards, Tong Shen (沈彤)
>
>
Just one comment:

+  NamedDecl *NewFD;
+  AttributeList *MSPropertyAttr = 0;
+  for (auto it = D.getDeclSpec().getAttributes().getList();

Please remove the auto.
I don't think C++11 features are allowed in the clang code base yet.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121226/9f273566/attachment.html>


More information about the cfe-dev mailing list