Bug 14050 - [DR289] c99 restrict doesn't work in abs declarator
Summary: [DR289] c99 restrict doesn't work in abs declarator
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 3.4.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2004-02-06 18:00 UTC by Mike Stump
Modified: 2009-06-25 11:10 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.0.0 2.95.3 3.0.4 3.3.1 3.2.3
Last reconfirmed: 2006-09-18 15:13:12


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Stump 2004-02-06 18:00:31 UTC
c99's restrict doesn't work in an abstract declarator:

int regexec(int [restrict]);

t7.c:1: error: static or type qualifiers in abstract declarator

gcc version 3.4 20031207 (experimental)

In

http://gcc.gnu.org/ml/gcc/2004-02/msg00461.html

Nathan claimed it was valid.
Comment 1 Andrew Pinski 2004-02-06 18:05:14 UTC
Confirmed, not a regression.
Comment 2 Mike Stump 2004-02-06 18:08:47 UTC
Comipler flags: -std=c99
Comment 3 Joseph S. Myers 2004-02-06 18:28:22 UTC
It seems I did implement this C99 requirement when implementing this feature
after all (without considering whether it might be a defect), with the
error message shown rather than in the grammar.  Suspending until DR289
appears in the DR logs with an indication of the intended resolution.
Comment 4 Andrew Pinski 2005-08-31 19:56:52 UTC
http://www.open-std.org/JTC1/SC22/WG14/www/docs/dr_289.htm

This was decided that this was a defect at least as far as I can see.
Comment 5 Neil Booth 2006-09-18 15:13:12 UTC
Confirmed
Comment 6 Joseph S. Myers 2007-11-22 23:12:41 UTC
Subject: Bug 14050

Author: jsm28
Date: Thu Nov 22 23:12:29 2007
New Revision: 130362

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130362
Log:
	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.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-decl.c
    trunk/gcc/c-parser.c
    trunk/gcc/c-tree.h
    trunk/gcc/doc/standards.texi
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/c99-arraydecl-1.c

Comment 7 Richard Biener 2009-06-25 11:10:51 UTC
Fixed.