This is the mail archive of the mailing list for the Cygwin project. See the Cygwin home page for more information.
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: egcs 1.1.1: odd warning message with template friend functions

"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<T> &, const class meta_info<T> &)'
>     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<T> 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).


Want to unsubscribe from this list?
Send a message to