public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: lalle@sics.se
To: gcc-gnats@gcc.gnu.org
Subject: c++/10147: Confusing error message for invalid template function argument
Date: Wed, 19 Mar 2003 09:36:00 -0000	[thread overview]
Message-ID: <20030319092658.16275.qmail@sources.redhat.com> (raw)


>Number:         10147
>Category:       c++
>Synopsis:       Confusing error message for invalid template function argument
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 19 09:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Lars Albertsson
>Release:        3.2.2
>Organization:
>Environment:
snaga:tmp> uname -a
Linux snaga.sics.se 2.4.19 #7 Fri Nov 29 15:22:22 CET 2002 i686 i686 i386 GNU/Linux

snaga:tmp> cat /etc/redhat-release 
Red Hat Linux release 8.0 (Psyche)
>Description:
snaga:tmp> cat bug.ii 
namespace N1
{

typedef long A;

struct B
{
  virtual A a() const;
};

struct D : public B
{
  A a() const;
};

}

N1::D d();

namespace N2
{

struct A {};

template < class T > T tf(const T &)
{
  return T();
}

void f(const N1::B & b)
{
 tf< A >(b.a());
}

}

void f2()
{
  N2::f(d());
}

snaga:tmp> /opt/gcc-3.2.2/bin/g++ -c bug.ii 
bug.ii: In function `void N2::f(const N1::B&)':
bug.ii:32: could not convert `(**(+b)->N1::B::_vptr.B)((+b))' to `const N2::A&'
bug.ii:26: in passing argument 1 of `T N2::tf(const T&) [with T = N2::A]'

snaga:tmp> /opt/gcc-3.2.2/bin/g++ -v 
Reading specs from /opt/gcc-3.2.2/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/specs
Configured with: /tmp/post_install/gcc-3.2.2/configure --enable-languages=c,c++ --prefix=/opt/gcc-3.2.2
Thread model: posix
gcc version 3.2.2
>How-To-Repeat:

>Fix:

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


                 reply	other threads:[~2003-03-19  9:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20030319092658.16275.qmail@sources.redhat.com \
    --to=lalle@sics.se \
    --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).