[PATCH] D43576: Solution to fix PR27066 - Redefinition with same mangled name as another definition (dllexport and uuid)
Richard Smith - zygoloid via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 26 15:04:46 PST 2018
rsmith added a comment.
In https://reviews.llvm.org/D43576#1019703, @zahiraam wrote:
> Currently this declaration:
> struct
> __declspec(uuid("{DDB47A6A-0F23-11D5-9109-00E0296B75D3}"))
> S1;
>
> a CXXRecordDecl type is generated with attributes (the uuid being an attribute). Are you proposing that instead a new type is generated for S1 say something like CXXUuidRecord? And create also a new TagType that corresponds to this new Decl?
No. Concretely, I'd suggest we create a new `UuidDecl` object representing the `_GUID` object. An instance of `UuidDecl` would be created and owned by the `uuid` attribute, and `__uuidof(X)` would denote the `UuidDecl` owned by the `uuid` attribute on the `CXXRecordDecl`. We'd also need some way to form redeclaration chains for `UuidDecl`s (which means we'll need a map from UUID to `UuidDecl` somewhere, perhaps on the `ASTContext`).
https://reviews.llvm.org/D43576
More information about the cfe-commits
mailing list