public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/4361: gcc 3.0.1 bogus ambiguity taking the address of a member template
@ 2001-09-19 9:26 sebor
0 siblings, 0 replies; only message in thread
From: sebor @ 2001-09-19 9:26 UTC (permalink / raw)
To: gcc-gnats
>Number: 4361
>Category: c++
>Synopsis: gcc 3.0.1 bogus ambiguity taking the address of a member template
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Sep 19 09:26:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: sebor@roguewave.com
>Release: gcc 3.0.1
>Organization:
>Environment:
>Description:
This is reduced from our auto_ptr testsuite. The compiler
is confused by the two conversion operators. 2.95.2 ICEs
on this code.
Regards
Martin
>How-To-Repeat:
$ cat t.cc ; g++ t.cc
template <class T>
class auto_ptr;
template <class T>
struct auto_ptr_ref
{
template <class U>
auto_ptr_ref (auto_ptr<U>&) throw () { }
};
template<class T>
struct auto_ptr
{
template <class U>
operator auto_ptr_ref<U>() throw () {
return auto_ptr_ref<U>(*this);
}
template <class U>
operator auto_ptr<U>() throw () {
return auto_ptr<U>();
}
};
struct B { };
struct D: B { };
int main ()
{
auto_ptr<B> (auto_ptr<D>::*pf)() = &auto_ptr<D>::operator auto_ptr<B>;
}
t.cc: In function `int main()':
t.cc:32: no matches converting function `operator auto_ptr_ref<U>' to type
`struct auto_ptr<B> (struct auto_ptr<D>::*)()'
t.cc:16: candidates are: template<class U> auto_ptr::operator auto_ptr_ref<U>()
[with U = U, T = D]
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-09-19 9:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-19 9:26 c++/4361: gcc 3.0.1 bogus ambiguity taking the address of a member template sebor
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).