+2019-05-20 Marek Polacek <polacek@redhat.com>
+
+ CWG 2094 - volatile scalars are trivially copyable.
+ PR c++/85679
+ * tree.c (trivially_copyable_p): Don't check CP_TYPE_VOLATILE_P for
+ scalar types.
+
2019-05-20 Marek Polacek <polacek@redhat.com>
* pt.c (convert_template_argument): Add a diagnostic for the
&& !TYPE_HAS_COMPLEX_MOVE_ASSIGN (t)
&& TYPE_HAS_TRIVIAL_DESTRUCTOR (t));
else
- return !CP_TYPE_VOLATILE_P (t) && scalarish_type_p (t);
+ /* CWG 2094 makes volatile-qualified scalars trivially copyable again. */
+ return scalarish_type_p (t);
}
/* Returns 1 iff type T is a trivial type, as defined in [basic.types] and
+2019-05-20 Marek Polacek <polacek@redhat.com>
+
+ CWG 2094 - volatile scalars are trivially copyable.
+ PR c++/85679
+ * g++.dg/ext/is_trivially_constructible1.C: Change the expected result
+ for volatile int.
+ * g++.dg/ext/is_trivially_copyable.C: New test.
+
2019-05-20 Marek Polacek <polacek@redhat.com>
* g++.dg/ext/utf8-2.C: Accept both "char" and "char8_t" in aka.
SA(!__is_trivially_constructible(D));
SA(__is_trivially_copyable(int));
-SA(!__is_trivially_copyable(volatile int));
+// Changed in CWG 2094, which made volatile-qualified scalars trivially
+// copyable.
+SA(__is_trivially_copyable(volatile int));
struct E1 {const int val;};
SA(__is_trivially_copyable(E1));
--- /dev/null
+// CWG 2094 - volatile scalars are trivially copyable.
+// PR c++/85679
+// { dg-do compile { target c++11 } }
+
+#define SA(X) static_assert((X),#X)
+
+struct S{};
+
+SA(__is_trivially_copyable(S volatile));
+SA(__is_trivially_copyable(S volatile[]));
+SA(__is_trivially_copyable(S const volatile));
+SA(__is_trivially_copyable(S const volatile[]));
+SA(__is_trivially_copyable(int volatile));
+SA(__is_trivially_copyable(int volatile[]));
+SA(__is_trivially_copyable(int const volatile));
+SA(__is_trivially_copyable(int const volatile[]));
+2019-05-20 Marek Polacek <polacek@redhat.com>
+
+ CWG 2094 - volatile scalars are trivially copyable.
+ PR c++/85679
+ * testsuite/20_util/is_trivially_copyable/value.cc: Change the expected
+ result for volatile int.
+
2019-05-20 Jonathan Wakely <jwakely@redhat.com>
* testsuite/17_intro/names.cc: Do not check 'ptr' on Solaris.
static_assert(test_property<is_trivially_copyable,
int>(true), "");
+ // Changed in CWG 2094, which made volatile-qualified scalars trivially
+ // copyable.
static_assert(test_property<is_trivially_copyable,
- volatile int>(false), "");
+ volatile int>(true), "");
static_assert(test_property<is_trivially_copyable,
TType>(true), "");
static_assert(test_property<is_trivially_copyable,