[clang] [Clang] Emit error for duplicate mangled names within a lambda (PR #107581)
Kerry McLaughlin via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 13 07:04:00 PDT 2024
kmclaughlin-arm wrote:
>
> I'm having a bit of trouble understanding the way the new code is structured. What makes the definition of lambda call operators special here? Do we not call GetOrCreateLLVMFunction with IsForDefinition set?
When I added this error I incorrectly thought GetOrCreateLLVMFunction is not called with IsForDefinition set. Now that I've taken another look at it, I see that it is set and the reason the existing error is not emitted is because of the `!Entry->isDeclaration()` condition.
I have removed most of my changes and instead extended the `isDeclaration()` check to also consider whether this is lambda. I don't think it's correct to remove `isDeclaration()`; I believe this was added to allow a non-C++ declaration with a mangled name matching a C++ function (described in https://reviews.llvm.org/D11297).
https://github.com/llvm/llvm-project/pull/107581
More information about the cfe-commits
mailing list