This is the mail archive of the gcc@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: Namespace of function (CTOR) parameters


> My user has egcs-2.90.27 and he gets the errors above at link time but
> no errors from the compiler. I requested the output of 'nm' and from the
> signature of the function I can see that MY compiler understands what I
> mean (PitchQuantizer::Smoothmode) even without specifying the namespace.

No, your compiler is right; in a method (or constructor) definition,
you are in the scope of the class. The scope of the class starts as
soon as the class name is seen.

> Of course this may not be a good thing, but it does.  The OTHER
> compiler does the right thing: it doesn't apply the function name's
> namespace to the parameters. The problem is that it doesn't
> complain.

The compiler should use all parameter types in the type safe linkage.
This is clearly a bug in egcs 1.0. Please try 

  typedef enum Smoothmode{STRONG, WEAK};

as you don't need the typedef.

Regards,
Martin


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