public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
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 [thread overview] Message-ID: <20010405190009.24959.qmail@sourceware.cygnus.com> (raw) >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<double>) (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 T> class Tensor1 to class Tensor1 or change template<char i> double operator()(Index<i> &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<char i> class Index { public: Index() {}; }; template <class T> class Tensor1 { public: template<char i> double operator()(Index<i> &index) { return 2.0; } }; int main() { Index<'i'> i; Tensor1<double> t1; t1(i); } To compile, it's just g++ simple.C >Fix: None known. >Release-Note: >Audit-Trail: >Unformatted:
next reply other threads:[~2001-04-05 12:06 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2001-04-05 12:06 landry [this message] 2002-03-25 19:37 rodrigc
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20010405190009.24959.qmail@sourceware.cygnus.com \ --to=landry@physics.utah.edu \ --cc=gcc-gnats@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).