From: Martin Sebor Date: Sun, 19 Jun 2016 16:11:40 +0000 (-0600) Subject: PR c/69507 - bogus warning: ISO C does not allow ‘__alignof__ (expression)’ X-Git-Tag: basepoints/gcc-8~6143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5112abecf231f4a0f8978111438ac0328b671604;p=thirdparty%2Fgcc.git PR c/69507 - bogus warning: ISO C does not allow ‘__alignof__ (expression)’ From-SVN: r237582 --- diff --git a/gcc/testsuite/gcc.dg/alignof.c b/gcc/testsuite/gcc.dg/alignof.c new file mode 100644 index 000000000000..d018b44025d9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/alignof.c @@ -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\\)." } */ +};