aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2007-11-22 23:12:29 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2007-11-22 23:12:29 +0000
commit6ac0194d21d90e29832fd1c996ba23e6e183d328 (patch)
treef8959fdd1818cd96126e42cc4ebcbcb497abeb58 /gcc
parentdf8702365b9124ee1b29f8a25ba23fa0982fa237 (diff)
downloadgcc-6ac0194d21d90e29832fd1c996ba23e6e183d328.zip
gcc-6ac0194d21d90e29832fd1c996ba23e6e183d328.tar.gz
gcc-6ac0194d21d90e29832fd1c996ba23e6e183d328.tar.bz2
re PR c/14050 ([DR289] c99 restrict doesn't work in abs declarator)
PR c/14050 * c-decl.c (set_array_declarator_inner): Don't give error for static or type qualifiers in abstract declarator. Remove abstract_p parameter. * c-tree.h (set_array_declarator_inner): Update prototype. * c-parser.c (c_parser_direct_declarator_inner): Update call to set_array_declarator_inner. * doc/standards.texi: Update for C99 TC3. testsuite: * gcc.dg/c99-arraydecl-1.c: Don't expect errors for static or type qualifiers in abstract declarator. From-SVN: r130362
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/c-decl.c11
-rw-r--r--gcc/c-parser.c2
-rw-r--r--gcc/c-tree.h3
-rw-r--r--gcc/doc/standards.texi8
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/c99-arraydecl-1.c20
7 files changed, 36 insertions, 25 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e08b82f..e6f3640 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2007-11-22 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/14050
+ * c-decl.c (set_array_declarator_inner): Don't give error for
+ static or type qualifiers in abstract declarator. Remove
+ abstract_p parameter.
+ * c-tree.h (set_array_declarator_inner): Update prototype.
+ * c-parser.c (c_parser_direct_declarator_inner): Update call to
+ set_array_declarator_inner.
+ * doc/standards.texi: Update for C99 TC3.
+
2007-11-22 Hans-Peter Nilsson <hp@bitrange.com>
* config/mmix/mmix.c (mmix_encode_section_info): Remove duplicate
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 5ddbcc0..bcf20e0 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -3081,20 +3081,13 @@ build_array_declarator (tree expr, struct c_declspecs *quals, bool static_p,
/* Set the contained declarator of an array declarator. DECL is the
declarator, as constructed by build_array_declarator; INNER is what
- appears on the left of the []. ABSTRACT_P is true if it is an
- abstract declarator, false otherwise; this is used to reject static
- and type qualifiers in abstract declarators, where they are not in
- the C99 grammar (subject to possible change in DR#289). */
+ appears on the left of the []. */
struct c_declarator *
set_array_declarator_inner (struct c_declarator *decl,
- struct c_declarator *inner, bool abstract_p)
+ struct c_declarator *inner)
{
decl->declarator = inner;
- if (abstract_p && (decl->u.array.quals != TYPE_UNQUALIFIED
- || decl->u.array.attrs != NULL_TREE
- || decl->u.array.static_p))
- error ("static or type qualifiers in abstract declarator");
return decl;
}
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index 32776dd..5293547 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -2499,7 +2499,7 @@ c_parser_direct_declarator_inner (c_parser *parser, bool id_present,
star_seen);
if (declarator == NULL)
return NULL;
- inner = set_array_declarator_inner (declarator, inner, !id_present);
+ inner = set_array_declarator_inner (declarator, inner);
return c_parser_direct_declarator_inner (parser, id_present, inner);
}
else if (c_parser_next_token_is (parser, CPP_OPEN_PAREN))
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index c81801b..28f99c6 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -487,8 +487,7 @@ extern void c_push_function_context (struct function *);
extern void c_pop_function_context (struct function *);
extern void push_parm_decl (const struct c_parm *);
extern struct c_declarator *set_array_declarator_inner (struct c_declarator *,
- struct c_declarator *,
- bool);
+ struct c_declarator *);
extern tree c_builtin_function (tree);
extern void shadow_tag (const struct c_declspecs *);
extern void shadow_tag_warned (const struct c_declspecs *, int);
diff --git a/gcc/doc/standards.texi b/gcc/doc/standards.texi
index ddee01a..6b5e15b 100644
--- a/gcc/doc/standards.texi
+++ b/gcc/doc/standards.texi
@@ -37,6 +37,8 @@ with some exceptions, and possibly with some extensions.
@cindex Technical Corrigendum 1
@cindex TC2
@cindex Technical Corrigendum 2
+@cindex TC3
+@cindex Technical Corrigendum 3
@cindex AMD1
@cindex freestanding implementation
@cindex freestanding environment
@@ -86,9 +88,9 @@ standard, use @option{-std=c99} or @option{-std=iso9899:1999}. (While in
development, drafts of this standard version were referred to as
@dfn{C9X}.)
-Errors in the 1999 ISO C standard were corrected in two Technical
-Corrigenda published in 2001 and 2004. GCC does not support the uncorrected
-version.
+Errors in the 1999 ISO C standard were corrected in three Technical
+Corrigenda published in 2001, 2004 and 2007. GCC does not support the
+uncorrected version.
By default, GCC provides some extensions to the C language that on
rare occasions conflict with the C standard. @xref{C
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4bde178..ca92fa8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2007-11-22 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/14050
+ * gcc.dg/c99-arraydecl-1.c: Don't expect errors for static or type
+ qualifiers in abstract declarator.
+
2007-11-22 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/derived_constructor_comps_3.f90: New.
diff --git a/gcc/testsuite/gcc.dg/c99-arraydecl-1.c b/gcc/testsuite/gcc.dg/c99-arraydecl-1.c
index 24ddd65..2036d82 100644
--- a/gcc/testsuite/gcc.dg/c99-arraydecl-1.c
+++ b/gcc/testsuite/gcc.dg/c99-arraydecl-1.c
@@ -9,8 +9,8 @@
[quals static expr]. Not yet: [quals *]. */
void f00 (int a[const]);
-void f01 (int [const]); /* { dg-bogus "warning" "warning in place of error" } */
-/* { dg-error "abstract" "\[quals\] in abstract declarator" { target *-*-* } 12 } */
+void f01 (int [const]);
+
void
f02 (int a[const])
{
@@ -28,8 +28,8 @@ f03 (a)
}
void f10 (int a[const 2]);
-void f11 (int [const 2]); /* { dg-bogus "warning" "warning in place of error" } */
-/* { dg-error "abstract" "\[quals expr\] in abstract declarator" { target *-*-* } 31 } */
+void f11 (int [const 2]);
+
void
f12 (int a[const 2])
{
@@ -47,8 +47,8 @@ f13 (a)
}
void f20 (int a[static 2]);
-void f21 (int [static 2]); /* { dg-bogus "warning" "warning in place of error" } */
-/* { dg-error "abstract" "\[static expr\] in abstract declarator" { target *-*-* } 50 } */
+void f21 (int [static 2]);
+
void
f22 (int a[static 2])
{
@@ -64,8 +64,8 @@ f23 (a)
}
void f30 (int a[static const 2]);
-void f31 (int [static const 2]); /* { dg-bogus "warning" "warning in place of error" } */
-/* { dg-error "abstract" "\[static quals expr\] in abstract declarator" { target *-*-* } 67 } */
+void f31 (int [static const 2]);
+
void
f32 (int a[static const 2])
{
@@ -83,8 +83,8 @@ f33 (a)
}
void f40 (int a[const static 2]);
-void f41 (int [const static 2]); /* { dg-bogus "warning" "warning in place of error" } */
-/* { dg-error "abstract" "\[quals static expr\] in abstract declarator" { target *-*-* } 86 } */
+void f41 (int [const static 2]);
+
void
f42 (int a[const static 2])
{