[PATCH] D147782: [clang] Fix 'operator=' lookup in nested class

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 7 16:04:26 PDT 2023


rsmith added a comment.

Ah, I see.

In D147782#4251185 <https://reviews.llvm.org/D147782#4251185>, @J-Camilleri wrote:

> 2. Have the `IdResolver` declarations ordered by scope, going from most nested to least nested.

This is the intended behavior. But `Sema::PushOnScopeChains` doesn't correctly handle declarations being added in non-lexical order, except for label declarations, which are special-cased.

I think probably the cleanest fix would be to add a flag to `PushOnScopeChains` to indicate that the scope to which we're adding the name may not be the innermost scope, and so we should find the correct insertion point (like we already do for `LabelDecl`s). We should then set that flag when calling `PushOnScopeChains` with a scope that's not necessarily the innermost scope, such as from `Sema::DeclareImplicit*`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147782/new/

https://reviews.llvm.org/D147782



More information about the cfe-commits mailing list