Naveen Seth Hanig bc08e69959
[clang][modules] Fix crash in enum visibility lookup for C++20 header units (#166272)
Fixes #165445.

Fixes a crash when `ASTWriter::GenerateNameLookupTable` processes enum
constants from C++20 header units.

The special handling for enum constants, introduced in fccc6ee, doesn't
account for declarations whose owning module is a C++20 header unit. It
calls `isNamedModule()` on the result of
`getTopLevelOwningNamedModule()`, which returns null for header units,
causing a null pointer dereference.
2025-11-04 09:54:56 +08:00
..