aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Sebor <msebor@gcc.gnu.org>2016-06-19 10:11:40 -0600
committerMartin Sebor <msebor@gcc.gnu.org>2016-06-19 10:11:40 -0600
commit5112abecf231f4a0f8978111438ac0328b671604 (patch)
tree8cd854ca7422ba83037bd2728ac87e2ed6fdf471 /gcc
parentaa0db437bce053c3e9fe55ad422b0807aad8b290 (diff)
downloadgcc-5112abecf231f4a0f8978111438ac0328b671604.zip
gcc-5112abecf231f4a0f8978111438ac0328b671604.tar.gz
gcc-5112abecf231f4a0f8978111438ac0328b671604.tar.bz2
PR c/69507 - bogus warning: ISO C does not allow ‘__alignof__ (expression)’
From-SVN: r237582
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/alignof.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/alignof.c b/gcc/testsuite/gcc.dg/alignof.c
new file mode 100644
index 0000000..d018b44
--- /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\\)." } */
+};