public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/10147: Confusing error message for invalid template function argument
@ 2003-03-19 9:36 lalle
0 siblings, 0 replies; only message in thread
From: lalle @ 2003-03-19 9:36 UTC (permalink / raw)
To: gcc-gnats
>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:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-03-19 9:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-19 9:36 c++/10147: Confusing error message for invalid template function argument lalle
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).