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

            Bug ID: 57311
           Summary: Conversion operator can be overloaded with itself by
                    using typedef
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org

This should be rejected:


typedef int Int;

template<class T, class U> struct is_same       { enum { value = 0 }; };
template<class T>          struct is_same<T, T> { enum { value = 1 }; };

struct X
{
    operator int() const { return 0; }
    operator Int() const { return 0; }
};

static_assert( is_same<Int, int>::value, "Int is int" );

Reply via email to