Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-Id: <199903151640.KAA02580@modi.xraylith.wisc.edu> X-Authentication-Warning: modi.xraylith.wisc.edu: localhost.xraylith.wisc.edu [127.0.0.1] didn't use HELO protocol To: "Jonathan Pryor" cc: "Cygwin Mailing List" Subject: Re: egcs 1.1.1: odd warning message with template friend functions In-reply-to: Your message of "Mon, 15 Mar 1999 09:18:33 EST." <11ad01be6eee$c7a47bf0$e63d2509 AT jonpryor DOT raleigh DOT ibm DOT com> Date: Mon, 15 Mar 1999 10:40:53 -0600 From: Mumit Khan "Jonathan Pryor" writes: > ------=_NextPart_000_11AA_01BE6EC4.CC9E62D0 > Content-Type: text/plain; > charset="iso-8859-1" > Content-Transfer-Encoding: 7bit > > Note: I'm not complaining about the resulting executable; I'm > complaining about the warning message itself. > > When I compile the attached source code, I get the > following warning: > > mi.cpp:7: warning: friend declaration `bool operator ==( > const class meta_info &, const class meta_info &)' > mi.cpp:7: warning: declares a non-template function > mi.cpp:7: warning: (if this is not what you intended, make sure > mi.cpp:7: warning: the function template has already been declared, > mi.cpp:7: warning: and add <> after the function name here) > mi.cpp:8: warning: friend declaration `class meta_info metaid( > const T &)' > mi.cpp:8: warning: declares a non-template function Please see "Guiding Declarations" in the standard. EGCS is correct; MSVC doesn't implmenent this correctly. This was added after Stroustrup book came out (at least my copy of it). Regards, Mumit -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com