c++/7676: Member template function overloading problem
nespub@free.fr
nespub@free.fr
Wed Aug 21 03:46:00 GMT 2002
>Number: 7676
>Category: c++
>Synopsis: Member template function overloading problem
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Wed Aug 21 03:46:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:
>Release: 3.2 20020809 (Debian prerelease) (Debian testing/unstable)
>Organization:
EPITA-LRDE
>Environment:
System: Linux ouagadougou 2.4.17 #1 Thu May 30 08:30:13 CEST 2002 i586 unknown unknown GNU/Linux
Architecture: i586
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: /mnt/data/gcc-3.1/gcc-3.2-3.2ds0/src/configure -v --enable-languages=c,c++,java,f77,proto,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-java-gc=boehm --enable-objc-gc i386-linux
>Description:
Member template functions overloading fails when overloading is
based on the template parameter list. It fails with g++-3.1 older than
pre-2 version, and g++-3.2. It works outside any class.
Referring to sections (14.5.5.1-4) and (14.5.2-8) it seems to be
a bug. g++ < 3.1 accepts it, como and icc too.
>How-To-Repeat:
struct foo
{
template<class T>
void bar();
template<int I>
void bar();
};
$ g++-3.2 template_overloading.cc
template_overloading.cc:7: `template<int I> void foo::bar()' and `
template<class T> void foo::bar()' cannot be overloaded
>Fix:
Use namespace instead of struct, but not always possible.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list