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 c++/13809] Template conversion operator reports ambiguity where none exists


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-01-22 08:29 -------
The problem is that GCC is taking in effect the default templates, this can either be a reject valid or 
accepts invalid as either can happen depending on if there is something that GCC will latch on or if 
there is two that GCC will latch on like this example.

Here is the reduced sources:
struct X
{

    template<typename T, typename A, template<typename,typename> class C>
        operator C<T, A > ()
    {
        return C<T, A>();
    }

    template<typename T, typename A, typename B,
template<typename,typename,typename> class C >
    operator C<T, A, B> ()
    {
        return C<T, A, B>();
    }

};

namespace std
{
template<typename> struct less{};
template<typename> struct allocator{};
template<typename A, typename B = std::less<A>,
  typename C = std::allocator<A> > struct set{};
}

int main()
{
    X   x;
    std::set<int>    s = x;
}

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid, rejects-
                   |                            |valid


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


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