Backported from mainline
2019-10-01 Jakub Jelinek <jakub@redhat.com>
PR c++/91925
* c-warn.c (check_alignment_of_packed_member): Ignore FIELD_DECLs
with NULL DECL_FIELD_OFFSET.
* g++.dg/conversion/packed2.C: New test.
From-SVN: r277255
2019-10-21 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2019-10-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/91925
+ * c-warn.c (check_alignment_of_packed_member): Ignore FIELD_DECLs
+ with NULL DECL_FIELD_OFFSET.
+
2019-09-27 Jakub Jelinek <jakub@redhat.com>
PR c++/88203
/* Check alignment of the data member. */
if (TREE_CODE (field) == FIELD_DECL
&& (DECL_PACKED (field) || TYPE_PACKED (TREE_TYPE (field)))
+ /* Ignore FIELDs not laid out yet. */
+ && DECL_FIELD_OFFSET (field)
&& (!rvalue || TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE))
{
/* Check the expected alignment against the field alignment. */
2019-10-21 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
+ 2019-10-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/91925
+ * g++.dg/conversion/packed2.C: New test.
+
2019-09-27 Jakub Jelinek <jakub@redhat.com>
PR c++/88203
--- /dev/null
+// PR c++/91925
+// { dg-do compile { target c++11 } }
+// { dg-options "-fpack-struct" }
+
+struct A {};
+int foo (A);
+struct B {
+ A a;
+ decltype (foo (a)) p;
+};
+template <typename T> T bar (T);
+class C {
+ A a;
+ decltype (bar (a)) p;
+};