+2018-09-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ * c-ada-spec.c: Include diagnostic.h.
+ (dump_ada_declaration) <RECORD_TYPE>: Issue a warning on packed layout.
+
2018-09-19 Marek Polacek <polacek@redhat.com>
* c.opt (Wclass-conversion): New.
#include "c-ada-spec.h"
#include "fold-const.h"
#include "c-pragma.h"
+#include "diagnostic.h"
#include "stringpool.h"
#include "attribs.h"
return 1;
}
+ /* ??? Packed record layout is not supported. */
+ if (TYPE_PACKED (TREE_TYPE (t)))
+ {
+ warning_at (DECL_SOURCE_LOCATION (t), 0,
+ "unsupported record layout");
+ pp_string (buffer, "pragma Compile_Time_Warning (True, ");
+ pp_string (buffer, "\"probably incorrect record layout\");");
+ newline_and_indent (buffer, spc);
+ }
+
if (orig && TYPE_NAME (orig))
pp_string (buffer, "subtype ");
else
+2018-09-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ * c-c++-common/dump-ada-spec-14.c: New test.
+
2018-09-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/nested-func-11.c: New test.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-fdump-ada-spec" } */
+
+struct __attribute__((packed)) S /* { dg-warning "unsupported record layout" } */
+{
+ char c;
+ int t;
+};
+
+/* { dg-final { cleanup-ada-spec } } */