• 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: Problem with friend function and gcc 4.2 with objective-c++
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with friend function and gcc 4.2 with objective-c++


  • Subject: Re: Problem with friend function and gcc 4.2 with objective-c++
  • From: Thomas Engelmeier <email@hidden>
  • Date: Sat, 9 Aug 2008 11:20:16 +0200


Am 08.08.2008 um 00:09 schrieb Ken Worley:

Hi all,

I'm using Xcode 3.1 and just switched to gcc 4.2 from 4.0, but I've run into a problem with friend functions when compiling in objective- c++. I contrived an example that illustrates the problem:

[...]
This project builds fine using gcc 4.0, but when I switch the compiler setting to use gcc 4.2, I get the errors listed below. Any clues would certainly be appreciated if I'm doing something wrong. If not, I guess I'll file a bug...

Here's main.m:

#import <Cocoa/Cocoa.h>

class test1
{
public:
		friend test1* newtest1(int x)
		{
			test1* anobj = new test1();
			anobj->finishinit(x);
			return anobj;
		}
[...]
};

int main(int argc, char *argv[])
{
	test1* tobj = newtest1(5);
	delete tobj;

   return NSApplicationMain(argc,  (const char **) argv);
}

friend != static, and even then this probably would not be valid semantics.


test1* tobj = newtest1(5); has nothing to do with
test1::newtest1( int ) or aTest1Instance->newtest1( int )



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Problem with friend function and gcc 4.2 with objective-c++
      • From: "Clark Cox" <email@hidden>
References: 
 >Problem with friend function and gcc 4.2 with objective-c++ (From: Ken Worley <email@hidden>)

  • Prev by Date: Re: Using @selector()
  • Next by Date: Re: Using @selector()
  • Previous by thread: Re: Problem with friend function and gcc 4.2 with objective-c++
  • Next by thread: Re: Problem with friend function and gcc 4.2 with objective-c++
  • Index(es):
    • Date
    • Thread