public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: gtg833i@mail.gatech.edu
To: gcc-gnats@gcc.gnu.org
Subject: c++/10773: template method in base class not resolved
Date: Tue, 13 May 2003 21:19:00 -0000	[thread overview]
Message-ID: <20030513210733.31463.qmail@sources.redhat.com> (raw)


>Number:         10773
>Category:       c++
>Synopsis:       template method in base class not resolved
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 13 21:16:02 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Enrique Robledo Arnuncio
>Release:        g++ (GCC) 3.2.3
>Organization:
>Environment:
debian GNU/Linux, unstable (sid) intel i386
>Description:
A template method in a base class can not be resolved on the
concrete class when the concrete class has a method with
the same name.

This may be related to the missing feature mentioned in the
bug reporting instructions, related to two-stages template
lookup, but I have no way to know.

The following code reproduces the problem:

--------------------------------------

class arg {};

struct A
{
        template<class T>
        int f(T a) { return 10;}
};


struct B : public A
{
        // Commenting out next lines "uncovers" the template method in the base
        // class, and the program compiles and works.
        int f(int a);
};

int main()
{
        B b;
        arg a;

// Last statement gives this error:
        // hidden_template_member.cc: In function `int main()':
    // hidden_template_member.cc:27: error: no matching function for call to `B::f(arg&)'
    // hidden_template_member.cc:14: note: candidates are: int B::f(int)

        return b.f(a);
}
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2003-05-13 21:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-13 21:19 gtg833i [this message]
2003-05-13 21:48 bangerth

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=20030513210733.31463.qmail@sources.redhat.com \
    --to=gtg833i@mail.gatech.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: link
Be 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).