[MS] Fix assert handling enum forward decls in hasVisibleDefinition
authorReid Kleckner <rnk@google.com>
Fri, 3 Apr 2020 20:42:23 +0000 (13:42 -0700)
committerReid Kleckner <rnk@google.com>
Fri, 3 Apr 2020 23:46:07 +0000 (16:46 -0700)
commite62dc1f6252c1dcdcc2a64e8e3b07a32412e9d89
tree48e4de1ccf844de968f0e20b1506b9214cf2195a
parent98f77828a98fd05760987598db1355cf08b643bd
[MS] Fix assert handling enum forward decls in hasVisibleDefinition

An enum may be considered to be a complete type if it was forward
declared. It may be declared with a fixed underlying type, or, in MSVC
compatiblity mode, with no type at all.

Previously, the code was written with special handling for fixed enums.
I generalized the code to check if the underlying integer type is known,
which should be the case when targetting the MSVC C++ ABI.

Fixes PR45409
clang/lib/Sema/SemaType.cpp
clang/test/Modules/Inputs/ms-enums/A.h [new file with mode: 0644]
clang/test/Modules/Inputs/ms-enums/B.h [new file with mode: 0644]
clang/test/Modules/Inputs/ms-enums/module.map [new file with mode: 0644]
clang/test/Modules/ms-enums.cpp [new file with mode: 0644]