This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/8465: GCC 3.2 rejects legal overloads of template member functions


>Number:         8465
>Category:       c++
>Synopsis:       GCC 3.2 rejects legal overloads of template member functions
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 05 10:56:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Jacques Bouchard
>Release:        Reading specs from /usr//bin/../lib/gcc-lib/i586-mandrake-linux-gnu/3.2/specs
>Organization:
>Environment:
Mandrake Linux 9.0 / Pentium II
>Description:
GCC 3.2 can't compile the test-case overload.cpp listed in How-To-Repeat. Alexandrescu's loki-lib contains code like that (MultiMethods.h/FnDispatcher::Add()), so it can't be compiled either.

g++ overload.cpp

overload.cpp:5: `template<class T, bool flag> void A::f()' and `template<class T> void A::f()' cannot be overloaded
overload.cpp: In function `int main()':
overload.cpp:11: no matching function for call to `A::f()'
>How-To-Repeat:
// file overload.cpp

struct A {
	template <typename T>           void f() { }
	template<typename T, bool flag> void f() { }
};

int main() {
	A a;
	a.f<int>();
	a.f<int, true>();
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
 Configured with: ../configure --prefix=/usr --libdir=/usr/lib --with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --enable-long-long --enable-__cxa_atexit --enable-languages=c,c+ +,ada,f77,objc,java --host=i586-mandrake-linux-gnu --with-system-zlib
 Thread model: posix
 gcc version 3.2 (Mandrake Linux 9.0 3.2-1mdk)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]