From a182b26d35710dc0f4ffae9a878e95143e0b9d9c Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 20 Jul 2004 15:58:02 +0100 Subject: [PATCH] * gcc.dg/pr12625-1.c: New test. From-SVN: r84953 --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/pr12625-1.c | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr12625-1.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 51c125813d8..a45e8575c34 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2004-07-20 Joseph S. Myers + + * gcc.dg/pr12625-1.c: New test. + 2004-07-20 Steven Bosscher * testsuite/gcc.dg/switch-warn-1.c: New test. diff --git a/gcc/testsuite/gcc.dg/pr12625-1.c b/gcc/testsuite/gcc.dg/pr12625-1.c new file mode 100644 index 00000000000..9ad9f28897d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr12625-1.c @@ -0,0 +1,13 @@ +/* Warning for assignment used as truth-value should apply for + bit-fields. */ +/* Origin: bug 12625 from nomura at netapp.com */ +/* { dg-do compile } */ +/* { dg-options "-Wparentheses" } */ + +static struct { int i:8; } s; + +void +foo () +{ + if (s.i = 0) ; /* { dg-warning "parentheses" "warning for bit-field" } */ +} -- 2.30.2