Skip to content

Commit 9b2ab41

Browse files
committed
Revert "[MS] Fix assert handling enum forward decls in hasVisibleDefinition"
This reverts commit e62dc1f. Reverting as per discussion with the patch author. This patch causes module import error, but there was no intended behavior change for code that does not use Microsoft extensions.
1 parent e84bbe9 commit 9b2ab41

File tree

5 files changed

+4
-20
lines changed

5 files changed

+4
-20
lines changed

clang/lib/Sema/SemaType.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8120,10 +8120,10 @@ bool Sema::hasVisibleDefinition(NamedDecl *D, NamedDecl **Suggested,
81208120
} else if (auto *ED = dyn_cast<EnumDecl>(D)) {
81218121
if (auto *Pattern = ED->getTemplateInstantiationPattern())
81228122
ED = Pattern;
8123-
if (OnlyNeedComplete && !ED->getIntegerType().isNull()) {
8124-
// If the enum has an integer type, it may have been forward declared.
8125-
// Since we're only looking for a complete type (not a definition), any
8126-
// visible declaration of it will do.
8123+
if (OnlyNeedComplete && ED->isFixed()) {
8124+
// If the enum has a fixed underlying type, and we're only looking for a
8125+
// complete type (not a definition), any visible declaration of it will
8126+
// do.
81278127
*Suggested = nullptr;
81288128
for (auto *Redecl : ED->redecls()) {
81298129
if (isVisible(Redecl))

clang/test/Modules/Inputs/ms-enums/A.h

Lines changed: 0 additions & 1 deletion
This file was deleted.

clang/test/Modules/Inputs/ms-enums/B.h

Lines changed: 0 additions & 1 deletion
This file was deleted.

clang/test/Modules/Inputs/ms-enums/module.map

Lines changed: 0 additions & 2 deletions
This file was deleted.

clang/test/Modules/ms-enums.cpp

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)