This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/9621: const int typedef is rejected
- From: Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
- To: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>
- Cc: gcc-bugs at gcc dot gnu dot org, <patrick dot rabau at gs dot com>, <gcc-gnats at gcc dot gnu dot org>
- Date: Fri, 7 Feb 2003 18:46:10 -0600 (CST)
- Subject: Re: c++/9621: const int typedef is rejected
> > Can some language lawyer comment on whether and why
> > type1 typedef type2;
> > is legal syntax?
>
> No, it isn't. typedef is a decl-specifier. They are only allowed as a
> sequence at the start of a simple-declaration:
So it's a bug that gcc accepts it in C++. In a strange sense, it's then
even a regression that it previously only accepted the version without
"const" and now accepts both with and without const :-)
I'll change the synopsis of the report in a minute. Thanks for your
clarification.
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ticam.utexas.edu
www: http://www.ticam.utexas.edu/~bangerth/