You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
Extended Description
When compiled with Clang ToT, the following code incorrectly believes that allocator is non-trivial, when it should be trivial:
cat <<EOF | clang++ -xc++ - -std=c++2a -fsyntax-only
#include <type_traits>
template
struct allocator {
allocator() = default;
allocator() requires(!std::is_void_v) { }
};
static_assert(__is_trivial(allocator));
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.
The text was updated successfully, but these errors were encountered: