PR c/69507 - bogus warning: ISO C does not allow ‘__alignof__ (expression)’
authorMartin Sebor <msebor@gcc.gnu.org>
Sun, 19 Jun 2016 16:11:40 +0000 (10:11 -0600)
committerMartin Sebor <msebor@gcc.gnu.org>
Sun, 19 Jun 2016 16:11:40 +0000 (10:11 -0600)
From-SVN: r237582

gcc/testsuite/gcc.dg/alignof.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/alignof.c b/gcc/testsuite/gcc.dg/alignof.c
new file mode 100644 (file)
index 0000000..d018b44
--- /dev/null
@@ -0,0 +1,11 @@
+/* PR c/69507 - bogus warning: ISO C does not allow '__alignof__ (expression)'
+ */
+/* { dg-do compile } */
+/* { dg-options "-std=c11 -Wno-error -Wpedantic" } */
+
+extern int e;
+
+int a[] = {
+    __alignof__ (e),
+    _Alignof (e)       /* { dg-warning "ISO C does not allow ._Alignof \\(expression\\)." } */
+};