• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: strange compiler behavior (gcc 4.0)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strange compiler behavior (gcc 4.0)


  • Subject: Re: strange compiler behavior (gcc 4.0)
  • From: "Clark Cox" <email@hidden>
  • Date: Thu, 12 Oct 2006 20:32:43 -0400

The language standard dictates this behavior. In this case, GCC is
correct, and VC is not. The solution it to prefix the members with the
scope (as you have shown) or to prefix them with "this->".

On 10/12/06, Daimen Duncan <email@hidden> wrote:
Using Xcode 2.4 and gcc 4.0:


I have a base class, like so:

template <class T> class Aryptr
{
             …

protected:
             value_type *elems;
             int numElems;

             …
}

Then I have a derived class, like so:


template <class TDec> class TAryA : public Aryptr <typename TDesc::ValueType> { …

public:
             void Dealloc()     {elems = 0; numElems = maxElems = 0;}

             …
}

This is pretty straight forward stuff, but the compiler complains
that the members (elems, numElems) are "not declared in this scope".
If I prefix with Base:: it stops complaing, but I'm not about to
rewrite all my code for the specific compiler, it compiles fine in VS
(which is admittedly less strict).

Am I being stupid or is there a "don't be stupid" compiler setting?

Thanks,
~Duncan

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden



--
Clark S. Cox III
email@hidden
My CV/Resume:
http://homepage.mac.com/clarkcox3/files/Resume.pdf
http://homepage.mac.com/clarkcox3/files/Resume.html
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: strange compiler behavior (gcc 4.0)
      • From: Scott Ribe <email@hidden>
References: 
 >changes from xcode 2.3 to 2.4? (From: Howard Shere <email@hidden>)
 >strange compiler behavior (gcc 4.0) (From: Daimen Duncan <email@hidden>)

  • Prev by Date: strange compiler behavior (gcc 4.0)
  • Next by Date: Re: strange compiler behavior (gcc 4.0)
  • Previous by thread: strange compiler behavior (gcc 4.0)
  • Next by thread: Re: strange compiler behavior (gcc 4.0)
  • Index(es):
    • Date
    • Thread