c++/2519: Bug in the `__restrict' keyword.

lucho@haemimont.bg lucho@haemimont.bg
Mon Apr 9 09:46:00 GMT 2001

>Number:         2519
>Category:       c++
>Synopsis:       Bug in the `__restrict' keyword.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 09 09:46:00 PDT 2001
>Originator:     Luchezar Belev
>Release:        GCC-2.95.2; GCC-2.95.3
Linux-2.4.2; Linux-2.2.18
Pentium III
(all of this doesn't matter - the bug is in the compiler's parser)
Consider the next 2 code fragments:

	int * __restrict p;

	typedef int * pint;
	pint __restrict p;

 I think they both should compile in the same way,
but that's not the case. The c++ compiler rejects the second one
with error `two or more data types in declaration of `p''

 The c compiler does the right thing - makes no difference
between both fragments (exept, of course, that the second
one defines one extra symbol - `pint')
see the description (it's simple enough, really)


More information about the Gcc-bugs mailing list