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

2020-11-17 Thread Shivanshu Goyal via Phabricator via cfe-commits
shivanshu3 marked 3 inline comments as done. shivanshu3 added a comment. Thank you very much for the review @rsmith! Comment at: clang/lib/Sema/SemaDecl.cpp:15752-15754 + bool AnonymousEnumEligible = getLangOpts().MSVCCompat && +

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

2020-11-17 Thread Shivanshu Goyal via Phabricator via cfe-commits
shivanshu3 updated this revision to Diff 305971. shivanshu3 added a reviewer: rsmith. shivanshu3 added a comment. Addressing some of rsmith's comments: - Add a test case where an enum variable is declared in the same scope as the enum definition - Fix a style issue with parentheses - Simplify

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

2020-11-17 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:15545-15546 +// is only used for C code. +if (getLangOpts().MSVCCompat && (Kind == TTK_Enum) && Previous.empty() && +(TUK == TUK_Reference)) { + LookupResult TypedefEnumLookup(*this, Name,

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

2020-11-17 Thread Shivanshu Goyal via Phabricator via cfe-commits
shivanshu3 created this revision. shivanshu3 added reviewers: zahen, tiagoma, rnk, hans. Herald added a project: clang. Herald added a subscriber: cfe-commits. shivanshu3 requested review of this revision. Goal: Clang should be able to parse the following code with '-fms-compatibility' because