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: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
- Cc: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>, gcc-bugs at gcc dot gnu dot org, <patrick dot rabau at gs dot com>, <gcc-gnats at gcc dot gnu dot org>
- Date: 08 Feb 2003 05:06:25 +0100
- Subject: Re: c++/9621: const int typedef is rejected
- Organization: Integrable Solutions
- References: <Pine.LNX.4.44.0302071844120.13367-100000@gandalf.ticam.utexas.edu>
Wolfgang Bangerth <bangerth@ticam.utexas.edu> writes:
| > > 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++.
*No*. GCC is correct in accepting it. That is what C and C++
standards require.
| I'll change the synopsis of the report in a minute. Thanks for your
| clarification.
Please, don't do that! Is it an error not to accept
int const typede T;
It is an error to reject
int typedef T;
-- Gaby