When compiled with Clang ToT, the following code incorrectly believes that allocator<void> is non-trivial, when it should be trivial: cat <<EOF | clang++ -xc++ - -std=c++2a -fsyntax-only #include <type_traits> template <class T> struct allocator { allocator() = default; allocator() requires(!std::is_void_v<T>) { } }; static_assert(__is_trivial(allocator<void>)); int main() { } EOF This works on GCC. Godbolt link: https://godbolt.org/z/4osMGWTne. I tracked the issue down a bit, and I think the issue is that when QualType::isTrivialType() queries whether the class declaration has a non-trivial default constructor (via CXXRecordDecl::hasNonTrivialDefaultConstructor()), it incorrectly believes that it's the case.
I'm not a Clang expert, but I think CXXRecordDecl::addedMember() is incorrectly setting up this declaration: allocator() requires(!std::is_void_v<T>) { } // where T = void as a special member function that is non-trivial and user-provided, even though should (?) not be considered because of the trailing requires clause.
This is part of P0848R3, which we don't yet implement.
Oh, thanks, I thought http://wg21.link/P0848 was just adding the trailing requires clauses to constructors with that use case in mind, but I had it wrong. So this is simply not implemented. I guess we can close as INVALID, since this is not a bug, merely a missing feature.