This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/57311] New: Conversion operator can be overloaded with itself by using typedef
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 17 May 2013 10:04:11 +0000
- Subject: [Bug c++/57311] New: Conversion operator can be overloaded with itself by using typedef
- Auto-submitted: auto-generated
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" );