This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22107] Type checking seems to break with string operator=
- 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: 17 Jun 2005 20:17:27 -0000
- Subject: [Bug c++/22107] Type checking seems to break with string operator=
- References: <20050617201123.22107.weage98@yahoo.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-06-17 20:17 -------
Invalid, and here is why:
std::string s = 1234;
trys to call a constructor and not operator=.
s = 1234; calls operator= where the type is char so 1234 is converted to char and then calls the
operator=.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22107