This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13809] Template conversion operator reports ambiguity where none exists
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jan 2004 08:29:15 -0000
- Subject: [Bug c++/13809] Template conversion operator reports ambiguity where none exists
- References: <20040122054858.13809.gianni@mariani.ws>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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