• 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: Re[2]: GCC 3.3 template compile error?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re[2]: GCC 3.3 template compile error?


  • Subject: Re: Re[2]: GCC 3.3 template compile error?
  • From: Martin-Gilles Lavoie <email@hidden>
  • Date: Mon, 15 Oct 2007 14:04:59 -0400

Hrm

Interesting that this thread, coincidentally, didn't get sorted & marked-as-read as usual for messages from this mailing list.

Last week, I submitted a bug report to Apple regarding another template compile error.

	Titled: 	XCode 2.5 gcc4 compiler failure
	RadarWeb #:	5532607
	Status:		Open

where a base class shared by two subclasses has a method taking a list<foo> parameter by reference. The superclass method couldn't be accessed by either of the subclassee when passing the return of subclass method as parameter. It just wouldn't compile with the compiler complaining about not having an implementation for the called superclass method, then went on listing two possible matches; one of which was the right method.

The work-around was to assign the method result into a local variable and then passing this as parameter to the superclass method. Then the compiler was happy.

So, for the case reported initially in this thread, where the getAttribute() call doesn't compile, see if setting those parameters in local variables before passing them helps, just in case if it's related to my reported bug.

If it works, I like Guinness.

On 14 oct. 2007, at 02:47, eric b wrote:

Hi,

Le 14 oct. 07 à 02:05, Peter Mulholland a écrit :

Hello Tim,

Sunday, October 14, 2007, 12:56:27 AM, you wrote:

class LibXmlReader
{
public:
   template <class T> T getAttribute(const xmlpp::Node* node, const
std::string& attrName) const;
   ...
};

Try:

template <class T> typename T getAttribute(const xmlpp::Node* node, const
std::string& attrName) const;


Also, this code compiles fine with GCC 4 on my Mac, and with VC++ 7.1 on my
Windows PC. It causes GCC 3.3, compiling for PPC, to complain.

IMHO GCC has always been dodgy at handling C++ templates. The GCC docs
claim they are following "the standard", but personally I think it is
just awkward, and an excuse for poor parsing.


Unless you really need to support 10.2 and earlier,

You meant 10.3 I guess ?

Panther uses gcc-3.3 too. If I'm not wrong, gcc-4.x has never been backported to Panther afaik.

That a big problem for some third part project not directly using XCode, because it avoids us to maintain easely - just the example I know - OpenOffice.org.

If you add gcc-3.3 parser issues to templates issue, and some other issues with other tools shipped in XCode for Panther, the result is a nightmare for the maintainers.

No need to talk about Jaguar ...


I would just compile your PPC code with GCC 4, which is 10.3.9 minimum.

IMHO, the problem is, Apple never backported the changes for Panther.



GCC 3 has
many known issues, none of which will be fixed now.


Yes, unfortunaly


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


This email sent to email@hidden

GIF image


Martin-Gilles Lavoie | Senior software developer | 514.905.8658 Oracle - Macintosh Native Desktop Client, Beehive 600, boul. de Maisonneuve West, Suite 1900 | Montréal (Québec) H3A 3J2


 _______________________________________________
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: Re[2]: GCC 3.3 template compile error?
      • From: Steve Checkoway <email@hidden>
References: 
 >GCC 3.3 template compile error? (From: "Tim Conkling" <email@hidden>)
 >Re: GCC 3.3 template compile error? (From: "Clark Cox" <email@hidden>)
 >Re: GCC 3.3 template compile error? (From: "Tim Conkling" <email@hidden>)
 >Re[2]: GCC 3.3 template compile error? (From: Peter Mulholland <email@hidden>)
 >Re: Re[2]: GCC 3.3 template compile error? (From: eric b <email@hidden>)

  • Prev by Date: Re: Who has a wstring data formatter
  • Next by Date: upgrading libtool and automake
  • Previous by thread: Re: Re[2]: GCC 3.3 template compile error?
  • Next by thread: Re: Re[2]: GCC 3.3 template compile error?
  • Index(es):
    • Date
    • Thread