From mboxrd@z Thu Jan 1 00:00:00 1970 From: landry@physics.utah.edu To: gcc-gnats@gcc.gnu.org Subject: c++/2494: Template Specialization Name Lookup Date: Thu, 05 Apr 2001 12:06:00 -0000 Message-id: <20010405190009.24959.qmail@sourceware.cygnus.com> X-SW-Source: 2001-04/msg00088.html List-Id: >Number: 2494 >Category: c++ >Synopsis: Template Specialization Name Lookup >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Thu Apr 05 12:06:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Walter Landry >Release: gcc 2.95.2 and Codesourcery's nightly >Organization: >Environment: Debian 2.2 (potato) >Description: gcc can't seem to generate the specialization in the example code. It gives the error simple.C: In function `int main()': simple.C:25: no match for call to `(Tensor1) (Index<'i'> &)' KCC version 3.4 and IBM's Visual Age C++ v5.0 both compile without complaints, so I'm reasonably sure that this is allowed by the language. If I get rid of either of the template<>'s, i.e. change template class Tensor1 to class Tensor1 or change template double operator()(Index &index) to double operator()(Index<'i'> &index) then it compiles fine. But that doesn't give me the functionality I need. This may be a duplication of bugs 509, 72, and/or 45, though they don't seem exactly the same. >How-To-Repeat: template class Index { public: Index() {}; }; template class Tensor1 { public: template double operator()(Index &index) { return 2.0; } }; int main() { Index<'i'> i; Tensor1 t1; t1(i); } To compile, it's just g++ simple.C >Fix: None known. >Release-Note: >Audit-Trail: >Unformatted: