[all-commits] [llvm/llvm-project] 66c191: [clang] Choose non-templated ctor as deduction gui...

Botond István Horváth via All-commits all-commits at lists.llvm.org
Wed Oct 4 09:11:58 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 66c19167f127013f6834ea1a316b783e57490939
      https://github.com/llvm/llvm-project/commit/66c19167f127013f6834ea1a316b783e57490939
  Author: Botond István Hprváth <56926027+HoBoIs at users.noreply.github.com>
  Date:   2023-10-04 (Wed, 04 Oct 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaOverload.cpp
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    M clang/test/CXX/over/over.match/over.match.funcs/over.match.class.deduct/p2.cpp

  Log Message:
  -----------
  [clang] Choose non-templated ctor as deduction guide unambiguously (#66487)

If there are two guides, one of them generated from a non-templated
constructor
and the other from a templated constructor, then the standard gives
priority to
the first. Clang detected ambiguity before, now the correct guide is
chosen.
The correct behavior is described in this paper:
http://wg21.link/P0620R0

Example for the bug: http://godbolt.org/z/ee3e9qG78

As an unrelated minor change, fix the issue
https://github.com/llvm/llvm-project/issues/64020,
which could've led to incorrect behavior if further development inserted
code after a call to
`isAddressSpaceSubsetOf()`, which specified the two parameters in the
wrong order.

---------

Co-authored-by: hobois <horvath.botond.istvan at gmial.com>




More information about the All-commits mailing list