[all-commits] [llvm/llvm-project] 616613: [Clang] [Sema] Fix a crash when a `friend` functio...

Sirraide via All-commits all-commits at lists.llvm.org
Wed Apr 16 05:09:21 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 616613c80b75614736d0781d12c0e1237d79738f
      https://github.com/llvm/llvm-project/commit/616613c80b75614736d0781d12c0e1237d79738f
  Author: Sirraide <aeternalmail at gmail.com>
  Date:   2025-04-16 (Wed, 16 Apr 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaDecl.cpp
    M clang/test/SemaCXX/cxx2c-delete-with-message.cpp

  Log Message:
  -----------
  [Clang] [Sema] Fix a crash when a `friend` function is redefined as deleted (#135679)

NB: This only fixes the crash introduced in Clang 19; we still accept
this code even though we shouldn’t:
```c++
struct S {
    friend int f() { return 3; }
    friend int f() = delete;
};
```
I tried figuring out a way to diagnose this redeclaration, but it seems
tricky because I kept running into issues around defaulted comparison
operators. From my testing, however, this fix here would still be
required even once we do start diagnosing this.

Fixes #135506.



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