[clang] [clang]Fix name lookup crash (PR #190484)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 4 15:22:06 PDT 2026
Serosh-commits wrote:
> This seems to be attempting the absolute opposite of what the code is supposed to be doing here. What contexts ARE we getting here that we should be skipping?
i think here the context is a `RecordDecl` (an anonymous union), which isn’t what this part of the code expects because of the malformed input, that union ends up being used as the lookup entity inside a `TemplateParamScope` then `CppLookupName` hits this 2nd loop, which is only meant for namespace or file-level lookups, so it blows up
since the member lookup for classes/unions is already handled earlier so i thought it will make sense to just skip these cases here
so yeah instead of assuming the parser always gives the right context it’s safer to just check the context type here i guess
https://github.com/llvm/llvm-project/pull/190484
More information about the cfe-commits
mailing list