[PATCH] D26846: __uuidof() and declspec(uuid("...")) should be allowed on enumeration types

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 21 08:51:03 PST 2016


On Wed, Dec 21, 2016 at 11:47 AM, Reid Kleckner <rnk at google.com> wrote:
> On Wed, Dec 21, 2016 at 8:36 AM, Aaron Ballman <aaron.ballman at gmail.com>
> wrote:
>>
>> That change appears to have been lost, and I would like to see them
>> brought back. I think they may have gotten lost during the rebase, as
>> they were present in https://reviews.llvm.org/D26846?id=78569.
>
>
> I removed the tablegen logic because it was dead after changing the uuid
> SubjectList to this:
>   let Subjects = SubjectList<[Record, Enum], WarnDiag,
> "ExpectedEnumOrClass">;
>
> It was necessary to go from CXXRecord to Record here so that we would accept
> __uuid on structs in C and then reject the attribute as being C++-only
> later.
>
> Feel free to add the case back. From my reading of the code, it seems like
> CalculateDiagnostic isn't intended to cover every case.

It's intended to cover the common ones; Record or Enum seems like
something we will hit in the future as well, which is why it'd be nice
to have. However, I still have hopes to make a more general solution
so that we don't need to do this dance in the future, so it's not a
high priority.

~Aaron


More information about the cfe-commits mailing list