This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21555] New: name lookup / friend function
- From: "sstrasser at systemhaus-gruppe dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 May 2005 19:30:22 -0000
- Subject: [Bug c++/21555] New: name lookup / friend function
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
from c.l.c.moderated by Maxim Yegorushkin:
#include <algorithm>
namespace N {
#ifdef SHOW_BUG
struct A
{
};
int swap(A&, A&);
#else
struct A
{
friend int swap(A&, A&);
};
#endif
struct B : A
{
};
void swap(B& x, B& y)
{
using std::swap;
typedef char a[sizeof(swap(static_cast<A&>(x), static_cast<A&>(y))) ?
1 : -1] ; // compiles only if int swap(A&, A&) is found
}
}
--
Summary: name lookup / friend function
Product: gcc
Version: 3.4.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sstrasser at systemhaus-gruppe dot de
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21555