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++/57311] New: Conversion operator can be overloaded with itself by using typedef


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" );


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