This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13165] New: "Koenig lookup" bug
- From: "paolo at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Nov 2003 10:13:14 -0000
- Subject: [Bug c++/13165] New: "Koenig lookup" bug
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Hi,
I'm not a language lawyer, but I understand from a presentation by Herb Sutter
that the following snippet should compile (indeed it does with EDG-based
front ends) (nb: same problem with the additional inheritance from _Ranit)
namespace std {
// template<class T> struct _Ranit {};
template<class T> class vector {
public:
class iterator /*: public _Ranit<T> */ {
public:
iterator operator+(int) const { return iterator(); }
};
iterator operator[](unsigned _Pos) { return iterator() + _Pos; }
};
}
namespace N {
struct X {};
template<class T>
int* operator+(T, unsigned)
{static int i; return &i; }
}
int main()
{
std::vector<N::X> v;
v[0] = v[1] + 1;
}
--
Summary: "Koenig lookup" bug
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: paolo at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: Any
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13165