-
Notifications
You must be signed in to change notification settings - Fork 15.7k
Open
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++17clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"cwg-issueAn issue that was filed to the Core Working GroupAn issue that was filed to the Core Working Group
Description
| Bugzilla Link | 41915 |
| Version | trunk |
| OS | Windows NT |
| CC | @kamleshbhalui,@riccibruno,@zygoloid,@tstellar |
Extended Description
Per CWG 1496 and C++17, a trivial class "...has one or more default constructors, all of which are either trivial or deleted and at least one of which is not deleted."
Nevertheless, clang trunk diagnoses this well-formed TU (https://godbolt.org/z/a5Aflw):
template<class T>
constexpr bool is_trivial = __is_trivially_constructible(T)
&& __is_trivially_copyable(T);
struct NonTrivial { NonTrivial() = delete; };
static_assert(!is_trivial<NonTrivial>); // succeeds
static_assert(!__is_trivial(NonTrivial)); // fails (and should not)as ill-formed since __is_trivial(NonTrivial) is incorrectly true.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++17clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"cwg-issueAn issue that was filed to the Core Working GroupAn issue that was filed to the Core Working Group