[PATCH] D91659: Allow enum typedefs to be referenced with the 'enum' specifier under MSVC compat mode

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 16 14:41:46 PST 2020


rsmith added a comment.

In D91659#2458872 <https://reviews.llvm.org/D91659#2458872>, @rnk wrote:

> In D91659#2458639 <https://reviews.llvm.org/D91659#2458639>, @rsmith wrote:
>
>> 
>
> What is the issue with the current structure, ActOnTag produces the wrong AST node, an ElaboratedType, but we want to produce a TypedefType?

I don't think we want to introduce a new declaration at all in this compatibility case; I think we want to act as if the `enum` keyword were omitted entirely (the caller should set a different kind of `TypeSpecType` on the `DeclSpec` in this case). Maybe the simplest thing would be to add a new optional `TypeResult*` out parameter to `ActOnTag` that's only set by the call in `ParseEnumSpecifier` (and then only for the `TUK_Reference` case). Then `ParseEnumSpecifier` can set a `TST_typename` type specifier in this case instead of a `TST_enum`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91659/new/

https://reviews.llvm.org/D91659



More information about the cfe-commits mailing list