public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/2494: Template Specialization Name Lookup
@ 2002-03-25 19:37 rodrigc
  0 siblings, 0 replies; 2+ messages in thread
From: rodrigc @ 2002-03-25 19:37 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, landry, nobody

Synopsis: Template Specialization Name Lookup

State-Changed-From-To: analyzed->closed
State-Changed-By: rodrigc
State-Changed-When: Mon Mar 25 19:37:13 2002
State-Changed-Why:
    Testcase compiles with gcc 3.1 20020322 (prerelease).
    Confirmed by submitter:
    http://gcc.gnu.org/ml/gcc/2002-03/msg01534.html

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=2494


^ permalink raw reply	[flat|nested] 2+ messages in thread

* c++/2494: Template Specialization Name Lookup
@ 2001-04-05 12:06 landry
  0 siblings, 0 replies; 2+ messages in thread
From: landry @ 2001-04-05 12:06 UTC (permalink / raw)
  To: gcc-gnats

>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:


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-03-26  3:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-25 19:37 c++/2494: Template Specialization Name Lookup rodrigc
  -- strict thread matches above, loose matches on Subject: below --
2001-04-05 12:06 landry

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).