summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-19 16:11:40 +0000
committermsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-19 16:11:40 +0000
commit0b4b12fd4a13c8d5292151f1e832cc71e28fa39d (patch)
tree8cd854ca7422ba83037bd2728ac87e2ed6fdf471
parent21897f47dde3a24dcf6961b5fb1fdac1f30cbbb0 (diff)
downloadgcc-0b4b12fd4a13c8d5292151f1e832cc71e28fa39d.tar.gz
PR c/69507 - bogus warning: ISO C does not allow ‘__alignof__ (expression)’
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237582 138bc75d-0d04-0410-961f-82ee72b054a4
-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 00000000000..d018b44025d
--- /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\\)." } */
+};