[all-commits] [llvm/llvm-project] c4724f: Fix assertion failure during conversion function o...

Daniel M. Katz via All-commits all-commits at lists.llvm.org
Mon Aug 12 10:11:43 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c4724f60384917ef0f0e8cc32702fe02c3b3b1c9
      https://github.com/llvm/llvm-project/commit/c4724f60384917ef0f0e8cc32702fe02c3b3b1c9
  Author: Daniel M. Katz <katzdm at gmail.com>
  Date:   2024-08-12 (Mon, 12 Aug 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaTemplateDeduction.cpp
    A clang/test/SemaCXX/PR98671.cpp

  Log Message:
  -----------
  Fix assertion failure during conversion function overload resolution. (#98671)

When clang is built with assertions, an otherwise silent (and seemingly
innocuous) assertion failure from `SemaConcept.cpp` is triggered by the
following program:

```cpp
struct S {
  operator int();
  template <typename T> operator T();
};

constexpr auto r = &S::operator int;
```

The function in question compares the "constrained-ness" of `S::operator
int` and `S::operator T<int>`; the template kind of the former is
`TK_NonTemplate`, whereas the template kind of the later is
`TK_FunctionTemplateSpecialization`. The later kind is not "expected" by
the function, thus the assertion-failure.



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