This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: (gcc 2.95 NT4 SP6) function declaration with enum argument
- To: Thomas Maeder <maeder at glue dot ch>
- Subject: Re: (gcc 2.95 NT4 SP6) function declaration with enum argument
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Sat, 04 Mar 2000 11:11:02 +0000
- CC: egcs-bugs at egcs dot cygnus dot com
- Organization: CodeSourcery, LLC
- References: <38C0EDC2.D3ED4AE8@glue.ch>
Thomas Maeder wrote:
>
> When I try to compile the following code using gcc 2.95 on NT4 SP6:
>
> #include <string>
> enum TLanguage;
> std::string GetLanguageString(TLanguage);
>
> I get:
>
> use of enum `TLanguage' without previous declaration
>
> I think that my code is correct; an incomplete type is sufficient for the
> arguments/return type of a function declaration.
There's no such thing as an incomplete enum. g++ accepts the above as
an extension, try with -pedantic.
But, you have a point, if we're allowing an incomplete enum, we should
allow it's use the same as incomplete struct (i.e. it must be complete by
the time the function is used or defined).
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org