public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57311] New: Conversion operator can be overloaded with itself by using typedef
@ 2013-05-17 10:04 redi at gcc dot gnu.org
  2013-05-17 10:13 ` [Bug c++/57311] " redi at gcc dot gnu.org
  2021-08-02  0:46 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2013-05-17 10:04 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-02  0:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-17 10:04 [Bug c++/57311] New: Conversion operator can be overloaded with itself by using typedef redi at gcc dot gnu.org
2013-05-17 10:13 ` [Bug c++/57311] " redi at gcc dot gnu.org
2021-08-02  0:46 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).