[all-commits] [llvm/llvm-project] 21eb1a: [Concepts] Implement overload resolution for destr...

Roy Jacobson via All-commits all-commits at lists.llvm.org
Sat Jun 18 14:30:53 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 21eb1af469c3257606aec2270d544e0e8ecf77b2
  Author: Roy Jacobson <roi.jacobson1 at gmail.com>
  Date:   2022-06-19 (Sun, 19 Jun 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/AST/Decl.h
    M clang/include/clang/AST/DeclBase.h
    M clang/include/clang/AST/DeclCXX.h
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/AST/Decl.cpp
    M clang/lib/AST/DeclCXX.cpp
    M clang/lib/AST/TextNodeDumper.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    M clang/test/AST/ast-dump-decl.cpp
    A clang/test/AST/overloaded-destructors.cpp
    A clang/test/CXX/class/class.dtor/p4.cpp
    M clang/test/CXX/over/over.match/over.match.viable/p3.cpp
    M clang/test/SemaTemplate/destructor-template.cpp

  Log Message:
  [Concepts] Implement overload resolution for destructors (P0848)

This patch implements a necessary part of P0848, the overload resolution for destructors.
It is now possible to overload destructors based on constraints, and the eligible destructor
will be selected at the end of the class.

The approach this patch takes is to perform the overload resolution in Sema::ActOnFields
and to mark the selected destructor using a new property in FunctionDeclBitfields.

CXXRecordDecl::getDestructor is then modified to use this property to return the correct

This closes https://github.com/llvm/llvm-project/issues/45614.

Reviewed By: #clang-language-wg, erichkeane

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

More information about the All-commits mailing list