This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/510: G++ rejects member template operator specialization
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/510: G++ rejects member template operator specialization
- From: wolfgang dot bangerth at iwr dot uni-heidelberg dot de
- Date: 6 Sep 2000 08:07:19 -0000
- Reply-To: wolfgang dot bangerth at iwr dot uni-heidelberg dot de
- Resent-Cc: gcc-prs at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, jason at gcc dot gnu dot org
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, wolfgang.bangerth@iwr.uni-heidelberg.de
>Number: 510
>Category: c++
>Synopsis: G++ rejects member template operator specialization
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Sep 06 01:16:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Wolfgang Bangerth
>Release: unknown-1.0
>Organization:
>Environment:
gcc 2.95.2 and 20000905
>Description:
When trying to compile the following code, in which I
explicitely specialize a templates member operator,
-----------------------
template <class T>
struct Example {
template <class U> void operator= (U);
};
// specialize class template member function template
template <> template <>
void Example<double>::operator=<double> (double);
-----------------------
gcc 2.95.2 reports
y.cc:8: `operator =' not defined
y.cc:8: confused by earlier errors, bailing out
and, worse, snapshot 20000905 reports
/tmp/@12358.1:8: `operator=' not defined
/tmp/@12358.1:8: Internal error #19990331.
/tmp/@12358.1:8: Internal compiler error in grokdeclarator, at ../gcc/cp/decl.c:9820
Please submit a full bug report.
The code is valid in my eyes, using the explicit specialization
syntax for function templates. If, by the way, operator=
is renamed to a function `f', then the code passes without
problems.
Regards
Wolfgang
>How-To-Repeat:
gcc y.cc
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: