[all-commits] [llvm/llvm-project] 000ec5: [Clang] Adjust triviality computation in QualType:...

Roy Jacobson via All-commits all-commits at lists.llvm.org
Wed Feb 22 13:27:25 PST 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 000ec50ef511243ec46c249c06d7a82cedf6d538
  Author: Roy Jacobson <roi.jacobson1 at gmail.com>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/AST/Type.cpp
    M clang/test/SemaCXX/constrained-special-member-functions.cpp

  Log Message:
  [Clang] Adjust triviality computation in QualType::isTrivialType to C++20 cases.

Up to C++20, hasDefaultConstructor and !hasNonTrivialDefaultConstructor together implied
hasTrivialDefaultConstructor. In C++20, a constructor might be ineligible and can set
hasDefaultConstructor without setting hasNonTrivialDefaultConstructor.

Fix this by querying hasTrivialDefaultConstructor instead of hasDefaultConstructor.

I'd like to backport this to Clang 16.
I only change isTrivialType and in a way that should only affect code that uses
constrained constructors, so I think this is relatively safe to backport.

Fixes https://github.com/llvm/llvm-project/issues/60697

Reviewed By: aaron.ballman

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

More information about the All-commits mailing list