[all-commits] [llvm/llvm-project] b9f767: [Clang] Fix lambda CheckForDefaultedFunction(...) ...

Shafik Yaghmour via All-commits all-commits at lists.llvm.org
Tue Aug 30 18:13:12 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b9f767884669db0b5a56d87b0e8733614d8f884d
      https://github.com/llvm/llvm-project/commit/b9f767884669db0b5a56d87b0e8733614d8f884d
  Author: Shafik Yaghmour <shafik.yaghmour at intel.com>
  Date:   2022-08-30 (Tue, 30 Aug 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/test/SemaCXX/constant-expression-cxx2a.cpp

  Log Message:
  -----------
  [Clang] Fix lambda CheckForDefaultedFunction(...) so that it checks the CXXMethodDecl is a special member function before attempting to call DefineDefaultedFunction(...)

In Sema::CheckCompletedCXXClass(...) It used a lambda CheckForDefaultedFunction
the CXXMethodDecl passed to CheckForDefaultedFunction may not be a special
member function and so before attempting to apply functions that only apply to
special member functions it needs to check. It fails to do this before calling
DefineDefaultedFunction(...). This PR adds that check and test to verify we no
longer crash.

This fixes https://github.com/llvm/llvm-project/issues/57431

Differential Revision: https://reviews.llvm.org/D132906




More information about the All-commits mailing list