[all-commits] [llvm/llvm-project] b1c960: [Clang] Implement P0848 (Conditionally Trivial Spe...

Roy Jacobson via All-commits all-commits at lists.llvm.org
Thu Aug 25 14:53:10 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b1c960fc6dc2891c8d2ca09c184572ca0857ba15
      https://github.com/llvm/llvm-project/commit/b1c960fc6dc2891c8d2ca09c184572ca0857ba15
  Author: Roy Jacobson <roi.jacobson1 at gmail.com>
  Date:   2022-08-26 (Fri, 26 Aug 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/AST/DeclCXX.cpp
    M clang/lib/Frontend/InitPreprocessor.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    A clang/test/AST/conditionally-trivial-smfs-2.cpp
    A clang/test/AST/conditionally-trivial-smfs.cpp
    A clang/test/SemaCXX/constrained-special-member-functions.cpp
    M clang/www/cxx_status.html

  Log Message:
  -----------
  [Clang] Implement P0848 (Conditionally Trivial Special Member Functions)

This patch implements P0848 in Clang.

During the instantiation of a C++ class, in `Sema::ActOnFields`, we evaluate constraints for all the SMFs and compare the constraints to compute the eligibility. We defer the computation of the type's [copy-]trivial bits from addedMember to the eligibility computation, like we did for destructors in D126194. `canPassInRegisters` is modified as well to better respect the ineligibility of functions.

Note: Because of the non-implementation of DR1734 and DR1496, I treat deleted member functions as 'eligible' for the purpose of [copy-]triviallity. This is unfortunate, but I couldn't think of a way to make this make sense otherwise.

Reviewed By: #clang-language-wg, cor3ntin, aaron.ballman

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




More information about the All-commits mailing list