This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/11692] New: vector<A::X<T> > operator== does not find operator== of A::X


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11692

           Summary: vector<A::X<T> > operator== does not find operator== of
                    A::X
           Product: gcc
           Version: 3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: klaus dot kretschel at dlr dot de
                CC: gcc-bugs at gcc dot gnu dot org

The test program:

#include <vector>
namespace X { template< class T > class A; }

template <class T> class X::A
{
  template <typename S>
  friend bool operator==(const A<S>& _f1, const A<S>& _f2);
  T dummy;
};

template <typename S>
bool operator==(const X::A<S>& _f1, const X::A<S>& _f2) { return false; }

bool test()
{
  std::vector <X::A <float> > v1, v2;
  return v1 == v2;
}

yields the error message

/usr/include/g++/bits/stl_algobase.h:681: no match for `const X::A<float>& == 
   const X::A<float>&' operator

The program compiles if I remove the namespace or replace the vector with
a base datatype. It also compiles with g++ 2.95.

OS: i486-suse-linux


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]