https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64489

            Bug ID: 64489
           Summary: A simple struct wrapping a const int is not trivially
                    copyable
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ville.voutilainen at gmail dot com
                CC: jason at redhat dot com

struct X {const int val;};
static_assert(__is_trivially_copyable(const int), "");
static_assert(__is_trivially_copyable(X), "");

The second assertion fails. It shouldn't, because const int has
no non-trivial copy/move constructors or assignment operators, and
the first assertion succeeds. Clang accepts the code.

Reply via email to