This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/9621: const int typedef is rejected


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]