[all-commits] [llvm/llvm-project] a9dafc: [Sema] Compare canonical conversion function (#154...

Jonas Hahnfeld via All-commits all-commits at lists.llvm.org
Mon Oct 6 01:35:10 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a9dafc9bdcfc1090d0744d0c708c5d133bc0fd84
      https://github.com/llvm/llvm-project/commit/a9dafc9bdcfc1090d0744d0c708c5d133bc0fd84
  Author: Jonas Hahnfeld <jonas.hahnfeld at cern.ch>
  Date:   2025-10-06 (Mon, 06 Oct 2025)

  Changed paths:
    M clang/lib/Sema/SemaOverload.cpp
    A clang/test/Modules/pr133057.cpp

  Log Message:
  -----------
  [Sema] Compare canonical conversion function (#154158)

With lazy template loading, it is possible to find non-canonical
FunctionDecls, depending on when redecl chains are completed. This
is a problem for templated conversion operators that would allow to
call either the copy assignment or the move assignment operator.
This ambiguity is resolved by isBetterReferenceBindingKind (called
from CompareStandardConversionSequences) ranking rvalue refs over
lvalue refs.
    
Unfortunately, this fix is hard to test in isolation without the
changes in https://github.com/llvm/llvm-project/pull/133057 that
make lazy template loading more likely to complete redecl chains
at "inconvenient" times. The added reproducer passes before and
after this commit, but would have failed with the proposed changes
of the linked PR.
    
Kudos to Maksim Ivanov for providing an initial version of the
reproducer that I further simplified.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list