[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
Loading
Please sign in to comment