This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: bug 2645 and restrict
On 26-Apr-2001, Nathan Sidwell <nathan@codesourcery.com> wrote:
> Jason Merrill wrote:
> > IMO, no. "const" implies a property which reference types already have, so
> > it's reasonable to ignore it.
> but volatile isn't, and that too is silently ignored. which is counter
> to your point about restrict only applying to pointers.
>
> typedef int &ref_t;
> ref_t volatile thing;
I consider the fact that volatile is silently ignored here to be a bug.
A helpful compiler would issue a diagnostic.
I don't know exactly why the committee decided to treat volatile the
same way as const here, but it may have been because they didn't consider
it, or didn't think it important.
But even though the committee didn't mandate a diagnostic, I think good
quality compilers should issue one.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.