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]

Re: (gcc 2.95 NT4 SP6) function declaration with enum argument


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

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