From: Martin Sebor Date: Mon, 20 Jun 2016 15:46:09 +0000 (+0000) Subject: PR c/69507 - bogus warning: ISO C does not allow __alignof__ (expression) X-Git-Tag: basepoints/gcc-8~6126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9e8bdfd905b5db38c452eff6f441cb59c26fef7;p=thirdparty%2Fgcc.git PR c/69507 - bogus warning: ISO C does not allow __alignof__ (expression) gcc/testsuite/ChangeLog: * gnu89-const-expr-1.c: Avoid diagnosing __alignof__ as not conforming. * gnu90-const-expr-1.c: Same. * gnu99-const-expr-1.c: Same. * gnu99-static-1.c: Same. From-SVN: r237606 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 369300d949f9..0570b224f21b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2016-06-20 Martin Sebor + + PR c/69507 + * gnu89-const-expr-1.c: Avoid diagnosing __alignof__ as not conforming. + * gnu90-const-expr-1.c: Same. + * gnu99-const-expr-1.c: Same. + * gnu99-static-1.c: Same. + 2016-06-20 Renlin Li * gcc.dg/tree-ssa/attr-hotcold-2.c: Fix syntax errors. diff --git a/gcc/testsuite/gcc.dg/gnu89-const-expr-1.c b/gcc/testsuite/gcc.dg/gnu89-const-expr-1.c index 0cc14da599a6..4fd6671a4dbb 100644 --- a/gcc/testsuite/gcc.dg/gnu89-const-expr-1.c +++ b/gcc/testsuite/gcc.dg/gnu89-const-expr-1.c @@ -23,7 +23,7 @@ f (void) E5 = __imag__ 0, /* __alignof__ always constant. */ E6 = __alignof__ (int[n]), /* { dg-error "ISO C90 forbids variable length array" } */ - E7 = __alignof__ (a), /* { dg-error "__alignof__ \\(expression\\)" } */ + E7 = __alignof__ (a), /* __extension__ ignored for constant expression purposes. */ E8 = __extension__ (1 ? 0 : i++), /* { dg-error "constant expression" } */ E9 = __extension__ 0, diff --git a/gcc/testsuite/gcc.dg/gnu90-const-expr-1.c b/gcc/testsuite/gcc.dg/gnu90-const-expr-1.c index e052114622c9..3f7f1af5de03 100644 --- a/gcc/testsuite/gcc.dg/gnu90-const-expr-1.c +++ b/gcc/testsuite/gcc.dg/gnu90-const-expr-1.c @@ -23,7 +23,7 @@ f (void) E5 = __imag__ 0, /* __alignof__ always constant. */ E6 = __alignof__ (int[n]), /* { dg-error "ISO C90 forbids variable length array" } */ - E7 = __alignof__ (a), /* { dg-error "__alignof__ \\(expression\\)" } */ + E7 = __alignof__ (a), /* __extension__ ignored for constant expression purposes. */ E8 = __extension__ (1 ? 0 : i++), /* { dg-error "constant expression" } */ E9 = __extension__ 0, diff --git a/gcc/testsuite/gcc.dg/gnu99-const-expr-1.c b/gcc/testsuite/gcc.dg/gnu99-const-expr-1.c index da7076ff8997..3f5f25e6d2eb 100644 --- a/gcc/testsuite/gcc.dg/gnu99-const-expr-1.c +++ b/gcc/testsuite/gcc.dg/gnu99-const-expr-1.c @@ -23,7 +23,7 @@ f (void) E5 = __imag__ 0, /* __alignof__ always constant. */ E6 = __alignof__ (int[n]), - E7 = __alignof__ (a), /* { dg-error "__alignof__ \\(expression\\)" } */ + E7 = __alignof__ (a), /* __extension__ ignored for constant expression purposes. */ E8 = __extension__ (1 ? 0 : i++), /* { dg-error "constant expression" } */ E9 = __extension__ 0, diff --git a/gcc/testsuite/gcc.dg/gnu99-static-1.c b/gcc/testsuite/gcc.dg/gnu99-static-1.c index 3fece615e0ed..982113bc7ddf 100644 --- a/gcc/testsuite/gcc.dg/gnu99-static-1.c +++ b/gcc/testsuite/gcc.dg/gnu99-static-1.c @@ -10,8 +10,8 @@ /* { dg-options "-O2 -std=gnu99 -pedantic-errors" } */ /* __alignof__, OK. */ -static int f0(void); -void g0(void) { __alignof__(f0()); } /* { dg-error "__alignof__ \\(expression\\)" } */ +static int f0(void); +void g0(void) { __alignof__(f0()); } /* __typeof__ not variably modified, OK. */ static int f1(void);