[llvm-bugs] [Bug 41915] New: Implement CWG 1496

via llvm-bugs llvm-bugs at lists.llvm.org
Thu May 16 12:40:44 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=41915

            Bug ID: 41915
           Summary: Implement CWG 1496
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++'17
          Assignee: unassignedclangbugs at nondot.org
          Reporter: Casey at Carter.net
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190516/1688554f/attachment.html>


More information about the llvm-bugs mailing list