This is the mail archive of the
gcc-prs@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: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 8 Feb 2003 00:56:00 -0000
- Subject: Re: c++/9621: const int typedef is rejected
- Reply-to: Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
The following reply was made to PR c++/9621; it has been noted by GNATS.
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Cc: gcc-bugs@gcc.gnu.org, <patrick.rabau@gs.com>, <gcc-gnats@gcc.gnu.org>
Subject: Re: c++/9621: const int typedef is rejected
Date: Fri, 7 Feb 2003 18:46:10 -0600 (CST)
> > 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/