Tsche wrote:

>  ActOnEnumBody only runs for enum definitions that are parsed in the current 
> translation unit, so an EnumDecl deserialized from a PCH never gets a cache 
> entry and DenseMap::at() dereferences end(), crashing clang in builds without 
> assertions.

Can we instead insert into the cache when deserializing from PCH instead? The 
change you want to revert is needed for another (in-flight) patch - to properly 
diagnose missing/invalid bitwise operators for scoped flag_enums, we need some 
sort of work list. The cache flag_enum cache was _almost_ usable for that, 
except that we previously didn't have any sorts of guarantees that it will be 
populated (since populating was done lazily).

Thanks for pointing this out though, I was not aware that this was missing one 
reachable path (that wasn't there before the followup cleanup wrt 
gnu::flag_enum).

https://github.com/llvm/llvm-project/pull/223244
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to