[PATCH] D37089: [Sema] Error out early for tags defined inside an enumeration.

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 20 11:17:19 PDT 2017


vsapsai added a comment.

Thanks for following up, Alberto. I haven't expected such a use case. It is possible to achieve the same with `LSA_SIZEOF_SA = sizeof(((len_and_sockaddr *)0)->u)` but I don't like it and don't want to force developers using such approach.

For solving this problem I think to restrict error only to C++ and to allow tags inside enums for C. Alberto, what do you think, will it work for you? And from implementation perspective allowing tags in enums for C should be safe because things go haywire for C++ while checking access rules and C doesn't have access rules.


Repository:
  rL LLVM

https://reviews.llvm.org/D37089





More information about the cfe-commits mailing list